[mythtv] mythvideo DB enhancement
George Nassas
gnassas at mac.com
Thu Jan 3 14:41:08 UTC 2008
For folks who weren't following the Windows porting thread, somewhere
around http://www.gossamer-threads.com/lists/mythtv/dev/307128#307128
a discussion broke out around how MythVideo manages its list of
videos and I volunteered to do some work in that area. This new
thread distils the prior comments and keeps the discussion going.
OK, so how does mythvideo keep its list of videos? Currently there is
a list of "prefixes" which indicate directories under which videos
may be found and a videometadata table with all the files found under
those prefixes. The table stores an absolute pathname for each video
and during UI init time there is some unmapping to relate paths back
to prefixes to organize their presentation.
The proposal is to use storage groups in place of prefixes. An
unlimited number of storage groups could be marked for use with myth
video. Aside from the regular SG data the video ones would carry
video-specific information such as default/minimum parental level and
(optional) top-level folder under which videos appear. Filenames in
the videometadata table would be updated to consist of a storage
group name and a relative path within that SG [ we will enforce
pathname uniqueness within a SG even though it's possible to have
dups in a multi-dir SG -- same as the situation with TV recordings ]
One benefit that occurs to me is with multiple storage groups it
becomes possible to have custom lists of videos for each frontend.
You might have a "MythVideo" storage group that references the
contents of an NFS share which is common to all frontends but each
frontend could also have a "VideosOnBoxN" storage group that points
to local storage. They would all co-exist in the database because
each local storage group has a unique name and frontends only look at
storage groups pertinent to them. Currently all videos must be
visible to all frontends at the same place in the filesystem or the
scanner prompts you to delete the entry, it's workable but messy and
an SG solution would be cleaner.
Issues from the earlier thread:
> The UI is the only part I'd dread. Though it will be nice to
> finally fix the
> tree builder (I wanted to split out the prefix back then, but
> wasn't making
> schema changes for that release).
>
You (Anduin) said this before storage groups were suggested but now
that they're in play how would you see the UI? Issues I see are where
to define the storage groups, how to tell mythvideo to use them and
how to tell the rest of myth not to use them.
Last one first: so far as I know once an SG is defined the TV
recorder will feel free to put recordings there. Perhaps extend SGs
with a series of flags saying who can write stuff there? Easy enough
and a small separate ticket too.
UI: the only place I know to define storage groups is mythtv-setup.
That panel could be brought over to the plugin to allow per-frontend
settings.
Or, perhaps it could be something like the way playback profiles are
defined now. Instead of profiles the top selector control would show
video storage groups and instead of resolution rules there'd be the
per-SG attributes (parental, etc) and then the list of directories
for the group.
Is there anything in the new UI code that would be appropriate here?
>> Building the video tree then becomes a matter of tearing through the
>> relative paths in videometadata (or the list returned by
>> SG::GetAllFiles) and passing them to smart_dir_node. There will be a
>> slight performance gain there but I doubt it's much.
>>
>
> It is only this easy because you want to skip the prefix name part,
> and
> scans will need to do that same prefix placing (currently done with
> string
> compares) with file existence tests.
>
Not sure what you're saying here. I would make SG::GetAllFiles return
relative paths (since one beauty of SG's is you don't care which dir
the file is in) and that's what we want for constructing folder views
and also for comparing scans with what's in the DB.
I had other things to include but it's getting late and I'm fading.
- George
More information about the mythtv-dev
mailing list