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

Refactor: Implement shows sync using episodes #1578

Merged
merged 17 commits into from
Jan 13, 2024
Merged

Conversation

glensc
Copy link
Collaborator

@glensc glensc commented Sep 11, 2023

Implement shows sync using episodes search:

Requires support from PlexApi side: - pkkid/python-plexapi#1243

Fixes #976

@glensc
Copy link
Collaborator Author

glensc commented Sep 11, 2023

Actually for me the syncing is even slower:

  1. Using legacy TV agent
  2. 30 sec (old code) vs 45 sec (new code)

reason being is that extra api calls are still there:

Made query /library/metadata/7632

@glensc glensc force-pushed the episodes branch 2 times, most recently from ef93d07 to 92efa44 Compare September 14, 2023 18:25
@glensc
Copy link
Collaborator Author

glensc commented Sep 14, 2023

timing again:

  • this branch: Completed full sync in 2 min 9.3 seconds
  • master branch: Completed full sync in 33.6 seconds

So, the new code is actually slower for me.

@JonnyWong16
Copy link
Contributor

I think the slowdown is because it is now querying Trakt for every episode since it doesn't create the TraktLookup table anymore.

It's faster on the Plex side, but slower on the Trakt side.

@glensc glensc marked this pull request as ready for review September 15, 2023 15:06
@glensc
Copy link
Collaborator Author

glensc commented Sep 15, 2023

I haven't verified this, but I think it's also slower now because needs to fetch every plex show separately.

can probably can be solved by batching show fetches as well.

@glensc glensc marked this pull request as draft October 23, 2023 20:07
@glensc glensc force-pushed the episodes branch 3 times, most recently from 8651363 to 75cad0a Compare January 7, 2024 13:51
@glensc
Copy link
Collaborator Author

glensc commented Jan 7, 2024

Added plex shows preloading and caching show object for next episode of same show. Timing looks promising.

scanning a library with 227 shows, 5180 episodes with hot cache. the library is mostly healthy (few missing matches) and using legacy agent. there's also bunch of reloading episode/show for year and userRating, that slows down as well.

  • this branch: 12.6-13.9 seconds
  • main branch: 13.7-17.0 seconds

@glensc glensc marked this pull request as ready for review January 8, 2024 14:27
@glensc glensc requested a review from simonc56 January 8, 2024 14:27
@glensc glensc changed the title Implement shows sync using episodes Refactor: Implement shows sync using episodes Jan 8, 2024
@glensc
Copy link
Collaborator Author

glensc commented Jan 13, 2024

I'll go on with merge then

@glensc glensc merged commit f663ac6 into Taxel:main Jan 13, 2024
3 checks passed
@glensc glensc deleted the episodes branch January 13, 2024 12:17
@simonc56
Copy link
Collaborator

Tested successfully.

  • seems faster than before
  • strange to Process each tvshows library twice

@glensc
Copy link
Collaborator Author

glensc commented Jan 13, 2024

it's preloading tvshows in first run. do you have recommendations for it? make it silent? change display?

also, it's processing fast the first round right?

can you also post your timings of now and then?

@simonc56
Copy link
Collaborator

After more tests, i see no time difference between 0.28.4 and 0.28.5 when I sync ratings and watched status.
With those settings, speed is 100~140 episodes/sec and 50~80 movies/sec.

image

I suggest to slightly change display like that :

image

@glensc
Copy link
Collaborator Author

glensc commented Jan 14, 2024

what is the difference? if you made code changes so just submit them?

@simonc56
Copy link
Collaborator

I just draw it on paint.

image

@glensc
Copy link
Collaborator Author

glensc commented Jan 15, 2024

Created new issue:

I stopped using email notifications, so I won't see activity in closed pull requests. Would need to specifically look at closed pull requests and order by activity date.

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

Successfully merging this pull request may close these issues.

Feature request: Change processing rate calculation for shows sections
3 participants