Skip to content

add a tagging system for movies #1108

Merged
merged 5 commits into from Jul 8, 2012

6 participants

@Montellese
Team Kodi member

A few nights ago I had a discussion with @jmarshallnz concerning movie sets and what a pain in the ass they are because they require special handing all over the place. There has been a plan to reduce the set feature to a single set per movie (TheMovieDb only provides one set per movie and will keep it that way) but as users always start screaming when you take something away from them we decided that we should first introduce a more flexible (but also more separated) tagging system for movies (and possibly for other media types).
This PR adds a "tag" and "taglinkmovie" table to the videodb which allows to set as many tags for a movie as the user wants (as it is currently possible with sets). Additionally there's a new "Tags" node in the video library with a "New tag..." button to create a new tag and "Add movies" and "Remove movies" context menu entries in the tags node to allow users to manually add/remove movies from a specific tag. Apart from additional smartplaylist implementation for tags there's no further integration of tags yet i.e. they are not available to skinners in the movie view etc.

I'm throwing this out there to widen the discussion which took place between jmarshall and me. Currently the GUI-side integration of tags into the library is very movie-specific but could (more or less) easily be extended to tvshows and musicvideos (seasons and episodes probably don't make that much sense but I'm sure some users would request it).

For the users the advantage of tags over sets is that they can create/modify them in the GUI and don't need custom NFOs to get them in there in the first place. A disadvantage would be that tags are not scraped but not sure if that would make sense anyway as tags are pretty user-specific IMO.

The advantage for us developers is that we can simplify the code for sets by degrading it to one set per movie (I've already done the necessary work in another branch) which will make both SQL queries and some special handlings in the GUI easier.

EDIT: Forgot to mention that I didn't really integrate tags into the texture cache. All I did was set a (new) default image.

@jmarshallnz
Team Kodi member

Wow, nice work!

We need to consider carefully before we add the ability to the UI to add tags/delete tags etc.

To me it seems natural that this would be done from the info dialog - i.e. you'd add tags to a movie, and if they're new tags they're added. I guess it depends on how you're using the tag (are you using it to group a bunch of movies together, or using it to add additional lookup info to each movie?)

Either way, I can already hear the demands for removing the "New tag..." item :)

I'm seriously starting to think that we should be removing ability to customise stuff from the UI, at least the clunky way we have things currently, and instead ensure that it can be done well over JSON-RPC and then implementing (or encouraging) a nice web interface/remote app interface for doing it. After all, more and more folk have a touch interface available to them, and it's far more efficient to do things that way. Further, we should be looking at modifying the exiting info window so it can handle this stuff, perhaps via creating a new "Edit" dialog and having that replace the existing info dialog over time?

@Montellese
Team Kodi member

The reason I put all the "New tag...", "Add movies" and "Remove movies" into the tags node is because I didn't wanna put any more buttons/context menu entries into the movie view. There the context menu is already too full as it is. I agree that the more common use case would be for someone to look through his movie library and then think "Ah this movie could be tagged with foo and bar" and would want to do that right from where he is.
But at the beginning when there are 0 tags it might be faster to be able to create a new tag and get prompted with a list of all movies and then you can quickly go through it and add matching movies. If later on you notice that you missed one you could still add it.

Tags, sets etc can already be manipulated over JSON-RPC but there is one problem (especially for tags): it is not "additive" or "subtractive" i.e. you always have to retrieve the existing list of tags/sets, then add/remove items and pass that to VideoLibrary.SetMovieDetails. While this is easy enough for clients to implement, when done wrong the user will loose all his/her tags/sets/... except the new one(s).

@jmarshallnz
Team Kodi member

The only problem I have with the context menu is it's quite slow without a keyboard + mouse anyway (or touch equivalently) whereby I wonder whether it might be better to leave it out until we have a better "Edit Movie" dialog (to eventually replace the video info dialog). Doesn't really worry me much either way as it can be removed later if/when a better way to handle it is done.

@Montellese
Team Kodi member

OK I have re-written the current logic to be more or less media type agnostic i.e. no hardcoded movie support. Both the "tag" (so that tag name uniqueness checks only apply within a certain media type) and the "taglinks" table have a "media_type" column and all the context buttons etc determine the current media type based on the current path.

@Montellese
Team Kodi member

OK I have updated the code. I removed the media_type column from the "tag" table and replaced it's functionality with sub-queries. Furthermore I have updated the (UNIQUE) INDEX queries and tested them with EXPLAIN QUERY PLAN and they are being used as expected.

@jmarshallnz
Team Kodi member

Looks ok - just need xcode projects update as well (I can probably add after the fact if you want).

@Montellese
Team Kodi member

And there are the updates of the xcode project files ;-)

@Montellese Montellese was assigned Jul 8, 2012
@jmarshallnz
Team Kodi member

Ready to go then once the minors are taken care of.

@Montellese Montellese merged commit f128546 into xbmc:master Jul 8, 2012
@Karlson2k
Team Kodi member

Disadvantage: if you have thousands of movies than it will be real pain to mark them as set. It will be a real pain even to find specific "movie set" in tags to make single movie by hands!
Besides TMDB, kinopoisk also supports movie sets.
Why do you want to just to strip movie set support from scrappers?
My suggestion: future more extend movie tag to support different movie tag type. Convert "movie set" to "movie set" tag type.

@Montellese
Team Kodi member

Nobody talked about removing movie set support so not sure what you are talking about or what your concern is. Movie sets will stay in XBMC but they will most likely be limited to one set per movie so so "Batman" can't be part of both a "Batman" and a "DC Comics" set. Instead you can e.g. put it in a "Batman" set and add a "DC Comics" tag to it. And the TMDB scraper will still scrape the movie set information from TMDB and we talked to the TMDB admin and he assured that TMDB will always only support one set per movie.

@Karlson2k
Team Kodi member

OK, thanks for explanation.
This way is looks good.

@Deano316
Deano316 commented Jul 9, 2012

So we could in theory, once this is fully implemented, have a hotlink from a movie to a tv show/tv show season?

@Montellese
Team Kodi member

These are not hotlinks, these are tags. You can add as many tags to a movie as you want (although currently it only works the other way around in the GUI because you can only add movies to a tag). Linking between different media items is something completely different.

@vicbitter

On MySQL version 5.5.5 and above, the default storage engine is InnoDB. Creating the tag table and index with storage engine InnoDB fails. Can you create the table using ENGINE = MYISAM?

@pieh

I wonder if we should set content to "movies" here - this is list of tags - maybe items.SetContent("tags");?

Team Kodi member

Yeah, probably should have content type tags for this one.

@pieh

why is this visible condition needed?

Team Kodi member

copy n paste ftw?

Team Kodi member

Hehe yes. Thanks for pointing it out.

@tru tru added a commit to RasPlex/plex-home-theatre that referenced this pull request Apr 11, 2014
@tru tru Started work on PlayQueues always visible.
Part of #1108
f429884
@tru tru added a commit to RasPlex/plex-home-theatre that referenced this pull request Apr 18, 2014
@tru tru Started work on PlayQueues always visible.
Part of #1108
dc9fddb
@tru tru added a commit to RasPlex/plex-home-theatre that referenced this pull request Apr 18, 2014
@tru tru Refactored PlayQueueManager.
This makes it possible to handle Local and Remote playQueues with the
same API and also show the PlayQueue on the HomeWindow at all times. It
now also restores the PlayQueue when the sessions ends.

Clicking the PlayQueue from the home window also takes it to
PlexPlayQueue.xml

Related to #1108
Related to #1106
144436f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.