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

Using CLI with debug enabled uses wrong list type. Expected trending, seen anticipated. #100

Closed MollyBe closed 4 years ago

MollyBe commented 4 years ago

Enabling debug in the traktarr config causes unexpected results when importing movies with CLI. With debug enabled it will use the list type anticipated even though you specified trending.

Steps to reproduce the behavior: Run with debug set as false: traktarr movies -t trending -l 100 -s votes and as expected it'll import movies from the trending list with output: Retrieved Trakt 'Trending' movies list, movies found: 1285

Run with debug set as true: traktarr movies -t trending -l 100 -s votes and it'll unexpectedly import movies from the anticipated list type with output:

Request URL: https://api.trakt.tv/shows/anticipated
Retrieved Trakt 'Trending' movies list, movies found: 1017

Note: it says shows and not movies, and anticipated and not trending I think it is still using the trending list but I cannot explain why the amount of movies found decreases when debug is enabled and more movies are imported.

Reproducible using Master (latest).

Near the time of writing this trakt.tv had: 1002 in trending 1436 in anticipated

desimaniac commented 4 years ago

It uses an arbitrary list to validate client ID info.

https://github.com/l3uddz/traktarr/blob/3c89b265aafcfa62a2235894d9b49eaecb31c171/media/trakt.py#L236

MollyBe commented 4 years ago

Still the amount of results changes based on whether debug is on or off?

desimaniac commented 4 years ago

You did that on master 18 days ago. Master has since been updated. Try it again.

Sent with GitHawk

MollyBe commented 4 years ago

Hi, I have tried it again with the same results as last time.

Command used: traktarr movies -t trending -l 1 -s votes

With debug set to: false The results were: 1409 movies found, 6 to process, 0 added

With debug set to: true The results were: 1312 movies found, 32 to process, at least 1 added

Something unexpected is happening here.

I have made a log file of this here.

Reproducible using Master (latest).

desimaniac commented 4 years ago

Delete your cache.db file

desimaniac commented 4 years ago

Tested both debug and info, everything is working as expected.