Kometa-Team / ArrAPI

A lightweight Python library for Radarr and Sonarr API.
https://arrapi.kometa.wiki
MIT License
45 stars 7 forks source link

[Bug]: Series object not properly initialized if series is missing data #16

Closed ShanaryS closed 1 year ago

ShanaryS commented 1 year ago

Version Number

1.4.2

Describe the Bug

My script tried checking series.episodeCount, series.episodeFileCount, and series.totalFileCount on https://thetvdb.com/series/among-us which of the time of posting is sparse with information.

These variables are not created and thus throws an attribute error. I'm not sure if the issue exists elsewhere, but this should be handled.

I just checked all the attributes. These are all that are not initialized when they should be:

These should all just default to 0.

Update:

It seems if I just set one of them, then all update. So it seems there is some bug where the object doesn't fully initialize or refresh when first created. So I just assign series.__ = 0 for all series object just to ensure they all update properly. This seems to work but doesn't fully initalize. Calling series.reload() seems to fix it completely.

For reference, where I got this object was by calling the all_series() method.