[mythtv-users] UPnP & MythVideo

Wade Maxfield mythtv at hotblack.co.nz
Tue May 6 22:26:37 UTC 2008


Greg Estabrooks wrote:
>> But it doesn't seem to honour parental levels. It also seems to just 
>> show a list of all files in the MythVideo directories, not just those 
>> that have been added to the database.
> 
>  Correct, it doesn't rely solely on the database, but instead on the content
> and just gets info like coverfiles and such from the database.
> I've never seen any examples of parental controls done via upnp, so
> if you can point me to "free" apps and clients that do I'm more than willing
> to look at implementing something like that.
> 
>> I haven't found any settings or instructions that might change this 
>> behaviour, other than totally disabling UPnP when starting the backend 
> 
>  Nope, it's on by default with no ability to restrict what it will show other
> than not having files there of course. (For the readers you can disable it in trunk
> as well as control how often it updates it's list of videos).
> 
> 
>> Is there something I have missed in regards to new settings for 0.21 
>> that might get it to only list items that are in the videometadata db, 
>> and preferably only if they have a parental level of 1?
> 
> 
>  No, currently there are no settings to behave that way.
> 

Hmmm.  That's a bugger.  Maybe if there was a setting on the backend to 
set a maximum show level to index, and also an option to only include 
items that are in the videometadata table. If it can use the 
videometadata table to find info like cover files, then technically you 
could ignore items below a certain level, etc.

My problem is that the only solely UPnP device is my g/fs sons' Xbox360, 
and there are video files I don't want him to have access to (I've got 
episodes of shows he wants to watch, but not til he's finished his 
chores 8) so I've set the default parental level to 1 on all the 
frontends, and the videos to level 4. Which worked fine til I upgraded 
to 0.21.


Just as a quick thinking out loud exercise:
Something like "UPnP browses files" on Video Settings > General Settings 
(2/7) and "UPnP Parental Level" on Video Settings > General Settings (6/7)

If UPnP browses files is off, then after rebuilding the list do:

DELETE upnpmedia as u
FROM upnpmedia as u
LEFT JOIN videometadata as v
ON u.filepath=v.filename
WHERE u.itemtype='FILE' AND v.intid IS NULL;

And this should remove items that haven't been scanned yet.

If UPnP Parental level is anything other than 4 then after rebuilding 
list (Level 2 for example):

DELETE upnpmedia as u
FROM upnpmedia as u
LEFT JOIN videometadata as v
ON u.filepath=v.filename
WHERE u.itemtype='FILE' AND v.showlevel > 2

should remove any items above the chosen Parental Level.

Then after any of those doing

DELETE upnpmedia as u
FROM upnpmedia as u
LEFT JOIN upnpmedia as u2
ON u.intid=u2.parentid
WHERE u2.intid IS NULL AND u.itemtype='FOLDER';

Should remove any items that are just empty directories.  That last one 
might need to be run a couple of times, in case a folder only had empty 
folders the first time through.

Is any of that workable?

  - Wade


More information about the mythtv-users mailing list