[mythtv-users] [userjob] Movie genre by symlinks

Raymond Wagner raymond at wagnerrp.com
Thu Jul 15 05:45:45 UTC 2010

On 7/14/2010 23:30, Tom Sparks wrote:
> --- On Wed, 14/7/10, Raymond Wagner<raymond at wagnerrp.com>  wrote:
>> On 7/14/2010 08:08, Doug Vaughan
>> wrote:
>>> Tom,
>>>       If you have coding skills in
>>> python then the MythTV python bindings would provide an
>>> excellent interface to the MythTV database which would allow
>>> you to create your own userjob.
> What tables have the information I need?

If you're using the python bindings, you shouldn't touch any of the 
database tables directly.

>> No, that won't work.  Since MythVideo uses file
>> hashing, each of those symlinks would be detected as
>> duplicates, and only one location would show up in
>> MythVideo.  Luckily, that ability already exists. 
>> Hit 'm', go to 'browse by', and 'genre'.
> I am not using mythVideo

I'm assuming you have MythVideo installed, and the content in 
MythVideo.  Otherwise, the original question would have nothing to do 
with MythTV.  For the above mentioned reasons, the folder you symlink to 
must not be scanned by MythVideo, or you will end up with problems.

 >>> from MythTV import MythVideo, findfile
 >>> from socket import gethostname
 >>> import os
 >>> mvid = MythVideo()
 >>> vids = mvid.searchVideos(host=gethostname())
 >>> vid = vids.next()
 >>> sg = findfile(vid.filename, 'Videos')
 >>> from = os.path.join(sg.dirname,vid.filename)
 >>> for g in vid.genre:
 >>>     to = os.path.join('/new/path/to/files', g.genre, 
 >>>     print 'linking %s --> %s' % (from, to)
 >>>     os.symlink(from, to)
linking /mnt/mythtv/videos/Sahara.m2ts --> 
linking /mnt/mythtv/videos/Sahara.m2ts --> 
linking /mnt/mythtv/videos/Sahara.m2ts --> 

More information about the mythtv-users mailing list