plugin.video.themoviedb.helper
plugin.video.themoviedb.helper copied to clipboard
Handling stream-local-library duplicates with Library Node Editor?
I know when adding a Trakt list for library integration it is checked whether the media exists in the local library, and where it does, streams are not added to the TMDBH library, as to prevent duplicates.
The issue I have encountered is where I make changes to my local (much smaller, relative to my TMDBH) library by adding TV show content which results in duplicate episodes displaying. In the best case this is only a single season of a TV show, in the worst case many changes will have been made to the local library since a Kodi backup was created and restored, resulting in many more duplicates. This is especially relevant for larger libraries.
Please consider implementing an optional setting for TMDBH to persistently detect and handle stream-local-library duplicates.
If there was some way that the actual local library media content could be hidden from the user in the main Kodi menu, but still be available for TMDBH to use with the automatically play local files player option, this could mean that an entire Trakt list could be added without there ever being duplicates.
Alternatively perhaps the auto-update library from Trakt list(s) that occurs daily could somehow check for any changes to the local library, and either add streams or remove them accordingly. I think it would be better integrated to the regular auto-update, or a button (or both), than the update library now option as that can take a very long time.
I never delete anything. I think automated deletion is a bad and potentially disastrous idea.
If you add local files you'll need to delete the corresponding strm files.
Alternatively, use nodes to split your library according to sources (ie one node section for strm and one for physical files). Then you make it so all menu items, widgets etc only use the strm node. That way you never see the local db library unless you specifically open it but you'll be able to play local via corresponding tmdbhelper strm.
https://kodi.wiki/view/Add-on:Library_Node_Editor
That's what you want. Basically make a separate node structure with rules to include only one source.
Alternatively, use nodes to split your library according to sources (ie one node section for strm and one for physical files). Then you make it so all menu items, widgets etc only use the strm node. That way you never see the local db library unless you specifically open it but you'll be able to play local via corresponding tmdbhelper strm.
https://kodi.wiki/view/Add-on:Library_Node_Editor
That's what you want. Basically make a separate node structure with rules to include only one source.
Thank you, that solution is perfect for the setup I want.
Closing ticket.
I may have closed this ticket too hastily!
I read through the wiki link and looked through some examples on the Kodi forum, and I have tried applying it to parent nodes to limit content to just streams. For testing I started by just editing the existing TV shows parent node and then creating a new parent node TV Shows Test (which I check through Main menu >> Videos >> TV Shows Test >> Titles, as there does not seem to be a way in Estuary to change where the default TV shows links to).
I tried the following rules individually and together, in the top left of each parent node as this should distribute down to Titles and everything else, but either I would still see duplicates or there would be no shows displayed at all:
path >> starts with/contains/is >> special://home/userdata/addon_data/plugin.video.themoviedb.helper/tvshows/ file >> ends with >> .strm
In case necessary after each change I tried updating library, cleaning library and restarting Kodi.
Can you please tell me how I should adjust this?
If relevant I have the library sources split, TV Shows TMDBH and TV Shows NAS.
Also, if I instead edit the existing default TV shows parent node to display only streams, would this effectively prevent TMDBH from seeing locally stored video content, breaking the automatically play local files player option? I thought that perhaps it might be neater to edit the existing and keep using it, maybe creating a new separate parent node for TV Shows NAS just for when I need to access it for maintenance etc.
After thinking about it some more, even when splitting by node you might run into issues because I only take the first hit when looking for a match in the library -- so if there's two versions (strm and local) then it could really be a coin toss on whether we end up with the right one (if it finds strm first it'll correctly not play but it also won't try to look further, whereas if local is found first then it'll play). I've got a better solution for this in the upcoming code refactor/rewrite but there's still quite a bit to do before that's ready.
An interim solution might be to use a local file player and just not add the files to the library at all. This would require relatively strict naming of your files
{
"name" : "Local File System",
"plugin" : "xbmc.core",
"priority" : 500,
"play_movie" : [
"C:\\Videos\\Movies\\",
{"label": "(?i){title}"},
{"label": "(?i){title}.*(mpg|avi|mp4|mkv)"}
],
"play_episode" : [
"C:\\Videos\\TV\\",
{"label": "(?i){showname}"},
{"label": "(?i)S.*{season}"},
{"label": "(?i).*S.*{season}E.*{episode}.*(mpg|avi|mp4|mkv)"}
]
}
That will look in C:\Videos\Movies\
for a folder named as the movie title and then inside that for a file with the movie title and ending in any of mpg, avi, mp4, mkv
So for instance, say I want to play the movie "The Terminator" the path to the movie needs to be
C:\Videos\Movies\The Terminator\The Terminator.mkv
The naming needs to be pretty strict to work - but with some creative regex there can be some fuzziness. For instance I've already put in a bit in the above - e.g. the (?i)
means ignore case so we could have tHe tERMiNatOr.AVI
and it'd be fine and the .*
is an any character wild card so we can also have The Terminator Bluray HDR.mp4
Not really a great solution but it's an option.
The library integration wasn't really designed with the ability to play local files in mind. My original assumption was that if someone was adding a strm to the library then they didn't have a local version - particularly since the plugin skips adding strm files if there's a match in the library already.
Cleaning up some stale issues. If this is still a significant issue let me know but I think there's enough suitable workarounds to deal with what is ultimately a corner case. The idea I had originally to deal with this ended up being a bit convoluted so I abandoned it.