luigi311 / JellyPlex-Watched

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

[BUG] Not marking media as watched #107

Closed chrisdma closed 9 months ago

chrisdma commented 11 months ago

Describe the bug Script is not marking movies and tv shows as watched

To Reproduce Steps to reproduce the behavior:

  1. Install requirements
  2. Create env file as needed
  3. run script main.py

Expected behavior Expected to have media from plex server 1 synced to plex server 2

Logs https://gist.githubusercontent.com/chrisdma/de0a7b669dd11d3f6eac62221c27f2fb/raw/482617800156dadbf8e83a9103a26bba95bedb24/plexjellywatched.log

Type:

nebb00 commented 11 months ago

same as my log


2023-09-28T06:10:16.551360035Z [INFO]: Generating episode_output_dict failed, skipping
2023-09-28T06:10:16.551813277Z [INFO]: Generating show_output_dict failed, skipping
2023-09-28T06:10:16.551858915Z [INFO]: Generating episode_output_dict failed, skipping
2023-09-28T06:10:16.557062552Z [INFO]: Generating movies_output_dict failed, skipping
2023-09-28T06:10:16.557246839Z [INFO]: Generating movies_output_dict failed, skipping
2023-09-28T06:10:16.557459995Z [INFO]: Removing Movies from nebb because it is empty
2023-09-28T06:10:16.557533738Z [INFO]: Removing Movies-4K from nebb because it is empty
2023-09-28T06:10:16.557607430Z [INFO]: Removing TV from nebb because it is empty
2023-09-28T06:10:16.557678924Z [INFO]: Removing TV-4K from nebb because it is empty
2023-09-28T06:10:16.557750123Z [INFO]: Removing nebb from watched list 1 because it is empty
luigi311 commented 11 months ago

Looks like plex had a api change and the python plex library was updated to resolve it. Can you guys try the dev branch

nebb00 commented 11 months ago

Looks like plex had a api change and the python plex library was updated to resolve it. Can you guys try the dev branch

image: luigi311/jellyplex-watched:dev?

luigi311 commented 11 months ago

That is correct

chrisdma commented 11 months ago

That is correct

I tried it and it seems like it marked what needed to be marked as watched, but it didn't mark shows/movies that should have been in progress, nor are the watched shows/movies in the Continue Watching list on the server I am migrating to. Is this as intended?

luigi311 commented 11 months ago

Syncing into plex supports complete mark and partial mark so in progress should get set. Syncing into jellyfin only supports complete mark, it doesnt do partial in progress marks.

chrisdma commented 11 months ago

Syncing into plex supports complete mark and partial mark so in progress should get set. Syncing into jellyfin only supports complete mark, it doesnt do partial in progress marks.

I am doing Plex to Plex as I am migrating to a new server, and I see the episodes being marked as watched on the new server only if I manually open the series, there is no Continue Watching section for the user I tested with.

luigi311 commented 11 months ago

Ohh so it is sync it’s just not putting the series on the on deck section. Yeah I need to look into that.

nebb00 commented 11 months ago

@luigi311 pulled the dev branch. I have exactly the same errors :( when I try with debug enabled, I can see stuff added to the watch list.

Anything I could do to try and fix?

Image: sha256:704a0e0844efe8e5e98a00b3035ad6b77d9102d472831b178ceb859c4cadc5d3

services:
  jellyplex-watched:
    restart: unless-stopped
    container_name: jellyplex-watched
    image: luigi311/jellyplex-watched:dev
    hostname: jellyplex-watched
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Etc/UTC
      - DRYRUN=True
      - DEBUG=True
      - DEBUG_LEVEL=info
      - RUN_ONLY_ONCE=true
      - SLEEP_DURATION=3600
      - LOGFILE=/tmp/log.log
      - USER_MAPPING=
      - LIBRARY_MAPPING=
      - BLACKLIST_LIBRARY=
      - WHITELIST_LIBRARY=
      - BLACKLIST_LIBRARY_TYPE=
      - WHITELIST_LIBRARY_TYPE=
      - BLACKLIST_USERS=
      - WHITELIST_USERS=nebb
      - PLEX_BASEURL=https://ipv4:port,https://ipv4:port
      - PLEX_TOKEN=Token #1,Token #1
      - JELLYFIN_BASEURL
      - JELLYFIN_TOKEN=
      - SSL_BYPASS=True
      - SYNC_FROM_PLEX_TO_JELLYFIN=False
      - SYNC_FROM_JELLYFIN_TO_PLEX=False
      - SYNC_FROM_PLEX_TO_PLEX=True
      - SYNC_FROM_JELLYFIN_TO_JELLYFIN=False
    volumes:
      - /etc/localtime:/etc/localtime:ro
2023-09-29T05:28:18.846991556Z [INFO]: Plex: Got watched for nebb in library TV-4K
2023-09-29T05:28:19.141485389Z [INFO]: Plex: Got watched for nebb in library Movies
2023-09-29T05:28:42.400686501Z [INFO]: Plex: Got watched for nebb in library TV
2023-09-29T05:28:42.419377870Z [INFO]: Finished creating watched list server 1
2023-09-29T05:28:43.055614666Z Plex: Generating watched for nebb in library Movies
2023-09-29T05:28:43.055745283Z Plex: Generating watched for nebb in library Movies-4K
2023-09-29T05:28:43.056633767Z Plex: Generating watched for nebb in library TV
2023-09-29T05:28:43.057143871Z Plex: Generating watched for nebb in library TV-4K
2023-09-29T05:28:43.751088699Z [INFO]: Plex: Got watched for nebb in library Movies
2023-09-29T05:28:44.109590731Z [INFO]: Plex: Got watched for nebb in library Movies-4K
2023-09-29T05:28:44.144549022Z [INFO]: Plex: Got watched for nebb in library TV-4K
2023-09-29T05:28:44.144776145Z [INFO]: Plex: Got watched for nebb in library TV
2023-09-29T05:28:44.145410541Z [INFO]: Finished creating watched list server 2
2023-09-29T05:28:44.156308330Z [INFO]: Cleaning Server 1 Watched
2023-09-29T05:28:44.176789833Z [INFO]: Cleaning Server 2 Watched
2023-09-29T05:28:44.176941843Z [INFO]: Generating show_output_dict failed, skipping
2023-09-29T05:28:44.177013165Z [INFO]: Generating episode_output_dict failed, skipping
2023-09-29T05:28:44.177433944Z [INFO]: Generating show_output_dict failed, skipping
2023-09-29T05:28:44.177536831Z [INFO]: Generating episode_output_dict failed, skipping
2023-09-29T05:28:44.185595829Z [INFO]: Generating movies_output_dict failed, skipping
2023-09-29T05:28:44.185761715Z [INFO]: Generating movies_output_dict failed, skipping
2023-09-29T05:28:44.186018576Z [INFO]: Removing Movies from nebb because it is empty
2023-09-29T05:28:44.186037005Z [INFO]: Removing Movies-4K from nebb because it is empty
2023-09-29T05:28:44.186084314Z [INFO]: Removing TV from nebb because it is empty
2023-09-29T05:28:44.186134144Z [INFO]: Removing TV-4K from nebb because it is empty
2023-09-29T05:28:44.186275128Z [INFO]: Removing nebb from watched list 1 because it is empty
2023-09-29T05:28:44.198172630Z [INFO]: server 1 watched that needs to be synced to server 2:
nebb00 commented 11 months ago

also tried without the container, using python. Same outcome, same errors.

joshoram80 commented 11 months ago

I can see shows that should be marked as Watched in Plex in the logs

10/01/2023
4:22:40 PM
[INFO]: Plex: Updating watched for xxxx in library Movies
10/01/2023
4:22:40 PM
[INFO]: Plex: Updating watched for xxxx in library TV Shows
10/01/2023
4:22:40 PM
[INFO]: Generating show_output_dict failed, skipping
10/01/2023
4:22:40 PM
[INFO]: Generating movies_output_dict failed, skipping
10/01/2023
4:22:40 PM
[INFO]: Plex: mark list
10/01/2023
4:22:40 PM
Shows: {'locations': [('\\\\192.168.0.69\\data\\media\\tv\\AFK The Video Game - Fantasy Web series',), ('\\\\192.168.0.69\\data\\media\\tv\\Ancient Unexplained Files',), ('\\\\192.168.0.69\\data\\media\\tv\\Close Encounters',), ('\\\\192.168.0.69\\data\\media\\tv\\Wu-Tang An American Saga',), ('\\\\192.168.0.69\\data\\media\\tv\\Ahsoka (2023)',), ('\\\\192.168.0.69\\data\\media\\tv\\Ancient Aliens',)], 'tvdb': ['306117', '396864', '277260', '354080', '393187', '101501'], 'tmdb': ['126180', '118954', '57488', '90870', '114461', '32608'], 'imdb': ['tt4547060', 'tt14151612', 'tt3335176', 'tt9113406', 'tt13622776', 'tt1643266'], 'tvrage': [None, None, None, None, None, '25490']}

But they aren't actually being set to watched inside Plex

nebb00 commented 11 months ago

I can see shows that should be marked as Watched in Plex in the logs

10/01/2023
4:22:40 PM
[INFO]: Plex: Updating watched for xxxx in library Movies
10/01/2023
4:22:40 PM
[INFO]: Plex: Updating watched for xxxx in library TV Shows
10/01/2023
4:22:40 PM
[INFO]: Generating show_output_dict failed, skipping
10/01/2023
4:22:40 PM
[INFO]: Generating movies_output_dict failed, skipping
10/01/2023
4:22:40 PM
[INFO]: Plex: mark list
10/01/2023
4:22:40 PM
Shows: {'locations': [('\\\\192.168.0.69\\data\\media\\tv\\AFK The Video Game - Fantasy Web series',), ('\\\\192.168.0.69\\data\\media\\tv\\Ancient Unexplained Files',), ('\\\\192.168.0.69\\data\\media\\tv\\Close Encounters',), ('\\\\192.168.0.69\\data\\media\\tv\\Wu-Tang An American Saga',), ('\\\\192.168.0.69\\data\\media\\tv\\Ahsoka (2023)',), ('\\\\192.168.0.69\\data\\media\\tv\\Ancient Aliens',)], 'tvdb': ['306117', '396864', '277260', '354080', '393187', '101501'], 'tmdb': ['126180', '118954', '57488', '90870', '114461', '32608'], 'imdb': ['tt4547060', 'tt14151612', 'tt3335176', 'tt9113406', 'tt13622776', 'tt1643266'], 'tvrage': [None, None, None, None, None, '25490']}

But they aren't actually being set to watched inside Plex

Do you see the message "removing user because it's empty" after the errors too?

joshoram80 commented 11 months ago

No. The only thing I an see that remotely looks like an error is

[INFO]: Generating show_output_dict failed, skipping 10/01/2023 4:22:40 PM [INFO]: Generating movies_output_dict failed, skipping

Plex -> Jel;lyfin works so it's obviously reading my Plex libraries OK, and it seems to pick up the shows that get marked in Jellyfin, it just won't mark them in Plex

luigi311 commented 9 months ago

The OPs issue seemed to be that media was being marked but it just wasnt appearing on the on deck section so there was no indicator that the media was actually being marked without manually going to it via plex directly to verify. Im going to close this ticket as their issue was sorta resolved. I did just test it and it seems like when i mark stuff in Jellyfin and JellyPlex-Watched marks it over in Plex it does show up in my continue watching section so its weird that it wasnt appearing for them. @nebb00 if you still have an issue that isnt in the issue list already feel free to open a new ticket with your information