[mythtv-users] scan for changes

Raymond Wagner raymond at wagnerrp.com
Mon Mar 26 17:28:37 UTC 2012


On 3/26/2012 12:58, Mike Perkins wrote:
> On 26/03/12 04:45, Raymond Wagner wrote:
>> On 3/25/2012 22:51, Joe Mythtv wrote:
>>
>>> I wish there were a command line way to initiate the scan - I could run
>>> my own script to look at the 'new footage' folder and rescan when I 
>>> see new
>>> files.
>>
>> In 0.25, there is an option in 'mythutil' to trigger a scan in the 
>> master
>> backend. Prior to that, JAMU had a scanner, and there was a scanner 
>> built into
>> the Python bindings. What I'm getting at is that none of that should be
>> necessary, and the interactive scanner should be plenty fast. I'm 
>> interested in
>> whether there might be some flaw in the scanner that needs to be 
>> resolved.
>>
> I'm currently importing some videos which need heavy editing 
> beforehand, so I'm doing it on another machine elsewhere on the 
> network which does not have myth on it. Once I'm satisfied I'm copying 
> them to the video storage directory via NFS.
>
> It would be useful to be able to trigger a rescan when I'm done for 
> the day. Most of these videos are for my son who isn't up to 
> rescanning when he brings up the front end, and I often forget. A 
> remotely-run mythutil option would be useful in this circumstance. 
> Speed is not important in this case.

If you have some script set up to automate much of this process, I would 
actually consider it better to have that script add the video itself.  
Tacking this onto the end of the script should perform the same process 
as the scanner would, only selectively.


from MythTV import Video, VideoGrabber
vid = Video.fromFilename(<filename relative to SG root>)
vid.create()
## if movie
grab = VideoGrabber('movie')
res = grab.sortedSearch(vid.title)
if (len(res) == 1) or ((len(res) > 1) and (res[0].levenshtein == 0)):
     vid.importMetadata(res[0])
## if television
grab = VideoGrabber('television')
res = grab.sortedSearch(vid.title, vid.subtitle)
if (len(res) == 1) or ((len(res) > 1) and (res[0].levenshtein == 0)):
     vid.importMetadata(grab.grabInetref(res[0].inetref, res[0].season, 
res[0].episode))



More information about the mythtv-users mailing list