jurialmunkey / plugin.video.themoviedb.helper

GNU General Public License v3.0
194 stars 94 forks source link

[Question] Library integration #695

Closed harristom closed 2 years ago

harristom commented 2 years ago

Tbh I'm not sure if this is a bug or a feature request as it's not 100% clear to me how the library integration is supposed to work. I have a bunch of local files already stored in my library. I would like TMDB Helper to show new episodes for TV shows that exist already in my library (e.g. I have files and library entries for episodes 1 and 2, TMDB helper would add library entry for episode 3). I have set my library paths in the addon settings, ticked the box to add new episodes, and run the update but nothing gets added.

drinfernoo commented 2 years ago

Have you checked your log?

jurialmunkey commented 2 years ago

Library integration does not check your library for existing tvshows.

Items are added to the library in one of two ways:

  1. Via a monitored Trakt list added in the settings
  2. Via the context menu by choosing "Add to library" on a TMDbHelper item or a Trakt user list

The automatic update does two things:

  1. It checks your monitored Trakt lists and adds any movies or episodes not in your library
  2. It checks tvshows which were added via the context menu and adds any new episodes not in your library

So you have two options: create a custom list on Trakt and add as a monitored list; OR find the tvshows using TMDbHelper's search function and then add the shows via the context menu.

harristom commented 2 years ago

Thanks! Suspected that might be it, I'll use Trakt in that case. Maybe it could be an idea for the future though? Though admittedly I'm probably an edge case in wanting to mix local and online sources.

jurialmunkey commented 2 years ago

Thanks! Suspected that might be it, I'll use Trakt in that case. Maybe it could be an idea for the future though? Though admittedly I'm probably an edge case in wanting to mix local and online sources.

I mix local and online sources in my own library. I wouldn't say it's an edge case either.

However, I think automatically updating all missing episodes for local sources isn't a great idea. Generally you're going to want to add new local files at some stage - e.g. download; PVR recording; or physical media rip - and if TMDbHelper was automatically adding missing episodes then that would happen before you had a chance to add your own.

Basically, whenever you wanted to add new local files you would have to first go find and delete the strm file TMDbHelper made, clean the library to remove the database entry, then add your new file and rescan the library. It would be a complete pain for any show that you were currently collecting local files for.

The current method of creating a Trakt subscriptions list (or manually adding individual shows via the context menu) gives you control over which shows update automatically and which ones you update manually.

As a side note - I really recommend that you keep your local file library source in a separate folder from the TMDb library source (you just add two separate sources in Kodi). That way it is much easier to delete whole folders of .strm without having to pick them out amongst your local files.

harristom commented 2 years ago

Basically, whenever you wanted to add new local files you would have to first go find and delete the strm file TMDbHelper made, clean the library to remove the database entry, then add your new file and rescan the library. It would be a complete pain for any show that you were currently collecting local files for.

Sorry, another probably stupid question - why would you need to do that? I thought it automatically plays a local file if one is available?

jurialmunkey commented 2 years ago

Sorry, another probably stupid question - why would you need to do that? I thought it automatically plays a local file if one is available?

Short Answer: You'd end up in a recursive loop of TMDbHelper opening itself because one of the "local files" in the library for the Episode that it is attempting to play is actually a .strm link back to TMDbHelper (in reality there's a safe guard to prevent this loop from happening but the side-effect is that it prevents TMDbHelper playing that Episode from the library).

Longer Answer: Consider the below scenario

Normal so far. However, what happens next week when Episode Two airs?

So far so good. But what if in the meantime you were also recording or downloading Episode Two? TMDbHelper has already beaten you to it and made the .strm file before your recording/download has finished!

Worse still, if you don't delete the .strm then TMDbHelper won't be able to see the .mp4 because the first match for that episode in the Kodi library is going to be the .strm -- and since the .strm links to TMDbHelper, the "Play with Kodi" option is not shown because we don't want to end up in a never ending recursive loop of TMDbHelper opening itself.

harristom commented 2 years ago

Thanks for explaining, makes perfect sense :) I thought for some reason that Kodi collapsed the duplicates to one library entry and prefers the local one but now I think about it I'm not sure how that would even work since as you say the .strm is also technically a local file