luigi311 / JellyPlex-Watched

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

Error getting watched TV Shows in Jellyfin #28

Closed Deanosim closed 1 year ago

Deanosim commented 2 years ago

This is the log in debug true with debug level set to debug not sure what exactly is going on. I'm running in a docker container

today at 06:23:10Server 1: plex <src.plex.Plex object at 0x1480727e21a0>
today at 06:23:10Server 2: jellyfin <src.jellyfin.Jellyfin object at 0x148071ef5000>
today at 06:23:10Plex: Generating watched for deanosim in library Movies
today at 06:23:10Plex: Generating watched for deanosim in library Anime
today at 06:23:10Plex: Generating watched for deanosim in library TV Shows
today at 06:24:21Jellyfin: Generating watched for deanosim in library TV Shows
today at 06:24:21Jellyfin: Generating watched for deanosim in library Movies
today at 06:24:21Jellyfin: Generating watched for deanosim in library Anime
today at 06:27:53[ERROR]: Jellyfin: Failed to get watched for deanosim in library TV Shows, Error: 'Path'
today at 06:27:53[ERROR]: Jellyfin: Failed to get watched, Error: 'Exception' object has no attribute 'items'
today at 06:27:53[ERROR]: 'Exception' object has no attribute 'items'
today at 06:27:53[ERROR]: Traceback (most recent call last):
today at 06:27:53  File "/app/src/jellyfin.py", line 357, in get_watched
today at 06:27:53    user_watched_temp = combine_watched_dicts(user_watched)
today at 06:27:53  File "/app/src/functions.py", line 161, in combine_watched_dicts
today at 06:27:53    for key, value in single_dict.items():
today at 06:27:53AttributeError: 'Exception' object has no attribute 'items'
today at 06:27:53
today at 06:27:53During handling of the above exception, another exception occurred:
today at 06:27:53
today at 06:27:53Traceback (most recent call last):
today at 06:27:53  File "/app/src/main.py", line 639, in main
today at 06:27:53    main_loop()
today at 06:27:53  File "/app/src/main.py", line 590, in main_loop
today at 06:27:53    server_2_watched = asyncio.run(
today at 06:27:53  File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run
today at 06:27:53    return loop.run_until_complete(main)
today at 06:27:53  File "/usr/local/lib/python3.10/asyncio/base_events.py", line 646, in run_until_complete
today at 06:27:53    return future.result()
today at 06:27:53  File "/app/src/jellyfin.py", line 366, in get_watched
today at 06:27:53    raise Exception(e)
today at 06:27:53Exception: 'Exception' object has no attribute 'items'
today at 06:27:53
today at 06:27:53Retrying in 3600.0

I could wonder if the debug level isn't working for some reason.

Deanosim commented 2 years ago

Current theory is it gives that error for libraries that have move than one path on the Jellyfin side, because I removed and re-added the TV Shows library with only 1 folder and now that's working, but the Anime library is now having the same problem and it has 2 folders.

bman87 commented 1 year ago

I am also getting an error unexpectedly.

Jellyfin: Generating watched for mainuser in library Shows
[ERROR]: Jellyfin: Query failed 'str' object does not support item assignment
[INFO]: Jellyfin: Skipping library Collections is not whitelist_library
[ERROR]: Jellyfin: Failed to get users watched, Error: 'Exception' object is not subscriptable
[ERROR]: Jellyfin: Failed to get watched, Error: 'Exception' object is not subscriptable
[ERROR]: 'Exception' object is not subscriptable
[ERROR]: Traceback (most recent call last):
  File "C:\JellyPlex-Watched\src\jellyfin.py", line 292, in get_users_watched
    if len(watched["Items"]) == 0:
TypeError: 'Exception' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\JellyPlex-Watched\src\jellyfin.py", line 345, in get_watched
    await self.get_users_watched(
  File "C:\JellyPlex-Watched\src\jellyfin.py", line 328, in get_users_watched
    raise Exception(e)
Exception: 'Exception' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\JellyPlex-Watched\src\main.py", line 639, in main
    main_loop()
  File "C:\JellyPlex-Watched\src\main.py", line 590, in main_loop
    server_2_watched = asyncio.run(
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\asyncio\runners.py", line 43, in run
    return loop.run_until_complete(main)
  File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\asyncio\base_events.py", line 612, in run_until_complete
    return future.result()
  File "C:\JellyPlex-Watched\src\jellyfin.py", line 366, in get_watched
    raise Exception(e)
Exception: 'Exception' object is not subscriptable

All my libraries span over multiple folders and did not have this issue for a while. Now its suddenly doing it. I won't be splitting my libraries folders out, so hopefully we can figure out what is going on.

luigi311 commented 1 year ago

This is already implemented see #36 for more information