Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync history containing episode with absolute numbering #224

Open
iamkroot opened this issue Nov 1, 2020 · 5 comments
Open

Sync history containing episode with absolute numbering #224

iamkroot opened this issue Nov 1, 2020 · 5 comments

Comments

@iamkroot
Copy link

iamkroot commented Nov 1, 2020

I'm trying to add support for absolute numbered episodes in my scrobbler, and got it working for the /scrobble endpoint by using the docs. Now I'm trying to figure out how to add such an episode to watched history, using the /sync/history endpoint.

My normal flow involves finding the trakt id for the show using the /search endpoint, and then constructing the json request body like so:

request_json = {
    'shows': [{
        'ids': {'trakt': trakt_id}, 
        'seasons': [{
            'number': season,
            'episodes': [{'number': episode, 'watched_at': watched_at}]
        }]
    }]
}

But for absolute numbered episodes, we don't have a season number. I tried directly putting the episodes inside the show object, but the server ignored it and instead synced the whole show:

request_json = {
    'shows': [{
        'ids': {'trakt': trakt_id}, 
        'episodes': [{'number_abs': episode, 'watched_at': watched_at}]
    }]
}

In my opinion, this should be supported by the server. Am I doing something wrong?

@iamkroot
Copy link
Author

iamkroot commented Nov 9, 2020

@rectifyer Anything to add?

iamkroot added a commit to iamkroot/trakt-scrobbler that referenced this issue Aug 7, 2022
TODO: Handle this case in `add_to_history` interface. Blocked by
trakt/api-help#224
iamkroot added a commit to iamkroot/trakt-scrobbler that referenced this issue Aug 7, 2022
TODO: Handle this case in `add_to_history` interface. Blocked by
trakt/api-help#224
@iamkroot
Copy link
Author

iamkroot commented Jan 6, 2023

@rectifyer Has this been fixed? Does /sync/history support number_abs now? Or put another way, given a show slug and an absolute episode number, how do we add it to history?

The only option I could come up with was:

  1. Query /shows/$SHOW_SLUG/seasons?extended=episodes to get a list of all the episodes
  2. For every episode in the previous list, query /shows/$SHOW_SLUG/seasons/$SEASON/episodes/$EPISODE?extended=full
  3. Check the number_abs field to find matching episode

As you can see, this seems extremely wasteful, especially for shows with lots of episodes. Is there a better way?

@rectifyer
Copy link
Contributor

rectifyer commented Jan 6, 2023

We don't have enough data to make the number_abs field useful. We got that info from TVDB in the past, but since we've moved to TMDB several years ago they don't include the absolute number field.

@iamkroot
Copy link
Author

iamkroot commented Jan 8, 2023

That is a bit sad. But if TMDB doesn't provide the abs number, how are they shown for the existing shows? Imported from TVDB, and not updated anymore?

@rectifyer
Copy link
Contributor

Correct. It’s old data from TVDB.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants