Plugin.video.themoviedb.helper: [Feature / Discussion] Add Trakt list to library

Created on 11 Apr 2020  Ā·  96Comments  Ā·  Source: jurialmunkey/plugin.video.themoviedb.helper

@drinfernoo (and any others that want to test) - When you get a chance, can you test out this new feature which allows you to add a complete Trakt list to the library in one go and let me know if there's any issues?

You should now be able to use "Add to Kodi Library" context menu item on any list in Trakt > Trending / Popular / Liked / Your Lists and every item in the list will be added to the library.

This approach will be useful for users that want to add a large number of items to the library in one go whilst also avoiding the circular logic of other addons that misuse Trakt's collection feature for this purpose.

Now users can create a custom list of "subscriptions" on Trakt which they can then add to Kodi in one go from the "Your Lists" section. Currently you would still need to re-add the list manually if you add new shows to it (only new shows, because shows already added auto update) - but in the future I'll also look at adding a list monitoring feature that will update from a list on startup.

Let me know if you find any issues. It seems to be working well on my end (and is surprisingly fast but I've only tested on my laptop which has an SSD, so might be slower on devices with HDDs).

Most helpful comment

Do you also intend on adding this functionality for the Collection and/or Watchlist?

All 96 comments

Honeyview_screenshot722

Honeyview_screenshot723

This seems to work pretty well, and I really appreciate the dialog that it shows!

It seems to only do this when I add one of my "Liked Lists", but it hangs on a busy dialog until all the items in the list have been added. The other sections don't seem to do this.

Do you also intend on adding this functionality for the Collection and/or Watchlist?

I tested too, on a list from ā€Liked Listsā€ and everything was ok, except from dialog with ā€unable to create pathsā€, but after i disable in settings ā€ignore folder creation cheksā€, i got no warnings and all the movies was added to Library succesfully. This option is very cool.
I wonder if you can implement an option to add a movie from Library to one of my Trakt lists. Will be usefull. I think Exodus have something like that. (if you wanna take a look). Just a suggestion for future updates.

I haven’t had a chance to test this but this is more a general question if it has this or not. Does it include the ability to check other lists for movies/shows you already have an exclude those?

For example:

  1. You subscribe to list A which includes the movie 1917.
  2. You subscribe to list B, which also includes the movie 1917.

Would the addon be able to recognize that List A already has the movie added to your library and skip over it, or will it as it as a duplicate?

@Demonseeed It did do that for me. I added both a liked list of Studio Ghibli films, and also my personal lists of anime films, and it didn't duplicate them.

It will not duplicate, but, if you add that movie from another addon, then you will have 2 entries in library.

@angelitto2005 Ah, good point. Another thing I didn't test was if it would duplicate items which are in the library from a local file.

@drinfernoo @angelitto2005 thats great news! That feature is something I personally require for library support, thanks again Jurial!!

@drinfernoo

This seems to work pretty well, and I really appreciate the dialog that it shows!

Yeah it is pretty essential, especially since the adding runs in the background. When I was testing I realised it was needed after I accidentally added a list with 1000s of items and had to force quit Kodi.

It seems to only do this when I add one of my "Liked Lists", but it hangs on a busy dialog until all the items in the list have been added. The other sections don't seem to do this.

I've now switched to using the extended progress dialog so the busy dialog won't steal focus and it will now run truly in the background just like a library update.

Do you also intend on adding this functionality for the Collection and/or Watchlist?

Watchlist YES. Collection NO.

People need to stop misusing the collection feature this way. The whole point is to keep "track" of what media you've physically collected and own. Apps should sync to the collection, NOT from it - otherwise you end up in a loop (local item gets added to collection which then gets added to local items).

Users should create a separate list of "Subscriptions" for items that they have access to from streaming sources. The Trakt addon should then be told not to sync TMDbHelper's library folders. That way you keep your collection of items that you own separate from items that you have access to on streaming services -- You can't say you've "collected" items on streaming services. That would be like saying you've collected all the books in your local library...

@angelitto2005

I tested too, on a list from ā€Liked Listsā€ and everything was ok, except from dialog with ā€unable to create pathsā€, but after i disable in settings ā€ignore folder creation cheksā€, i got no warnings and all the movies was added to Library succesfully. This option is very cool.

Excellent - thanks for testing. Yeah it's weird that on some systems Kodi misreports that the folder hasn't been created. It's annoying that the folder creation error checking needs to be disabled - but at least so far it seems all the folders get created properly.

I wonder if you can implement an option to add a movie from Library to one of my Trakt lists.

Yeah, I was thinking that would be a useful option. I find often when just browsing TMDbHelper I want to add an item to one of my lists that isn't my watchlist. I also want to add an option to remove an item from a list.

@Demonseeed - Yeah currently TMDbHelper doesn't check the library for existing files -- it just rewrites everything that you add but because the naming is standardised it can't create duplicates. I will add an option soon to double check library and skip items that are in there.

@jurialmunkey that would be brilliant! I have seen many addons try this in the past, but yours is the only the only one that would have that. Thanks so much!

@Demonseeed @drinfernoo @angelitto2005 - Can you all test latest version. The plugin should now skip items that are already in your library.

Great feature, thanks for adding!

Any chance you can enable "TV Shows --> Your In-progress" to be added to library? Would allow users to add all shows they are currently watching on Trakt to the library (without manually creating a new list).

Great feature, thanks for adding!

Any chance you can enable "TV Shows --> Your In-progress" to be added to library? Would allow users to add all shows they are currently watching on Trakt to the library (without manually creating a new list).

This doesn't really make sense to me - particularly since in-progress only displays shows that still have unwatched episodes (you could have watched all currently aired episodes but there's still upcoming episodes - those shows wouldn't get added because they aren't in progress).

There's an option in settings to auto update tvshows for new episodes on startup. All you have to do is enable that and add one episode of a show, then tmdbhelper will update the episodes automatically.

Works flawlessly. I tested a ā€Trakt Test Listā€ with 6 movies. 3 from local library, 2 added by another addon, and the last one (The Matrix) I didn't have it in the library.
When i added the list, it skipped all the movies, except The Matrix.
Good job!

Works flawlessly. I tested a ā€Trakt Test Listā€ with 6 movies. 3 from local library, 2 added by another addon, and the last one (The Matrix) I didn't have it in the library.
When i added the list, it skipped all the movies, except The Matrix.
Good job!

Excellent! Yeah I'm a little surprised at how well the library check is working -- I'm really expecting something to break it but so far so good!

Great feature, thanks for adding!
Any chance you can enable "TV Shows --> Your In-progress" to be added to library? Would allow users to add all shows they are currently watching on Trakt to the library (without manually creating a new list).

This doesn't really make sense to me - particularly since in-progress only displays shows that still have unwatched episodes (you could have watched all currently aired episodes but there's still upcoming episodes - those shows wouldn't get added because they aren't in progress).

There's an option in settings to auto update tvshows for new episodes on startup. All you have to do is enable that and add one episode of a show, then tmdbhelper will update the episodes automatically.

It's definitely not a perfect solution and i'm shooting from the hip, but my thought process was it could provide a way for tmdbhelper to sync with trakt's inherent show tracking and avoid having to manually add shows to a separate list.

Trakt automatically begins "monitoring" shows after you watch a single episode so that it can maintain your Calender and Next up. Tmdbhelper in-progress is a single list of all the shows trakt is "tracking/monitoring" that have unwatched episodes.

If you add the in-progress list to the library, the initial sync would be all your shows with unwatched episodes (80% of shows in my case). If you are able to add list monitoring to tmdbh, for shows that trakt is tracking that don't have unwatched episodes, as soon as a new episode airs the show would appear in "in-progress" and tmdbhelper would automatically add/sync it to the library.

It would also mean that as trakt begins tracking a new show (after you watched first episode) tmdbhelper would auto add to library without requiring you to manually add each new show to your "subscription list".

A question about this new feature. Is it possible for the addon to add the elements to playlists named after the Trakt list they are imported from? I was thinking that could be a way to speed up widgets as you could create them from local library instead of from the addon.
Is there any limit to how many items are pulled from the list being synced? Within widgets there is the limit to the amount of items Trakt sends back but as far as I know from the local library this limitation could be avoided.
And another question. Are elements removed from a list also being removed from the library?

A question about this new feature. Is it possible for the addon to add the elements to playlists named after the Trakt list they are imported from? I was thinking that could be a way to speed up widgets as you could create them from local library instead of from the addon.

Not currently but that is a really interesting idea. It would be relatively easy to do - just create a smart playlist with a rule matching each filename and match set to any; then just save and drop in the playlists folder. I'm not sure if smart playlists cope well with a large number of rules like that (list of 100 items would be a playlist with 100 matching rules).

Is there any limit to how many items are pulled from the list being synced? Within widgets there is the limit to the amount of items Trakt sends back but as far as I know from the local library this limitation could be avoided.

No limit. The entire trakt list is pulled in one call and then every item is added. If there's 1000 items in the list then 1000 items will be added to the library (that's why there's a warning about how many items are in the list).

The reason lists are paginated into smaller pages of 20 items when accessing through TMDbHelper is because each item in the list needs another call to lookup the details (e.g. artwork, plot etc.) and looking up the details of all the items takes time (imagine if accessing the library required the an entire library update from scratch every time). Adding to the library isn't time critical, so we can let the scraper do the detailed lookup in the background and take its time.

And another question. Are elements removed from a list also being removed from the library?

No. Once the item is added to the library it exists as a physical strm file (a text file with a shortcut link to the plugin path). You need to delete the actual file off your hard-drive to remove it from your library.

No. Once the item is added to the library it exists as a physical strm file (a text file with a shortcut link to the plugin path). You need to delete the actual file off your hard-drive to remove it from your library.

Would it be too complex to implement? I guess there is going to be a conflict between an element being removed from one list (the one that actually add it to the library in the first place) while another one still has it (the one that didn't add it to the library to avoid duplication). But without this feature, trending lists and the like would lose their purpose as they would create an ever growing playlist.

It's definitely not a perfect solution and i'm shooting from the hip, but my thought process was it could provide a way for tmdbhelper to sync with trakt's inherent show tracking and avoid having to manually add shows to a separate list.

Trakt automatically begins "monitoring" shows after you watch a single episode so that it can maintain your Calender and Next up. Tmdbhelper in-progress is a single list of all the shows trakt is "tracking/monitoring" that have unwatched episodes.

@skyfsza - but then you end up with the same circular logic as you do with adding a collection. You're syncing what you've watched locally to Trakt and then what you've watched gets synced back to your local library.

The only way that works is if you literally have zero actual physical files. As soon as you add physical files you end up with a mess of a library.

Image this scenario: I download the first few episodes of a show to see if I like it. After I watch the first episode, suddenly I have six seasons of strm episodes added to my library. If I like the show and download more episodes, then I need to go delete all the TMDbHelper strm files and cleanup my library so that I can add the local files. If I didn't like the show, I also need to clean all the shows out of my library. Either way, my library ends up a mess.

Imagine this scenario: I use my PVR to setup a timer to record a show that airs weekly. I watch an episode. My watched history gets synced to Trakt. TMDBHelper then adds that show to my library. TMDbHelper adds the next episode to my library before I've finished recording it. Now I've got two copies in my library (a TMDbHelper strm and my PVR recording).

Imagine this scenario: A friend stays over and watches an episode of Judge Judy. Suddenly I have a million episodes of Judge Judy added to my library...

I can think of so many reasons why it would be a really bad idea.

Would it be too complex to implement? I guess there is going to be a conflict between an element being removed from one list (the one that actually add it to the library in the first place) while another one still has it (the one that didn't add it to the library to avoid duplication). But without this feature, trending lists and the like would lose their purpose as they would create an ever growing playlist.

@juanma-cvega - I would be very hesitant to give an external list the power to delete items in the library. Anyway, it wouldn't create a growing playlist because the playlist would be recreated every time the list updates on startup - so the playlist would reflect the items in the list. Plus you don't need to remove any thing from the library that way - you just add/remove items from the playlist.

@jurialmunkey

Not currently but that is a really interesting idea. It would be relatively easy to do - just create a smart playlist with a rule matching each filename and match set to any; then just save and drop in the playlists folder. I'm not sure if smart playlists cope well with a large number of rules like that (list of 100 items would be a playlist with 100 matching rules).

I implemented this is in a different add-on, and simply wrote a library tag (containing the Trakt slug of the source list) to the NFO for the item as it was generated. Then I also generated the matching smart playlist that contained items with that tag.

I could submit that code here of you'd like, as it seems like it would "plug and play" šŸ˜‰

@jurialmunkey

Not currently but that is a really interesting idea. It would be relatively easy to do - just create a smart playlist with a rule matching each filename and match set to any; then just save and drop in the playlists folder. I'm not sure if smart playlists cope well with a large number of rules like that (list of 100 items would be a playlist with 100 matching rules).

I implemented this is in a different add-on, and simply wrote a library tag (containing the Trakt slug of the source list) to the NFO for the item as it was generated. Then I also generated the matching smart playlist that contained items with that tag.

I could submit that code here of you'd like, as it seems like it would "plug and play" šŸ˜‰

@drinfernoo - Ah yeah that's a way better idea - I was thinking about something to do with tags would be a way to do it but couldn't think how you would add them (I completely blanked on being able to add them to the nfo file). Yeah you would just need to join the user slug and trakt list slug as the tag, then generate the tag based on it.

I guess the downside is the scenario @juanma-cvega mentioned - when you update from a trending list, you would also need to update all the tags in the library. Whereas if you match to filenames, then you can just add and remove the separate filenames from the playlist without touching the existing library entries.

Anyway, it wouldn't create a growing playlist because the playlist would be recreated every time the list updates on startup

Ok, I didn't know that. Do you have any plans to add a cron job so there is no need to restart Kodi? I'm thinking of systems that stop it for a long time. For instance, I use it on a shield and it doesn't close Kodi when I switch it off. And a way to refresh it manually from the skin would be nice as well in case you add an item from your phone to a list and then you want to see it on Kodi.

You could, if the item already exists in the library, open it's NFO file and add the new tag.

Do you also intend on adding this functionality for the Collection and/or Watchlist?

+1 for Watchlist, that would be helpful.

Collections, meh, im doing my best to get my colleciton back to stuff i actually have collected :D :D

Oh.. library location works fine to SMB now.

@juanma-cvega @drinfernoo - I've now added the smart playlist creation function. When you add a list, TMDbHelper will auto generate a smart playlist in your playlists folder containing the items. If the list has a mix of tvshows and movies, then a smart playlist will be created for each type (one for movies and one for tv).

I'm just matching by Title, but it seems to work fine.

I must be doing something wrong. I created some lists on Trakt, then opened tmdb helper in Kodi, browsed to the list and selected add to Kodi library. It scanned through the list so everything looked Ok but when selecting TV Shows from Kodi home screen nothing appears to have been added.

There doesn't appear to be any additional sources added within media locations (other than my nas) within Kodi media library.

@chrisd-2k You need to add the sources and set them up with a library scraper as well.

I can't browse to the location where tmdb keeps them though

Thanks for the help though I should add this is an android installation (don't know if that's different)

You need to "Show hidden files and directories".

Didn't even see that. Thanks for the help all working

@juanma-cvega @drinfernoo - I've now added the smart playlist creation function. When you add a list, TMDbHelper will auto generate a smart playlist in your playlists folder containing the items. If the list has a mix of tvshows and movies, then a smart playlist will be created for each type (one for movies and one for tv).

I'm just matching by Title, but it seems to work fine.

Am looking for this option. Which version did you implement it?

@djnield - v2.4.9

@djnield - v2.4.9

I'm at 2.4.13
I should be able to see the generated playlist in the playlist folder?

I'm not seeing a thing there. My hope was to point a homescreen widget to it. But nothing is showing šŸ¤”

I am getting the generated playlists, but the way that they are matching by title messes up things with the same title.

For example, I have two liked Trakt lists, "Disney Animated Classics", and "Disney Live-Action Movies", each with a different version of "Aladdin" šŸ˜…

Having done some playing last night. Some thoughts on watchlist versus collection library maintenance.

I have realised why people use collection as their library stores.

A show is on my watchlist. As soon as I watch 1 episode of that show trakt remove it from my watchlist. So using a watchlist for library integration doesn't work because as soon as you watch even 1 episode thats it zapped, its no longer in watchlist, so your library will no longer update.

Trakts logic is that once you have watched one episode then you start using the "progress" feature to keep up to date with episodes and watch them.

but from a kodi library maintenance pov that is useless.

So despite it being contrary to the "collection is things you physically own", I can see why collection is preferred over watchlist for Kodi library purposes.

Trakt removing things from watchlist as soon a single episode is watched makes it useless for an ongoing thing.

And without a way to reliably add things to personal lists inside Kodi, it becomes very inconvenient to have to maintain a separate, long-running list of shows we're watching... especially when Trakt provides this as one of it's key selling points, in the form of its "progress" sections.

@dm2912 - I don't think watchlist is effective either - it's just a quick way to add new shows. A personal list of shows that you are "subscribing" to is the method I'm suggesting.

I think it is really a bad idea to automatically add everything that you watch to the library.

For instance, imagine if a friend stays over and watches one episode of a soap like Days of our Lives. Suddenly you would have 13000+ episodes added to your library. That's a lot of TMDb/TVDb bandwidth wasted for something that you maybe don't even watch and it will be a pain to now clean your library. Thinking that this sort of excessive look-up is okay is completely disrespectful to the online services that provide all this data for free.

If you want on-the-fly access to what you've recently watched, just use a TMDbHelper widget for that purpose - that's why they exist. Plus, once you've setup your main list of subscriptions, all it takes to add a new show to the library is a single context menu click. Once you add one episode, TMDbHelper handles the rest.

And without a way to reliably add things to personal lists _inside_ Kodi, it becomes very inconvenient to have to maintain a separate, long-running list of shows we're watching... especially when Trakt _provides_ this as one of it's key selling points, in the form of its "progress" sections.

@drinfernoo - That's why there's an in-progress TMDbHelper widget - for on-the-fly access to your in-progress shows. -- Accessing the widget is going to be way faster than waiting for TMDbHelper to update your library.

Plus, once you have your main set of shows setup, it's only one context menu click to add a new item to your library - you only have to add one episode and then TMDbHelper handles the rest.

I already mentioned in this thread that I'm planning for a context menu item to add/remove from a personal trakt list. I've almost got this one ready to go - so it will be in before the list monitoring feature is even added.

I am getting the generated playlists, but the way that they are matching by title messes up things with the same title.

For example, I have two liked Trakt lists, "Disney Animated Classics", and "Disney Live-Action Movies", each with a different version of "Aladdin" šŸ˜…

For some reason I didn't even think about remakes. I guess a year field will help that.
EDIT: Nope that doesn't work because needs to be match ANY... maybe I can check against something else.
EDIT2: Ah - matching by filename works for movies. Tvshows will need to stay match by title though (especially since path can possibly be split between two locations).

@jurialmunkey My original solution worked very well for me: write a tag into the NFO file, that matches the Trakt slug, and then use that tag as the rule in a playlist.

@jurialmunkey My original solution worked very well for me: write a tag into the NFO file, that matches the Trakt slug, and then use that tag as the rule in a playlist.

@drinfernoo - The problem is that items already in the library are skipped, so you can't write a tag for them. It would be a bad idea to write an nfo file to a part of the user's library that isn't the source specified for TMDbHelper.

e.g. I keep my local file sources in a separate location from the TMDbHelper ones. I've got a handful of obscure items that don't scan properly and need nfo files. I would be so annoyed if the TMDbHelper overwrote my custom nfo files and I needed to remake them.

@jurialmunkey Well, you wouldn't. Only tag the ones that come from the sync, and leave the rest, in my opinion. Matching by filename likely wouldn't work in the situation you describe either, unless you're naming your actual video files the same as your STRMs.

@jurialmunkey Well, you wouldn't. Only tag the ones that come from the sync, and leave the rest, in my opinion. Matching by filename likely wouldn't work in the situation you describe either, unless you're naming your actual video files the same as your STRMs.

It does work though - I've already tested it. I have to get the Kodi DB anyway to check if the item is in the library, so I just ask it to return "file" instead of "dbid".
https://github.com/jurialmunkey/plugin.video.themoviedb.helper/blob/master/resources/lib/context.py#L198

Then I add it to the list of item rules:
https://github.com/jurialmunkey/plugin.video.themoviedb.helper/blob/master/resources/lib/context.py#L200

Then I build the smart playlist:
https://github.com/jurialmunkey/plugin.video.themoviedb.helper/blob/master/resources/lib/context.py#L223-L236

Here's a section of a playlist created by adding a list of Arnold Schwarzenegger movies. I already had Terminator 2 in my library as a local mp4 file and I already had Last Action Hero as a strm. All items were added to the playlist correctly:

<rule field="filename" operator="is"><value>Kindergarten Cop (1990).strm</value></rule>
<rule field="filename" operator="is"><value>Terminator 2.mp4</value></rule>
<rule field="filename" operator="is"><value>Last Action Hero (1993).strm</value></rule>

@drinfernoo - The "Add to Trakt List" context menu item is now live. Should work for all TMDbHelper items, and hopefully most other items.

It doesn't currently work for library episodes - only the base tvshow - but that's just because I need to figure out what the best way is to retrieve base tvshow IDs from an episode -- currently only adding a full tvshow to the list rather than individual episodes because I figure people probably want it to act the same way as watchlist.

I can confirm, it works. I added from my Kodi Library and from TMDB. Both, Movies and Shows. Single episod doesnt work, but i dont get the point for adding a single episod in a List...
From other addons, doesnt work either, but this doesnt matter too much.
You did a great job implementing this option. I wonder if you can go further and add an option to remove an item from Trakt lists. Will be nice, too.
And another ideea for future updates. Maybe a submenu with ā€Trakt Add/Removeā€is better for ā€Add/Remove from Trakt Watchlist, History, Collectionā€ options.

You did a great job implementing this option. I wonder if you can go further and add an option to remove an item from Trakt lists. Will be nice, too.

I've got a remove option coming soon. Just wanted to make sure that these new features are working properly before I add more options.

And another ideea for future updates. Maybe a submenu with ā€Trakt Add/Removeā€is better for ā€Add/Remove from Trakt Watchlist, History, Collectionā€ options.

Yeah, I think maybe a submenu is warranted now since there's quite a few options.

Now also added a List monitor option in settings that allows you to choose a Trakt list to watch for updates. Can now also set a time interval to do updates.

Nice. Maybe Trakt List Monitor need to have one more option: NONE? To unselect any list. We can do this by resetting to default that page, but still...

And another thing. If i delete some movies from a Trakt list via web, in TMDb, that list isnt refreshed and the movies are still there. But in other addons, they are gone. This has something to do with ā€Update every x minutes? I setted mine to 30. So, only after 30 min the list will be refreshed in TMDb or its a bug?

@angelitto2005 I was going to mention that it might be good to be able to set more lists than one.

And another thing. If i delete some movies from a Trakt list via web, in TMDb, that list isnt refreshed and the movies are still there. But in other addons, they are gone. This has something to do with ā€Update every x minutes? I setted mine to 30. So, only after 30 min the list will be refreshed in TMDb or its a bug?

No nothing to do with that option. That's just how frequently the library will auto update. I really don't recommend updating your library every 30 minutes... That's really going to thrash your HDD. I probably shouldn't allow it to go that low.

All Trakt Lists are cached for 3 hours to provide quicker loading.

Now also added a List monitor option in settings that allows you to choose a Trakt list to watch for updates. Can now also set a time interval to do updates.

works great. might it be possible to increase the number of monitored lists to two maybe for those of us maintaining separate movie and tv lists

(Obviously i know we could have mixed lists and it can work out whats what on scanning, but some already have separate movie and tv lists setup)

No nothing to do with that option. That's just how frequently the library will auto update. I really don't recommend updating your library every 30 minutes... That's really going to thrash your HDD. I probably shouldn't allow it to go that low.

If a manual update option was available then the default could be set much higher.

I would happily turn off automatic updates if there was a "update now" button I could hit

Nice. Maybe Trakt List Monitor need to have one more option: NONE? To unselect any list. We can do this by resetting to default that page, but still...

@angelitto2005 - Now added option to select none.

And another thing. If i delete some movies from a Trakt list via web, in TMDb, that list isnt refreshed and the movies are still there.

@angelitto2005 - Plugin should now refresh the list when re-entering it. It still caches the list but only for pagination purpose - so if you leave the list completely and then re-enter it will update it.

I was going to mention that it might be good to be able to set more lists than one.

@drinfernoo - Just making sure that the one list works properly before I add more - if there were bugs in the adding process, it could be a bit of a disaster if there were then multiple lists all updating...

works great. might it be possible to increase the number of monitored lists to two maybe for those of us maintaining separate movie and tv lists

@dm2912 - See response to drinfernoo just above. Will add more soon, just want to test it out a bit first so that if there are bugs it isn't multiplying any problems that pop-up.

If a manual update option was available then the default could be set much higher.

@dm2912 - RunScript(plugin.video.themoviedb.helper,library_autoupdate)

All the service monitor does is run that command at the interval specified - there isn't any hidden code, the command is completely exposed to users. Just add that command to a shortcut on your powermenu / mainmenu / submenu via skinshortcuts, or map it to a remote button and you're good to go.

Also, I've now put all context menu options in a "TMDbHelper Options" submenu. There is now also a "Remove from List" option for custom user lists.

Everything seems to work just fine. I love these improvements. Especially creating a list and adding and removing fom it. Much easier now to handle Trakt stuff. And context menu looks better now.
I still have a question tho...
When i add a movie to a list, and that list is set in ā€Auto-update library from Trakt Listā€ and ā€Auto-update Library every X hoursā€ is set to ā€ž2ā€, My Kodi library will update and add that movie to the smart playlist in 2 hours, right? No need for aditional actions from me.

@angelitto2005 - Yes, that's correct - or in even less than 2 hours depending on when the last scan was.

Basically what happens is that every X hours, TMDbHelper will run the library_autoupdate command which does the following:

  1. Requests the auto-update Trakt list(s) and adds every item that isn't already in the library.
  2. Recreates the smart playlist with every item from the Trakt list (include ones already in library).
  3. Checks TVShows in your TMDbHelper library folder and adds any new/missing episodes that you don't already have.
  4. Runs the "Scan for new items" action on the folder.

If it doesn't do the above, please let me know as it means that something is not working correctly.

I asked because on my side, nothing happens. Its almoust 4 hours and the movies i added to my ā€2 trakt test listsā€ are not in my library. I restarted kodi several times and the same thing. The two smart playlists are not updated, nor the library. Maybe auto-update Trakt list command is not working correctly.
And i see this in kodi log:

2020-04-17 17:30:05.155 T:7712   ERROR: Exception in thread Cron Thread:
                                            Traceback (most recent call last):
                                              File "C:\Program Files\Kodi\system\python\Lib\threading.py", line 801, in __bootstrap_inner
                                                self.run()
                                              File "C:\Users\Angelitto\AppData\Roaming\Kodi\addons\plugin.video.themoviedb.helper\resources\lib\service.py", line 29, in run
                                                if self.addon.getSettingBool('library_autoupdate'):
                                            AttributeError: 'CronJob' object has no attribute 'addon'

@angelitto2005 - Yep that's a bug. Please test v2.4.22 - should be fixed now.
If you get ERROR: Exception in the log related to TMDbHelper then that is a pretty good indication something isn't working correctly. In this case, I forgot to define where the addon settings come from for that module.

I finally had time to test the new feature and it's really awesome!! I have some questions about it and suggestions that I'm not sure are actually feasible.

  • I saw it's not possible to add Trakt options like Popular or Trending this week to library. I think I understood it was also possible to add those when reading through the comments but I may be wrong.
  • It's been asked many times but I think now that this feature is implemented it makes more sense than before. It'd be great if the option to choose a different player from library was implemented but I know from your comments that this would imply some changes.
  • A feature I expected Kodi to implement at some point was the option to get the In progress movies/tv shows by tag. Currently you have either movies or tv shows but there is no way to filter by tags like action, animation, kids... . Is there anything that can be done about that using playlists?

@jurialmunkey, smart playlists seems to work now, but there is another problem. TMDb never stops scanning. I see scanning and updating library nonstop. Its a loop or something.

@angelitto2005 - Hahaha Whoops! I forgot I changed the setting from minutes to hours and I forgot to change the multiplier to match - it was scanning every 2 minutes!!! 😬
Should be fixed now.

@juanma-cvega

I saw it's not possible to add Trakt options like Popular or Trending this week to library. I think I understood it was also possible to add those when reading through the comments but I may be wrong.

No you can only add user lists (either your own or by other users). The popular/trending lists are just sort methods for the Trakt database. The popular movies list returns 18,570 pages of results. If you added that list you would add 185,700 movies to your library. Let's just say that it's not recommended to add that many items to your library...

It's been asked many times but I think now that this feature is implemented it makes more sense than before. It'd be great if the option to choose a different player from library was implemented but I know from your comments that this would imply some changes.

Do you mean the "Play Using" context menu item? Yeah that's a little difficult.

A feature I expected Kodi to implement at some point was the option to get the In progress movies/tv shows by tag. Currently you have either movies or tv shows but there is no way to filter by tags like action, animation, kids... . Is there anything that can be done about that using playlists?

You've always been able to do this with smart playlists in the library... You just create a smart playlist with the rules inprogress is true and genre is action.
https://kodi.wiki/view/Smart_playlists

Unless I'm misunderstanding what you're saying...

I think everything is fine now.
But i noticed, that only one list is refreshed at a time. If i restart Kodi, List 1 is refreshed and movies are added to Library, and if i restart Kodi again, List 2 is refreshed. This is normal or its a bug.?

@angelitto2005 - I think maybe when the second list updates it might cancel the first update if it hasn't finished. The latest version should hopefully fix that issue.

No you can only add user lists (either your own or by other users). The popular/trending lists are just sort methods for the Trakt database. The popular movies list returns 18,570 pages of results. If you added that list you would add 185,700 movies to your library. Let's just say that it's not recommended to add that many items to your library...

Ok, make sense. I guess it's a matter of finding the right list. There must be some that would work as a good as those ones. What about lists like "Recommended for you" or "Based on recently watched"? Those would be nice to have. Anyway, just being picky here I guess. Those could always be added as normal widgets.

You've always been able to do this with smart playlists in the library... You just create a smart playlist with the rules inprogress is true and genre is action.

Ok, I didn't know that. I've never played with smart playlists before. I just checked and it seems it'd be what I'm looking for. Do you think it'd make sense to add an option to the addon to create an extra playlist for In progress content for each playlist added? In my case, I have an anime list and planning to create a kids one for my kid with an entry in the left bar for each. That way for each entry in the bar there would be a widget with what's currently being watched.
Thinking about it, would it be possible to add a tag to each element added to the library for each playlist it's part of with the name of the playlist? That way, for the In progress playlist, it would only be necessary to filter by this tag and any entry that belongs to several playlists would appear in all of them at the same time.

@angelitto2005 - I think maybe when the second list updates it might cancel the first update if it hasn't finished. The latest version should hopefully fix that issue.

Yes, its working now(v.2.4.25) šŸ‘

@juanma-cvega - The "based on" lists aren't actually Trakt lists. They're TMDb Recommendations based on a random movie from your Trakt recently watched - so it needs code to work. I find the Trakt recommend list to be almost useless - TMDb recommendations system is much better.

There was a discussion about adding tags a bit earlier in the thread - the main problem is that only the new movies/shows that you add to the library would be tagged since existing movies/shows are skipped.

Anyway - there's a simpler solution around the smart playlist tagging issue. There's a smart playlist rule field for playlist which allows you to specify a playlist that the items must be in. Basically you can create a smart playlist for your smart playlist.

Ok, I get what you mean. So because entries added to different playlists are going to be on all of them anyway, it just suffices to add a rule for the playlist and the elements that are in progress. It shouldn't be too long to add given there are only that many entries I'm going to set in the left bar anyway šŸ˜„

I think I've now implemented everything that I wanted to with this feature so closing this thread.

@jurialmunkey, can we now sync multiple lists?

@jurialmunkey, can we now sync multiple lists?

there is provision in library settings now for two.

Dont know if you can add more on top of that.

Yeah, you can now sync two lists. I'm trying to see if I can find a way to allow as many/few as the user wants but if I don't find a clean way then I'll just increase the limit to five lists.

It's easy enough to increase the list limit -- its just that I don't want to pull the rug out from under users if I end up changing the setting type and the old settings are no longer compatible.

I just realised the option to auto update only lets you do it for lists you own but not liked lists. Was there a reason for not including them I missed?

Something I just realised when adding a list with too many items. Could you add a "Max items to sync" or something like that? I guess a global limit for all lists would suffice, instead of a limit per list. With that I mean, for a limit of 100 entries, each list would sync 100 items max. That way, there would be a limit to the number of items that get pulled up from a list to avoid it syncing too many items. And that would fix problems like the one you mentioned with "Trending" or "Popular" lists that pull too many items.

Something I just realised when adding a list with too many items. Could you add a "Max items to sync" or something like that? I guess a global limit for all lists would suffice, instead of a limit per list. With that I mean, for a limit of 100 entries, each list would sync 100 items max. That way, there would be a limit to the number of items that get pulled up from a list to avoid it syncing too many items. And that would fix problems like the one you mentioned with "Trending" or "Popular" lists that pull too many items.

This is why I made it so that you can only sync a list you've created and you have to manually add lists made by others - otherwise it can get quickly out of hand.

To me, a limit doesn't really make sense. Is it the number of shows or the number of episodes? 100 episodes would get hit pretty quickly. And is it a limit on new items that weren't previously added or all items? And what order are they added in? What if I add a list that is "250 sci-fi movies you must watch" and it is sorted alphabetically - I only get A to M? Or do I override it and get top rated or order added? Then those sort methods wouldn't make sense for other lists.

The primary purpose of syncing is for a specific list you maintain of items you have access to on streaming services. Generally it is going to be quicker to just access a list directly through the plugin rather than creating a directory structure and scanning the library.

Adding to the library only really makes sense for items that you will return to on some type of regular basis -- particularly as once an item is added you need to then manually delete it.

You are right, I didn't think about those cases. I was just focus on the use case where this feature is used to speed up widgets and to increase the limit of 20 items you get when adding a widget directly from a list in the addon.

This is why I made it so that you can only sync a list you've created and you have to manually add lists made by others - otherwise it can get quickly out of hand.

Well, I thought of liked lists as maybe lists made by a friend or family member or something like an ongoing series of movies that you want to keep in your library (like the Marvel ones for example) and you know of a list that does it for you so you don't have to maintain it yourself (call me lazy šŸ˜„). For those ones I think it wouldn't be bad to have the option to keep the list synced but it wouldn't be too difficult to add them to your own list I guess.
For those lists already added that are not in auto update, is there any way to refresh them? As far as I understand, those are not refresh even after a Kodi restart. Would re-adding them to the library refresh the items not already in there? Maybe there could be an option in TheMovieDb Helper to show the lists that have being added to the library?

@juanma-cvega - I'm not completely opposed to allowing liked lists - I'm just a little concerned as there are lots of lists on Trakt made using listrr.pro which have 10,000+ items in them. If someone syncs a list like that it is going to be a disaster. The more that I think about it, the more I think I might have to put some cap on the size of a list that can be added/synced after all.

For manually added lists - yeah you just re-add them to the library and it will refresh the smartplaylist. The add to library function will skip recreating items already scanned to the library so they don't need to be scraped again but the skipped items will still be added to the smart playlists.

Quickest way to keep track of lists you've added would probably be to like the list -- I'll look at adding a context menu item. Also might add an option to auto-like the list if you add to library.

I think there is a bug with Trakt lists. When i enter in one of my lists, the latest movies i watched are not marked as watched. Can you check please?

@angelitto2005 Refresh the cache on the item.

@angelitto2005 Refresh the cache on the item.

No don't refresh the cache. Watched info is not cached. All refreshing cache does is update the item details from TMDb. The only time you should refresh an item's cache is if the details for a movie/show have changed on TMDb - e.g. you added/corrected a field on the website and you want to see the changes locally without waiting for the cache to expire.

@angelitto2005 - Can you open a separate issue about this bug please? Also by "lists" do you mean smart playlists in the library? TMDbHelper has nothing to do with marking things watched in the library. Even inside TMDbHelper, the only thing it does is retrieve the watched status from Trakt and add it to the item - it doesn't mark anything as watched - that's up to the addon playing the item.

My apologies šŸ˜…

I have my library folder locations as SMB folders and I am having an issue where with every library scan it is re-scanning the entire trakt list and re-writing every single strm and nfo (so its taking an age).

Is anyone else with SMB shares having this issue (trying to work out if its a me issue or if its a smb issue)

(only appears to be doing it with tv shows, not movies)

I have my library folder locations as SMB folders and I am having an issue where with every library scan it is re-scanning the entire trakt list and re-writing every single strm and nfo (so its taking an age).

Is anyone else with SMB shares having this issue (trying to work out if its a me issue or if its a smb issue)

(only appears to be doing it with tv shows, not movies)

Just tested by moving library folder back to local rather than SMB. Every time on startup its scanning and rewriting every single nfo and stream file for the entire list.

So basically a full 30-45 minute scan every time.

(This is on fire tv)

How do you know that it is rewriting the nfo and strm?

@angelitto2005 - Can you open a separate issue about this bug please? Also by "lists" do you mean smart playlists in the library? TMDbHelper has nothing to do with marking things watched in the library. Even inside TMDbHelper, the only thing it does is retrieve the watched status from Trakt and add it to the item - it doesn't mark anything as watched - that's up to the addon playing the item.

No need for opening a new issue. It seems ok now. This has nothing to do with Playlists. I was talking about Trakt history watched movies. In 17.04 i marked as viewed in Trakt (from PC), 4 movies. And last night, when i was browsing my Trakt Lists with TMDbHelper, i saw that those 4 movies were not synced with my Trakt History and even when i used search function, were not marked as watched. But now i checked again (with the addon) and all 4 are marked as watched. But its weird that only after 3 days TMDbHelper synced with Trakt History and saw them as watched. Is this normal?

L.E. Or maybe was some glitch from Trakt, because i tested now with another movies, and i marked them as watched in Trakt, and instantly they apeared as watched in TMDb.
So you can ignore my last comments. Everything is OK.

I noticed a few times over the past few days that Trakt was having issues, so it might've just been that.

How do you know that it is rewriting the nfo and strm?

looked at the smb share and the file modified date's were all changing, so i presumed it was overwriting.

Ive cleaned my library and settings and redoing from scratch to see if its my end

@dm2912 - The nfo file is rewritten every time for tvshows, but the strm files should be skipped if the episode exists. So the modified date of the folder will change but not the strm files.

If you turn on debug logging, you will get a message if the episode is skipped:

NOTICE: [plugin.video.themoviedb.helper]
    Trakt List Add to Library
    Found American Horror Story - S01E02 - Home Invasion in library. Skipping...

I just tested - all my existing episodes in the library were skipped and none of my strm files were modified.

Currently you would still need to re-add the list manually if you add new shows to it (only new shows, because shows already added auto update) - but in the future I'll also look at adding a list monitoring feature that will update from a list on startup.

Is it auto update feature implemented yet?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alKODIque picture alKODIque  Ā·  5Comments

Wayoff1 picture Wayoff1  Ā·  6Comments

SerpentDrago picture SerpentDrago  Ā·  4Comments

iscriptu picture iscriptu  Ā·  4Comments

Blurayx picture Blurayx  Ā·  7Comments