PDA

View Full Version : Changing the behaviour of video library and locked sources


jmarshall
2008-05-23, 06:55
Hi All,

Currently we allow a single library to be shared among multiple users, some of which may only be allowed access to certain file sources (adult vs kids and so on).

I'm concerned (from a code point of view) about how we deal with filtering out items the user should not or does not want to see (such as items they do not have access to, or items they have watched).

The current system filters out items from all levels in the hierarchy to which a user does not have access. This is pretty easy at the title level, we just match on path, but is trickier at the higher levels (such as Genres). The Genre is only shown if there exists one or more movies in the Genre that lie in a path the user has access to. This ofcourse can be pretty damn slow if we're talking about an Actors list (over 10k actors in a library being fairly common). It also yields rather unwieldy code.

I can think of 2 alternatives to this system:

1. Don't filter at all - display all movies and tvshows no matter what. The filtering only occurs during playback, where the user is denied being able to play back the file as they don't have access rights. Way less code is involved (thus less chance for bugs, and things can be optimized better) but little Jimmy gets to see his Dad's porn covers.

2. Filter at the title level only. This has the advantage of less code at the higher levels, but has the disadvantage of the possibility of empty listings when a user clicks on a genre/actor/whatever.

I tend to prefer the first option for access filtering. Let's be honest: Who actually does db lookups for their porn and stores them in the same library as their kids' Teletubby videos?

Watched and Unwatched status, however, is trickier. I tend to prefer option 2 for this, as anything else has the same problems. It is easier from an SQL point of view to allow playcount to trickle up to the high levels, but it still involves quite a bit of messing around.

You guys use XBMC (probably more than I do!), so I'm after comments from any and all users as to how you think this should go.

Thanks,
Jonathan

AaronD
2008-05-23, 07:50
I can appreciate just how complicated (and therefore slow) the code would be for 1 above, particularly for large databases. Therefore, my vote would be for:

1. title level filtering for genre, actor, year, etc. I would rather have "false positives" at the high level but hide the title when viewing titles.

2. higher level filtering for watched / unwatched status. Basically, I want to only see tv series that contain episodes I haven't watched.


Let's be honest: Who actually does db lookups for their porn and stores them in the same library as their kids' Teletubby videos?

I agree, right now I don't. But I think I would if I new my kids weren't going to be exposed to them. :rolleyes:

jmarshall
2008-05-23, 08:51
Thanks for your thoughts.

TV series already inherit watched status (this is in the watched branch which will be merged this weekend). I'm talking only of higher levels than this (Genres, Actors, Directors, Years, and Writers).

I don't really understand your first point - I think it refers to what I stated as my second option. Are you referring to watched/unwatched or access filtering?

As for the adult stuff: you can always have a separate library for it (i.e. under another profile), it just means it's completely separate from your main library.

Cheers,
Jonathan

AaronD
2008-05-23, 11:36
Thanks for your thoughts.

TV series already inherit watched status (this is in the watched branch which will be merged this weekend). I'm talking only of higher levels than this (Genres, Actors, Directors, Years, and Writers).

I don't really understand your first point - I think it refers to what I stated as my second option. Are you referring to watched/unwatched or access filtering?

As for the adult stuff: you can always have a separate library for it (i.e. under another profile), it just means it's completely separate from your main library.

Cheers,
Jonathan

Yes, in my first point I am saying that your second option would suit me better. (whew, make sense!?)

Reading my post I had already realised that actually watched status would be handled according to your other thread on this topic. But I would still stand by my comment that the "false" positive at the high level and hiding titles at the title level would be a good compromise between giving people what they want and making its performance acceptable.

And I tried profiles a while ago with seperate databases, but it just became too much of a pain to keep all the databases all in synch. Although possibly now that I've been able to extract all of the library info into locally stored XML files it would be a little easier.

Cheers
Aaron

jmarshall
2008-05-25, 09:12
Ok, just a quick note to say that the watched branch in SVN has been merged to trunk now.

This gives smartplaylists at the movie, episode, show and album levels (in addition to songs and musicvideos that were already supported).

Much of this needs testing, but in particular it gives the tvshow watched status stuff as I wrote above.

Cheers,
Jonathan

ChoccyHobNob
2008-06-06, 22:13
Hi,
I'm one of the people who does scan adult movies into my database along with the kids films, I don't have any children so it doesn't matter to me if the porn is there most of the time.

I do however have nieces and female friends who come round now and then to watch a movie, when they are around I do need to hide some stuff away to avoid offence or in the case of the kids corruption of their souls lol

Option 1 is not suitable, there is no way I want porn covers to appear if they are set to hidden,

Option 2 is not suitable because I also want porn genres, actors, studios etc hidden. Who wants their kids to browse by genre and see Action, Adventure, Anal, Animation or by actor and see Janet Jacme (damn Ron Jeremy, Tracy Lords etc. for starring in mainstream movies as well lol)

I think the answer to the problem is 'option 3' lol, to have a separate category for 'Adult' movies, along with the already present Movies, TV Shows, Music Videos categories, then in library settings you could have a 'hide adult' toggle.

At the profile level 'share library', check the 'hide adult' setting and then just lock the settings. If you put all the adult stuff in a separate database file like you do already with the tv shows, you could just not load the datafile if the settings say to hide it. This doesn't cover the "the guys are coming round for beer and movies, hide all the chick flicks" use case though lol

I think this is more like how people actually use their adult movies, I doubt people looking for a porn movie really want to browse through their kids films to find it, even if they don't mind them both being unhidden. They naturally seem to fit in a separate section the same way the music videos and tv shows do.

As for the watched/unwatched filtering, I would rather empty folders didn't show. Isn't it just a rowcount using the sql selection criteria for that year/genre? if you get 0 rows, don't display it? I don't really feel strongly one way or the other, I just think displaying an empty folder in library mode makes it look amateurish.

kraqh3d
2008-06-06, 22:51
as a point of clarification, tv shows are not kept in a separate database. all videos (movies, tv shows, and music videos) are kept in the same myvideos db file.

ChoccyHobNob
2008-06-06, 23:15
oh when did that change? there used to be a tv shows db didn't there? I don't suppose it makes much difference though, the idea is still valid :-)

kraqh3d
2008-06-06, 23:18
it's always been that way. there are different tables, but its the same database.

ChoccyHobNob
2008-06-07, 00:16
The file I was thinking of is MyPrograms6.db, I just looked inside it and now I know I'm an idiot :lol:

jmarshall
2008-06-07, 02:25
Thanks for the comments ChoccyHobNob. I think the screenshot you posted over at those other forums has pretty much convinced me of the way forward - perhaps you could repost it here so that others can see?

I'm agreed that the best way forward is to separate adult out into a different section. This is actually pretty simple, and my current thinking is just a single flag in the movies table (that can be extended later if necessary) for movie type.

The queries for adult section would then match genres that also match a movie that is of the "adult" type. This is pretty much identical to how the current genre/actor/year etc. levels are done anyway.

Once this setting is in, I would further remove filtering based on "locked share" and just display them all (i.e. option 1 in the original post). We'd thus have a separate "Adult" section on the root, which I think makes the most sense to most users.

As for watched status, I don't see a huge benefit in having it at the other levels other than title - if you are searching for a particular genre of movie, do you really care whether or not you've watched them or not? If it comes up with an empty folder yet specifically states "5 (un)watched movies also in this category" on screen, then I think that would satisfy the problems with empty listings, but I'm interested in thoughts on this. In either case, this is no where near as complicated as far as the amount of code needed for the locked/unlocked shares.

Thoughts/comments/criticisms welcome :)

Cheers,
Jonathan

ChoccyHobNob
2008-06-07, 04:25
Which screenshot? I've posted lots over there but none in the topic about library types so I don't know what one you mean (pm me the link to the post if you like)

Your ideas about the adult flag sound about the same as mine, is that how you separate out music videos and tv shows now? In the 'set content' screen, would the adult scrapers only appear if you select a content type of adult? would all the scrapers need to be updated to set the new flag? Will there be a 'recently added adult' section to go with the recently added movies and tv shows?

As I said about watched status, I really don't feel strongly one way or the other, whatever suits you is fine. I usually only turn that filter on when I'm in the title list so I would rarely see any folders, empty or not. Here's a thought though, why not change the watched flag to a watched count? Not a massive change but then you could sort the movies you watch the most to the top of the list. Yes there are lots of movies I watch more than once, and not all of them are Adult :) Then on the top level you could have most watched movies, most watched tv shows etc next to the recently added folders

jmarshall
2008-06-07, 04:41
Sorry, there wasn't a screenshot afterall - the post I was referring had this comment:


I'm fed up seeing

Action
Adventure
Anal
Animation

in my Genre list blink.gif


And yes, that's the idea - adult scrapers would be a separate category, and yes, it may require updates to the scrapers in question. Internally it wouldn't even be a separate table in the db, however - just a flag to split them up in different ways (as the actual table layout is the same in both cases still).

As for watched status, it already is a count (it's now "played count"), and you can produce such lists using a smartplaylist no problem whatsoever - have a play, there's lots of fun stuff that can be achieved with them, and it all needs testing as I can only test so much. There's a thread here about it that welcomes comments:

http://xbmc.org/forum/showthread.php?t=32635

Cheers,
Jonathan

ChoccyHobNob
2008-06-07, 13:17
/me goes off to play with smart playlists
;)

plooger
2008-06-25, 08:16
And yes, that's the idea - adult scrapers would be a separate category, and yes, it may require updates to the scrapers in question.

I've begun deleting all the adult movie scrapers from my build, as I don't want them to show-up under the Videos/Movies "Set Content" dialog. A built-in method for sanitizing a profile would be handy.

ChoccyHobNob
2008-09-02, 10:10
Did anything ever come of this?

jmarshall
2008-09-02, 10:50
Nope - we hit the feature freeze before I could really get much done.

dtviewer
2008-09-02, 22:48
I actually changed the 'myprograms' button to activate myvideos, and have that pointing to a default folder with my 'special' movies.
I have the 'myvideos' button go to a different default folder with my dvd rips.

I wasnt using the myprograms button anyway and didnt plan to.