Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync trakt lists even if Kodi library integration is disabled #97

Conversation

antonsoroko
Copy link

@antonsoroko antonsoroko commented Dec 27, 2023

right now if we disable settings like "Sync items from ... into Kodi library" then we do not update data about collection/watchlist/userlists anymore, thus even in internal elementum menus we see old data for those lists.

fixes elgatito/plugin.video.elementum#680

@@ -1161,11 +1177,6 @@ func SyncShowsList(listID string, updating bool, isUpdateNeeded bool) (err error
removedShows = DiffTraktShows(current, previous, IsTraktInitialized)
}

if err != nil {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably leftovers from previous code.

@@ -1049,11 +1063,6 @@ func SyncMoviesList(listID string, updating bool, isUpdateNeeded bool) (err erro
removedMovies = DiffTraktMovies(current, previous, IsTraktInitialized)
}

if err != nil {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably leftovers from previous code.

@antonsoroko
Copy link
Author

user confirmed that everything works now as expected elgatito/plugin.video.elementum#680 (comment)

@@ -648,7 +648,7 @@ func updateShowWatched(xbmcHost *xbmc.XBMCHost, s *trakt.WatchedShow, watched bo

// RefreshTraktCollected ...
func RefreshTraktCollected(xbmcHost *xbmc.XBMCHost, itemType int, isRefreshNeeded bool) error {
if config.Get().TraktToken == "" || !config.Get().TraktSyncCollections {
if config.Get().TraktToken == "" {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the idea of removing the use of a setting that was added for this case?
That was the only place for those properties TraktSyncCollections, TraktSyncWatchlist, TraktSyncUserlists?
Idea was to disable sync for specific parts instead of disabling whole sync.

Copy link
Author

@antonsoroko antonsoroko Dec 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those settings are not removed, but moved inside functions that actually does trakt update. So we can do update of trakt and then if needed - also do kodi library update. But maybe it makes sense to split those functions completely.


// FIXME: should it be like for shows - 'if !updating && !isUpdateNeeded && IsDuplicateShow(tmdbID) {' ?
if uid.IsDuplicateMovie(tmdbID) {
if !updating && !isUpdateNeeded && uid.IsDuplicateMovie(tmdbID) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if uid.IsDuplicateMovie(tmdbID)
This should probably always be in a separate block to have a check for duplicates for any method arguments.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elgatito заметил, что в новом коде IsDuplicateMovie не отделено в отдельный блок и для фильмов и для сериалов. забыл или решил что отдельный блок не нужен?

@elgatito
Copy link
Owner

I guess the idea was to still get and cache different lists even if lists sync is disabled to properly show list of Shows in My Collection or lists.

But you will still need a dependency to have Trakt Sync enabled (global sync) to update lists. And there is another request to split add/remove in list sync, because currently remove from Kodi library works only if add is enabled.

I will use part of code from this PR and split actions.

@elgatito
Copy link
Owner

I have pushed a change using partly this code.
Thanks

@elgatito elgatito closed this Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Missing items in Trakt Movies Collection
2 participants