[mythtv-users] An companion script for jamu.py

Raymond Wagner raymond at wagnerrp.com
Thu Aug 11 01:35:40 UTC 2011

On Wed, 10 Aug 2011 17:57:07 -0700, Epinephrine Junky
<epinephrine_junky at beadon.ca> wrote:
> Raymond thanks for your response
>> 0.24 introduced batch metadata scanning for MythVideo content.  0.25
> will
>> include a video scanner in the backend, and will expand that batch
> metadata
>> support to recordings.  JAMU should be considered an interim solution,
> and
>> has been deprecated by internal support for its capabilities, and has
> been
>> removed from 0.25 entirely.
> I haven't been able to make the batch metadata work reliably on my
> For instance if some process other than myth drops videos into my
> mythtv-videos directory they don't show up in mythvideo.  Is there some
> configuration setting that changes how often it rescans this directory?

If you are using 0.24, there is no scan.  Batch metadata processing
triggers when a scan is manually performed (if configured as such), or when
manually run from the MythVideo menu.  Once started, it will run until
complete, or until the user exits MythVideo.  Each new video will be
processed exactly once.  Once processed, the video is tagged as processed
in the database and will not run through batch processing again.  Metadata
downloading can be repeated manually per video through the MythVideo menu,
or with the 'w' hotkey.  This is designed intentionally to keep down
unnecessary load on the metadata providers.

If you are using 0.25, there is now an implementation of the scanner in
the backend, but this still must be manually triggered through a backend
protocol call.  This is not automated, as it is intended to work primarily
with users of the UPNP server.  Since they may not be using a frontend at
all, a couple line script using either the Perl or Python bindings can be
used to trigger the scan rather than having to go through the UI.  

> If I "scan for changes" from the frontend once then around 20% of my
> previously available videos disappear entirely from my mythvideo
> (they are still on the drive though) and then I "scan for changes" again
> and most, but not all, of the time it finds all videos including the new
> ones.

When you scan for changes, MythVideo pulls a list of files from each
folder defined in the Videos storage group in each accessible backend.  Any
new files without a matching path in the database get hashed.  Any previous
files that are now found missing are compared to these new hashes to detect
moved files.  Remaining new files are added to the database, and remaining
missing files are removed.  The only reason I can think of that content
would be removed one scan and added back the next would be if your video
content were accessed over some unstable NFS or SMB mount.

> I got frustrated with this illogical behavior so I stopped using
> "scan for changes" as soon as I found that jamu -MF was 100% reliable in
> inserting new videos into the myth DB.  BTW back in .22 "scan for
> was 100% reliable I don't remember if it was .23 or .24 that introduced
> this inconsistent behavior.

The only difference in scanning behavior between 0.22 and 0.23 was the
addition of that hashing.  The addition of hashing has the consequence that
only one single instance of a file may exist on the filesystem at any given
time.  If the file shows up twice, either through duplicate instances, or
the use of symlinks, MythVideo will detect that as a moved file, and update
the link in the database accordingly.

>> Second, you could be downloading content like Sintel, and other open
>> licensed video, but in that case, release of such content is so few and
> far
>> between, its easier to just handle those individual files as they are
>> available, rather than write any form of script to do it automatically.
> I disagree, in my opinion any time I need to open a shell on this
> to make media files work that is a failure.  For example Earth-Touch
> Channel HD (http://www.earth-touch.com/) is a monthly show that is
> available on Miro/RSS.  When a new episode shows up on my drive I'd like
> to be available in the mythvideo listings.

If you have content available through Miro, check out MiroBridge (
http://www.mythtv.org/wiki/MiroBridge ).  It will automatically synchronize
the content subscribed to in Miro with either recordings or MythVideo, user
selected.  Individual services such as this are better handled through
individual applications such as MiroBridge, or through individual grabber
scripts for MythNetvision, that can be tuned to handle the quirks of each

More information about the mythtv-users mailing list