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

Absolute Episode Ordering #131

Closed
Jaynator495 opened this issue Apr 25, 2022 · 7 comments
Closed

Absolute Episode Ordering #131

Jaynator495 opened this issue Apr 25, 2022 · 7 comments

Comments

@Jaynator495
Copy link
Contributor

I brought this issue up on the discord originally, but figured it should probably be brought up here as well.

So I've noticed something... PlexAniSync doesn't handle absolute episode ordering correct across seasons. For example One Piece is split up into seasons, but the episodes for each season start at where the least season left off. But with mapping what it ends up doing is instead counting the first season + the second + the third. As a result it ended up marking me as watched 228 episodes, when I'm only on 90. A fix for this should be pretty simple, before adding it together, check if the season starts at episode 1, if it doesn't don't add it together. Alternatively, see if the season starts on the episode after the last season let off, and if it does, don't add it together.

An example situation for One Piece is this: s1e1-s1e61, s2e62-s2e77, s3e78-91, etc. It's like this because it follows the major arcs as the seasons. Because all these seasons are Mapped to the same show, it ends up incorrectly doing 61+77+90=228, rather then using 90

There are also likely some edge cases as well where the series has a first season, but the second season is cut into 2 parts, so the second season would effectively have "2 seasons" in plex, and the second part continues the episode count from the first part, but both parts are Mapped to the same season on anilist, but the first season mapped to the first season. This would result in the first season being fine, and the second season being fine, but once you watch an episode of part 2 it would add the parts (let's say both parts have 12 episodes) so it would be 12+13 instantly marking the series as completed. That said, by checking the current season vs previous season for if it gets added together or not, should work.

@Soitora
Copy link

Soitora commented Apr 26, 2022

That is not at all the correct way to display seasons in any method Plex is using (since afaik, Plex doesn't support Season+Absolute)... I'd expect the program to not function correctly when attempting a season-absolute way of ordering, because in your example, One Piece would actually be this:

s1e1-s1e61, s2e01-s2e16, s3e1-s3e14

I don't think your "if no episode 1 then change method of counting" would be that good, if this was added, it would be a switch

@reconman
Copy link
Collaborator

The file naming format is required by TMDB, I have the same problems.

So I can easily test it, just the implementation is the challenge.

@Soitora
Copy link

Soitora commented Apr 26, 2022

The file naming format is required by TMDB, I have the same problems.

Is that specific to long running single series? Or every?

@Jaynator495
Copy link
Contributor Author

Is that specific to long running single series? Or every?

One piece is a major one, but there are also minor edge cases as I outlined where 2 part seasons end up as different seasons in the TMDB.

I think the solution could be to check the previous season episode count to see if the current seasons first episode is +1 to the last season, if it is, ignore the previous season and use the watched episode number from the current season, else, add the seasons together.

@reconman
Copy link
Collaborator

Btw, all suggested season changes for One Piece on TMDB are denied, repeating "seasons will be merged at a later date", but nothing ever happens.

Jaynator495 added a commit to Jaynator495/PlexAniSync-patch that referenced this issue Apr 28, 2022
Patch to allow for absolute episode ordering between seasons, see RickDB#131
@Jaynator495
Copy link
Contributor Author

Created a pull request that should fix it, #132

reconman pushed a commit that referenced this issue May 1, 2022
Patch to allow for absolute episode ordering between seasons, see #131
@reconman reconman closed this as completed May 1, 2022
@DJScias
Copy link

DJScias commented Jun 15, 2023

Hello there,

I'm currently watching One Piece and noticed this issue still seems to exist in some shape or form.

The log part that is relevant:

    2023-06-14 17:39:07 [PLEX] Found matching anime series
    2023-06-14 17:39:07 [PLEX] Retrieving watch count for series
    2023-06-14 17:39:07 [PLEX] 30 episodes watched for One Piece season 1
    2023-06-14 17:39:07 [PLEX] 44 episodes watched for One Piece season 2
    2023-06-14 17:39:07 [PLEX] 63 episodes watched for One Piece season 3
    2023-06-14 17:39:07 [PLEX] 77 episodes watched for One Piece season 4
    2023-06-14 17:39:07 [PLEX] 91 episodes watched for One Piece season 5
    2023-06-14 17:39:08 [PLEX] 135 episodes watched for One Piece season 6
    2023-06-14 17:39:08 [PLEX] 152 episodes watched for One Piece season 7
    2023-06-14 17:39:08 [PLEX] 167 episodes watched for One Piece season 8
    2023-06-14 17:39:09 [PLEX] Found 1 watched series
    2023-06-14 17:39:09 [ANILIST] Matching Plex series to Anilist
    2023-06-14 17:39:09 [ANILIST] --------------------------------------------------
    2023-06-14 17:39:09 [ANILIST] Custom Mapping of Title found | title: One Piece | anilist id: 21 | total watched episodes: 759 | seasons with the same anilist id: [1, 2, 3, 4, 5, 6, 7, 8]
    2023-06-14 17:39:09 [ANILIST] Updating series: ONE PIECE | Episodes watched: 759

So I use tvdb4 mode from Absolute Series Scanner, which in turn follows a custom mapping and makes the episode numbers absolute between seasons.

S1 has 30 episodes. (starts at ep 1)
S2 has 14 episodes. (starts at ep 31)
S3 has 19 espisodes. (starts at ep 45)
Etc..

However, for some reason it seems it's detecting it wrong, because at season 2 the log says 44 episodes watched.
Season 2 on this mapping does end on episode 44, but it's only from 31 to 44 thus 13 episodes.
Then for S3 the log says 63 episodes watched. While the season is only 19 episodes. However the last episode is indeed again 63.

So it seems like it's taking the last number inside the season on Plex as a total watched per season. Which makes sense for normal series. But #132 and this issue led me to believe that series like One Piece which might carry on their numbering between seasons would work?

Am I incorrect? Do I need to add something to my mapping to indicate the numbering between seasons is absolute?

Thanks in advance for any answers.

@reconman reconman reopened this Nov 5, 2023
@reconman reconman closed this as completed Nov 5, 2023
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

4 participants