everettsouthwick / Eraserr

Python script for deleting unwatched or stale media from Plex servers using Radarr, Sonarr, and Overseerr.
GNU General Public License v3.0
24 stars 1 forks source link

Sonarr Dynamic Load crashes - unable to find GUID in library #44

Closed Foximu closed 1 year ago

Foximu commented 1 year ago

Describe the bug Appreciate all the work you have put into this script - the main deletion function is working great. Sonarr Dynamic Load crashes - unable to find GUID in library

To Reproduce Steps to reproduce the behavior: Begin watching a show on Plex that has the next episode missing. Following shows in the logs (running in Docker):

2023-09-15 12:43:53 2023-09-15 02:43:53,770 - WARNING - Guid 'plex://show/5d9c07f72df347001e3a70b4' is not found in the library, retrying in 5 seconds... 2023-09-15 12:43:58 2023-09-15 02:43:58,820 - WARNING - Guid 'plex://show/5d9c07f72df347001e3a70b4' is not found in the library, retrying in 5 seconds... 2023-09-15 12:44:03 Traceback (most recent call last): 2023-09-15 12:44:03 File "/app/eraserr.py", line 30, in 2023-09-15 12:44:03 main(args) 2023-09-15 12:44:03 File "/app/src/main.py", line 24, in main 2023-09-15 12:44:03 job_runner.run() 2023-09-15 12:44:03 File "/app/src/jobs.py", line 44, in run 2023-09-15 12:44:03 self.dynamic_load_job() 2023-09-15 12:44:03 File "/app/src/jobs.py", line 75, in dynamic_load_job 2023-09-15 12:44:03 self.dynamic_load_series() 2023-09-15 12:44:03 File "/app/src/jobs.py", line 121, in dynamic_load_series 2023-09-15 12:44:03 dynamic_media = self.plex.get_dynamic_load_media(self.dynamic_load.watched_deletion_threshold) 2023-09-15 12:44:03 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2023-09-15 12:44:03 File "/usr/local/lib/python3.11/site-packages/decorator.py", line 232, in fun 2023-09-15 12:44:03 return caller(func, *(extras + args), *kw) 2023-09-15 12:44:03 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2023-09-15 12:44:03 File "/usr/local/lib/python3.11/site-packages/retry/api.py", line 73, in retry_decorator 2023-09-15 12:44:03 return __retry_internal(partial(f, args, **kwargs), exceptions, tries, delay, max_delay, backoff, jitter, 2023-09-15 12:44:03 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2023-09-15 12:44:03 File "/usr/local/lib/python3.11/site-packages/retry/api.py", line 33, in retry_internal 2023-09-15 12:44:03 return f() 2023-09-15 12:44:03 ^^^ 2023-09-15 12:44:03 File "/app/src/clients/plex.py", line 131, in get_dynamic_load_media 2023-09-15 12:44:03 series = self.get_series_by_guid(session.grandparentGuid) 2023-09-15 12:44:03 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2023-09-15 12:44:03 File "/app/src/clients/plex.py", line 38, in __get_series_by_guid 2023-09-15 12:44:03 series = section.getGuid(series_guid) 2023-09-15 12:44:03 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 2023-09-15 12:44:03 File "/usr/local/lib/python3.11/site-packages/plexapi/library.py", line 654, in getGuid 2023-09-15 12:44:03 raise NotFound(f"Guid '{guid}' is not found in the library") from None 2023-09-15 12:44:03 plexapi.exceptions.NotFound: Guid 'plex://show/5d9c07f72df347001e3a70b4' is not found in the library

Additional context Add any other context about the problem here. I've checked the XML in Plex and that matches the GUID shown in the logs:

guid="plex://episode/5d9c0b7d4eefaa001f5fa40c" parentGuid="plex://season/602e59c9fdd281002cddb6c9" grandparentGuid="plex://show/5d9c07f72df347001e3a70b4"

everettsouthwick commented 1 year ago

Thank you for the bug report, I will look into this!

everettsouthwick commented 1 year ago

Should be fixed in #45

Foximu commented 1 year ago

Nice! Working perfectly