l3uddz / traktarr

Script to add new series & movies to Sonarr/Radarr based on Trakt lists.
GNU General Public License v3.0
576 stars 52 forks source link

Sonarr with 0 shows makes traktarr error #121

Open erik-inkapool opened 4 years ago

erik-inkapool commented 4 years ago

Describe the bug Language profile lookup fails even though it shouldn't be done on my version.

To Reproduce Steps to reproduce the behavior:

  1. I run python traktarr.py shows -t watchlist
  2. It errors with:
    2020-02-14 19:48:11,979 - ERROR      - Traktarr    - get_objects             - Aborting due to failure to retrieve shows list from Sonarr

Expected behavior Traktarr shouldn't error here

Logs

2020-02-14 19:48:11,877 - DEBUG      - asyncio     - __init__                - Using proactor: IocpProactor
2020-02-14 19:48:11,882 - INFO       - Traktarr    - validate_trakt          - Validating Trakt API Key...
2020-02-14 19:48:11,952 - DEBUG      - media.trakt - _make_request           - Request URL: https://api.trakt.tv/shows/anticipated
2020-02-14 19:48:11,952 - DEBUG      - media.trakt - _make_request           - Request Payload: {}
2020-02-14 19:48:11,953 - DEBUG      - media.trakt - _make_request           - Request User: Crankysaurus
2020-02-14 19:48:11,953 - DEBUG      - media.trakt - _make_request           - Response Code: 200
2020-02-14 19:48:11,954 - INFO       - Traktarr    - validate_trakt          - ...Validated Trakt API Key.
2020-02-14 19:48:11,957 - DEBUG      - media.pvr   - validate_api_key        - Request Response: 200
2020-02-14 19:48:11,957 - INFO       - Traktarr    - validate_pvr            - Validated Sonarr URL & API Key.
2020-02-14 19:48:11,960 - DEBUG      - media.pvr   - get_quality_profile_id  - Request URL: http://localhost:8989/api/profile
2020-02-14 19:48:11,960 - DEBUG      - media.pvr   - get_quality_profile_id  - Request Response: 200
2020-02-14 19:48:11,961 - DEBUG      - media.pvr   - get_quality_profile_id  - Profile 'Any' with ID '1' did not match Quality Profile 'HD - 720p/1080p'
2020-02-14 19:48:11,961 - DEBUG      - media.pvr   - get_quality_profile_id  - Found Quality Profile ID for 'HD - 720p/1080p': 6
2020-02-14 19:48:11,961 - INFO       - Traktarr    - get_quality_profile_id  - Retrieved Quality Profile ID for 'HD - 720p/1080p': 6
2020-02-14 19:48:11,965 - DEBUG      - media.pvr   - get_language_profile_id - Skipping Language Profile lookup because Sonarr version is '2.0.0.5338'.
2020-02-14 19:48:11,965 - ERROR      - Traktarr    - get_language_profile_id - No Language Profile ID for: English
2020-02-14 19:48:11,978 - DEBUG      - media.pvr   - _get_objects            - Request URL: http://localhost:8989/api/series
2020-02-14 19:48:11,979 - DEBUG      - media.pvr   - _get_objects            - Request Response: 200
2020-02-14 19:48:11,979 - DEBUG      - media.pvr   - _get_objects            - Found 0 objects
2020-02-14 19:48:11,979 - ERROR      - Traktarr    - get_objects             - Aborting due to failure to retrieve shows list from Sonarr

These two lines look especially suspicious. I did not expect 200 OK with 0 shows to error:

2020-02-14 19:48:11,979 - DEBUG      - media.pvr   - _get_objects            - Request Response: 200
2020-02-14 19:48:11,979 - DEBUG      - media.pvr   - _get_objects            - Found 0 objects
2020-02-14 19:48:11,979 - ERROR      - Traktarr    - get_objects             - Aborting due to failure to retrieve shows list from Sonarr

System Information

erik-inkapool commented 4 years ago

Seems i missed this part: Aborting due to failure to retrieve shows list from Sonarr which is the actual problem. Closing as there's probably something else wrong

erik-inkapool commented 4 years ago

Adding a show resolved my problem, but a sonarr instance with 0 shows added should still not error, right? I want traktarr to add my shows. Edited OP and Reopened