Schaka / janitorr

Cleans your Radarr, Sonarr, Jellyseerr and Jellyfin before you run out of space
GNU General Public License v3.0
263 stars 5 forks source link

Image related error in scheduled tasks #3

Closed deltabweb closed 7 months ago

deltabweb commented 7 months ago

Hi there,

I'm trying out Janitorr but getting a bunch of errors like this in the logs:

ERROR 1 --- [   scheduling-1] o.s.s.s.TaskUtils$LoggingErrorHandler    : Unexpected error occurred in scheduled task

feign.FeignException: Instantiation of [simple type, class com.github.schaka.janitorr.servarr.sonarr.series.Image] value failed for JSON property url due to missing (therefore NULL) value for creator parameter url which is a non-nullable type
 at [Source: (BufferedReader); line: 36, column: 7] (through reference chain: java.util.ArrayList[0]->com.github.schaka.janitorr.servarr.sonarr.series.SeriesPayload["images"]->java.util.ArrayList[3]->com.github.schaka.janitorr.servarr.sonarr.series.Image["url"]) reading GET <Redacted sonarr url>/api/v3/series
    at feign.FeignException.errorReading(FeignException.java:167) ~[feign-core-13.1.jar:na]
...

I reckon this is because I have images with coverType unkown and no url getting returned by Sonarr for some series. Here's an example:

...
    "airTime": "00:00",
    "images": [
      {
        "coverType": "banner",
        "url": "/MediaCover/16/banner.jpg?lastWrite=638095280840000000",
        "remoteUrl": "https://artworks.thetvdb.com/banners/graphical/280619-g6.jpg"
      },
      {
        "coverType": "poster",
        "url": "/MediaCover/16/poster.jpg?lastWrite=638095280840000000",
        "remoteUrl": "https://artworks.thetvdb.com/banners/v4/series/280619/posters/61acea8cc0aab.jpg"
      },
      {
        "coverType": "fanart",
        "url": "/MediaCover/16/fanart.jpg?lastWrite=637942254660000000",
        "remoteUrl": "https://artworks.thetvdb.com/banners/fanart/original/280619-12.jpg"
      },
      {
        "coverType": "unknown",
        "remoteUrl": "https://artworks.thetvdb.com/banners/v4/series/280619/clearlogo/611b7195e593a.png"
      }
    ],
    "originalLanguage": {
      "id": 1,
      "name": "English"
    },
...

Can you help?

Schaka commented 7 months ago

Are you using Sonarr v3 or v4? I've only tested against v4. The API docs are a bit hard to read regarding what should be available. I'll make the URL nullable and release a new image.

Edit: Change is available in v0.8.1b

deltabweb commented 7 months ago

I'm using v4. Thanks for the lightning fast fix!

Schaka commented 7 months ago

Let me know if this works for you, I'll close the issue then. I'm relying on you here because I can't reproduce it unfortunately.

deltabweb commented 7 months ago

Seems to be working now, we can close!