josh/imdb-trakt-sync

Watchlist is syncing, but ratings aren't

alaq opened this issue · 6 comments

alaq commented

Hello, thank you for this script. This is fantastic. I don't have to compare watch status in trakt and imdb in a spreadsheet anymore (I hope).

Quick question: I am able to sync my watch list properly, but my ratings don't seem to go from imdb (where I have 1600 ratings) to trakt (where I have 13 ratings).

I double checked my environment variables, my IMDB_RATINGS_ID is correct.

Here are the logs that I get from the container:

# Tue Feb 23 06:01:59 2021
+ /app/main.sh
+ ./trakt-update-watchlist.sh movies
+ ./diff-movie-watchlist.sh
trakt-watchlist: 6 movies
imdb-watchlist: 32 movies
diff-watchlist: add 32 movies
diff-watchlist: remove 6 movies
{
  "added": 32,
  "existing": 0,
  "not_found": []
}
{
  "deleted": 6,
  "not_found": []
}
+ ./trakt-update-watchlist.sh shows
+ ./diff-show-watchlist.sh
trakt-watchlist: 2 shows
[]
{
  "added": 0,
  "existing": 0,
  "not_found": []
}
{
  "deleted": 0,
  "not_found": []
}
exit status 1

It looks as if whatever script is running after trakt-watchlist is failing.
Any idea what I should do to investigate this?

josh commented

Hey @alaq, yeah this script should definitely sync over ratings. Also agree that the debug info here isn't super helpful. That non-zero exit status means something crashed along the way or one of the Trakt requests returned an error. It looks like it failed on the TV show watchlist sync and never made it to the next step.

Are you running the scripts from Docker or just locally? Or locally we can maybe make some quick edits to the scripts to get more into.

Edit

Can you try running $ IMDB_WATCHLIST_ID=XXX TRAKT_CLIENT_ID=XXX TRAKT_ACCESS_TOKEN=XXX ./diff-show-watchlist.sh

alaq commented

I'm running this in docker, but I am able to bring up bash in the container:

bash-5.0# [VARIABLES REDACTED] ./diff-show-watchlist.sh
trakt-watchlist: 2 shows
[]

I also ran imdb-ratings.sh and got my 1600 ratings back fine.

josh commented

Can you try $ ./imdb-show-watchlist.sh and $ ./trakt-show-watchlist.sh. Thinking maybe the IMDb one could be the one erroring.

I also ran imdb-ratings.sh and got my 1600 ratings back fine.

Nice, so that should work fine once we resolve the other crash.

alaq commented

I'm afraid it won't be very helpful :(

bash-5.0# ./imdb-show-watchlist.sh ls000406611
[]

And I removed shows from my watchlist on trakt, so now I have:

./trakt-show-watchlist.sh [redacted]
[]
josh commented

Oh, that's helpful. I think it's just crashing because there aren't any shows on the your watchlist (which should be totally legit).

jq --arg type "$TITLE_TYPE" 'map(select(.["Title Type"] == $type) | {id: .Const}) | if length == 0 then halt_error(1) else . end' |

I can't remember why I wrote that if length == 0 then halt_error(1) heh. Maybe it should be safe to remove. Let me test again in the morning.

Just curious if you try adding a TV show to your IMDb watchlist and see what happens. But we should get this fixed.

alaq commented

That was it! Thank you so much. I can live with one show in my imdb watchlist for now, or even forever :)