[mythtv-users] MythicalLibrarian, symlinks and Myth: Will this work or will Myth lose its mind?

Matt Emmott memmott at gmail.com
Wed Feb 1 18:17:55 UTC 2012


On Wed, Feb 1, 2012 at 12:31 PM, Raymond Wagner <raymond at wagnerrp.com>wrote:

> On 2/1/2012 11:41, Matt Emmott wrote:
> > In my experience, Myth will always record to the first disk in the SG
> > until that one fills up, and then move on to the second. My thought
> > was that since Myth could see the second disk's free space, it would
> > remove recordings as needed.
>
> That's not at all the case.  MythTV uses a disk scheduler to place
> recordings on storage, with four different modes.  The "free space"
> scheduler just blindly records to the disk with the most free space, and
> the "percent free space" scheduler behaves similarly as would be
> expected.  The "disk I/O" scheduler will record to the disk with the
> lowest current load, allowing variable weights applied for concurrent
> recording, playback, commercial flagging, and transcoding, variable
> initial weights for local versus network filesystems, and even per
> directory weights.  The default "combination" scheduler is a mixture
> between the I/O and free space methods.
>
> You could weight the remote disk very highly (meaning low probability of
> use), but that's really just a clumsy way to do it, and abuse of the
> mechanism.
>
> > I'm going to revisit my idea of mounting the drives via NFS, and at
> > that point the symlinks should work. I hope that this won't have any
> > ill effects later on down the road... Say in six months when I want to
> > upgrade to .25-fixes or something, and Myth freaks out when all the
> > recordings are actually symlinks.
>
> Symlinks are really just a bad way to do things, especially when MythTV
> has a built in mechanism for doing this, and has had such since Storage
> Groups were added in 0.21.  You can define your own storage group
> names.  Recordings store which storage group they are expected to be in,
> however when searching for files, MythTV will fall through to searching
> every non-special (i.e. Videos) storage group to find the content.  Set
> all your recording rules to store to one storage group, move it to a
> path in a different storage group, and preferably update the group name
> in the database.  It would also be good to check inuseprograms to make
> sure you aren't pulling the file out from under something else.
>
> Recordings will go to the group you want it to, while your "archive"
> group will be left untouched.  MythTV still has control over the file
> should you wish to delete it.  Even the autoexpire methods can still be
> made to work, setting the minimum free space to something larger than
> your largest expected file (maybe a 20GB, 3hr movie?), such that as new
> content is archived in, old content will be deleted to maintain that
> free space.
> _______________________________________________
>
>
The problem (well, challenge, no offense intended) is two-fold with what I
want to accomplish. First, I want filenames that can be queried against a
tv listings database so aggregators like XBMC, Boxee and Plex can index and
display the episode descriptions to the end user. Second, I want this to
happen to _all_ of my recordings seamlessly, not just those I plan to
archive for the long-term. The latter could certainly be accomplished by
setting up specific recording groups for shows I want to keep entire sets
of, but the issue would still be that they are stored in the Myth-esque
naming convention, so if I connected via Samba etc, I couldn't easily see
which file is which episode.

I haven't used MythArchive since around version 0.20 or .21 - Perhaps it
has more features now and can do some of the things I'm looking for. I'll
head off and read the wiki but first, a ponderous tome:

I've used Mythlink.pl in the past to periodically sweep through and set up
symlinks TO my recordings, and then pointed my aggregators to its
"show_names" folder. Unfortunately, I end up with a huge flat directory of
vague filenames based purely on show and recorded date.

The more I think about this, it seems like what I'm looking for is a
version of mythlink.pl that would use whatever magic MythicalLibrarian uses
to get episode metadata, and then create symlinks to those episodes with
the naming convention that the aggregators could recognize. I suppose there
would have to be some logic in there that would check the source directory
periodically to remove the symlink when the original recording was deleted
by Myth, but otherwise it would theoretically work with the aggregators
with the added benefit of leaving the Myth recordings where they belong.

This is the point where I throw up the IANAC (I am not a coder) badge and
hide behind it, but does such a thing sound possible?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.mythtv.org/pipermail/mythtv-users/attachments/20120201/e34a0cf7/attachment.html 


More information about the mythtv-users mailing list