[mythtv-users] Multi-tenant type of setup

Stephen Worthington stephen_agent at jsw.gen.nz
Fri Mar 15 02:54:09 UTC 2019


On Thu, 14 Mar 2019 20:44:57 -0500, you wrote:

>On Thu, Mar 14, 2019 at 03:46:44PM -0500, Greg Oliver wrote:
>> Hi,
>> 
>> I was wondering if anyone has successfully setup MythTV to be a typee of
>> multi-tenant setup.  2 cases:
>> 
>> 1.  Same household, multiple viewers - same recording.  A good way to keep
>> user 1 from deleting recordings before they are viewed by all - anyone ever
>> come up with a design for this?
>
>As Simon already mentioned, this has been discussed but nothing was
>ever done.
>
>> 2.  Different Households - 1 backend (case 1 still applies as well).
>> Recording Groups can keep them separate with views, but still #1 would
>> apply and step on each other here.
>
>I actually have some experience with this.
>
>We use recording groups to partition the recordings.  Recordings in
>shared groups require coordination before they are deleted.  Recording
>in groups that are exclusive can be freely deleted at will.
>
>I personally patched the source code so that new, recording rules on
>specififc frontends automatically default to a custom recording group.
>While writing this reply, I realized I should change that to use a
>hsot-specific setting so it could be used by others.
>
>David
>
>> Anyone have something similar working with good results?

The thought I came up with was similar to this.  I make recordings on
my system for my mother, and want to eventually automate how she gets
access to them instead of my having to use mythexport/mythimport to
copy them to her MythTV box.  I record things exclusively for her
using a different recording group, and have a template set up so that
I can easily use that to make a recording rule that puts things in
that recording group.  However, I also have a second set of recording
directories on each of my recording partitions, and the template tells
mythbackend to record her recordings to those different directories.
So in theory, when I get around to it, I can make a script that will
automatically export the database entries from any new recording that
is in one of those directories to her system, and delete it from mine.
The recording file would stay in her recording directory on my system,
and her system would have access to it via the network and would
delete it from there when she has watched it.  That is the simple bit.

Handling recordings that we both want to watch is more difficult.  I
put them in a joint recording group, but the recording files go to my
normal recording directories.  Here my idea was to use hard links from
those recordings to the directory that my mother's MythTV box has
network access to.  I would have my script export the database entries
for these recordings, but also leave that data in my database.  She
would be able to play these recordings from the hard link from her
network accessible directory on my box.  Then when she deleted them,
if I had not watched and deleted the recording, her delete would just
delete the hard link and leave the recording for me to watch still. If
I watched it first, then my delete of the recording would delete it
from my recording directory, but leave the recording file still in her
recording directory where it had been hard linked, and her delete
would then delete the actual recording file.

I have not actually got this working yet, but I think it should allow
it all to work automatically.

Trying to make multiple users work with only one database is even more
difficult - without significant new code in MythTV, I can not see a
way to make it work.  But if the frontend boxes that are being used
for a multiuser setup are capable enough, they could each have a
mythbackend setup with a dummy tuner, and that mythbackend could get
the database exports from the main recording mythbackend and be used
like my mother's system.  The secondary frontend boxes would still
need to have a mythfrontend setup that talked to the main recording
mythbackend to set up recordings from the Guide, but they would never
play or delete recordings from anything except the mythfrontend that
talked to the local mythbackend.

As an alternative, if the other frontend boxes were capable of doing
recordings themselves, but just lacked tuners (or access to the
aerials), then it is possible to set up the tuners on the main MythTV
box for remote access using SAT>IP via TVHeadend or minisatip.  I have
done this with my DVB-S2 tuners.  SAT>IP manages the tuners so that if
a tuner is already on the correct frequency for a newly requested
channel, it will re-use the tuner to service the new request.  So
multiple backends can be recording the same channels at the same time
using the same physical tuners.  The big downside of SAT>IP is that
MythTV does not understand the SAT>IP protocol, so it is incapable of
doing a scan to find the channels that way.  So you have to set up all
the SAT>IP channels via external software, and it has to put the URLs
for the channels into the MythTV database (iptv_channel table and
channel table) or create a playlist file that MythTV can use to load
the channel data.  But this is possible to do - it is how I do my pay
TV satellite channels from my DVB-S2 tuners.  MythTV is also unable to
gather EIT EPG data from SAT>IP tuners, so that also needs to be done
externally and loaded into MythTV using an xmltv file via
mythfilldatabase.


More information about the mythtv-users mailing list