Skip to content

Commit

Permalink
Fall back to Trakt runtime when calculating movie progress
Browse files Browse the repository at this point in the history
  • Loading branch information
ZelKami committed Sep 4, 2023
1 parent f1bd295 commit 67cfcd5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions resources/lib/syncMovies.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,12 @@ def __addMovieProgressToKodi(self, traktMovies, kodiMovies, fromPercent, toPerce

self.sync.UpdateProgress(fromPercent, line1='', line2=kodiUtilities.getString(
32126) % len(kodiMoviesToUpdate))
# If library item doesn't have a runtime set get it from
# Trakt to avoid later using 0 in runtime * progress_pct.
for movie in kodiMoviesToUpdate:
if not movie['runtime']:
movie['runtime'] = self.sync.traktapi.getMovieSummary(
movie['ids']['trakt'], extended='full').runtime * 60
# need to calculate the progress in int from progress in percent from Trakt
# split movie list into chunks of 50
chunksize = 50
Expand Down

0 comments on commit 67cfcd5

Please sign in to comment.