luigi311 / JellyPlex-Watched

Sync watched between jellyfin and plex locally
GNU General Public License v3.0
398 stars 22 forks source link

Plex: fix guid lookup for X -> Plex sync #138

Closed remos closed 8 months ago

remos commented 8 months ago

This PR aims to resolve #108 by fixing 2 issues within the guid matching for plex:

  1. The guid lookup on plex was checking under the "ids" key on the user_watched dicts, rather than directly on the dict, where the guids seem to be located (alongside location and title). This PR switches it to check directly against the dict itself.
  2. find_video was attempting to iterate over season the key (e.g. 1, 2, etc) rather than the list of episodes. This PR switches to match the logic for location based lookups a few lines above

I've also added additional logging to hopefully help catch any similar issues in the future.

I haven't run this change very long yet, but the changes are minor and I have been able to sync both Jellyfin -> Plex, and Plex -> Jellyfin (where previously Jellyfin -> Plex would fail silently for me similar to what's noted in #108)

Thanks!