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

Playlist are incomplete when sync specific library #298

Closed
simonc56 opened this issue Apr 26, 2021 · 6 comments · Fixed by #1238
Closed

Playlist are incomplete when sync specific library #298

simonc56 opened this issue Apr 26, 2021 · 6 comments · Fixed by #1238
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed

Comments

@simonc56
Copy link
Collaborator

simonc56 commented Apr 26, 2021

Description

When user sync lists but doesn't sync all libraries, the plex playlist can be incomplete because of partial script browsing of plex library. A log info could warn that list sync may be incomplete.
I may also be more than a feature request because it also updates lists and remove items from them. Looks like a real issue.

Use case

Step-by-step example:

  1. Set liked_lists to True and have a trakt liked list containing movies
  2. Run a sync with --sync tv argument

Expected: Plex having a new playlist containing movies from trakt liked list
What happens really: Plex playlist doesn't contain movies because script didn't run through movies library

If user sync only movies, playlists will be updated and tv episodes removed from them.
If user sync only tv, playlists will be updated and movies removed from them.


Line specific for movies or tv :

listutil.addPlexItemToLists(m.trakt_id, m.plex.item)

Line always run :
listutil.updatePlexLists(server)

The list syncing logic is to go through every plex item during the library sync. And when an item matches with a trakt list, it is added to the plex list. If the script doesn't browse all libraries, we cannot be sure the plex playlist will be complete.
#228 (comment)

Workarounds

@simonc56 simonc56 added the enhancement New feature or request label Apr 26, 2021
@simonc56
Copy link
Collaborator Author

simonc56 commented Apr 26, 2021

@BEisem

I have a couple of suggestions. Let me know if you want me to add them as separate Feature Request issues...

The first is, I know you changed the "Playlist not found" to debug log level, and that will get rid of the errors. But it would be nice to have some sort of output at the end, indicating how many (if any) items were added to each list, or what actually happened during the playlist sync.

The other thing, if it's possible, it would be great if it would sync playlists without having to do a full sync of all libraries. If there is a way to add in this logic, let's say I sync only Movies libraries (--sync=movies), could it still sync movies playlists? The reason I ask is, I will probably never do a full sync of all libraries, because of the size of my libraries and the time it takes. I typically sync TV shows throughout the day, and then do a single Movie sync at night. So it would be nice if it handled the Movie playlists during that movie sync, and if there were any TV playlists, it could handle those during the TV library sync. Does that make sense?

Very interesting suggestions.
The problem is that a list can contain both movies and tv episodes...
It is quite complicated right now, this part of the script should be rewritten.

@simonc56 simonc56 changed the title Feature request: inform user that playlist sync will be incomplete Playlist are incomplete when sync specific library Apr 27, 2021
@simonc56 simonc56 added the bug Something isn't working label Apr 27, 2021
@glensc
Copy link
Collaborator

glensc commented Apr 27, 2021

perhaps, for now, disable playlist logic if the user doesn't do full library sync and print a warning about that?

@simonc56
Copy link
Collaborator Author

simonc56 commented May 1, 2021

yes, i'm ok with this idea

@glensc glensc added the help wanted Extra attention is needed label Jun 20, 2021
@glensc
Copy link
Collaborator

glensc commented Nov 14, 2022

The problem is that a list can contain both movies and tv episodes...

Checked this code recently, sharing some info. Python Plex has check that all items in the list are either Audio, Video or Photo type. Movies and Episodes are Video type:

@glensc
Copy link
Collaborator

glensc commented Nov 29, 2022

Disabling when --library, --movie, --show, --id is specified:

@glensc
Copy link
Collaborator

glensc commented Nov 29, 2022

I don't see how the rest of the problem is solvable. if you sync movies library only, you could workaround by not clearing the existing list of shows, but then the ordering will be wrong.

glensc added a commit that referenced this issue Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants