Skip to content

Commit

Permalink
[30] Fixed #2186 total_runtime will now trigger an overlay update (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
meisnate12 authored and actions-user committed Aug 16, 2024
1 parent b23e679 commit ce6a921
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/validate-pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
done
- name: Run Spellcheck
uses: rojopolis/spellcheck-github-actions@0.40.0
uses: rojopolis/spellcheck-github-actions@0.41.0

docker-build-pull:
runs-on: ubuntu-latest
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@ Fixes #2135 AniDB Builder type conversion error
Fixed #2150; change xmen list to a new one
Fixed #2169 Add handling for blank secrets
Fixed #2176 `clean_bundles`, `optimize`, and `empty_trash` not working as global attributes
Fixed #2186 `total_runtime` will now trigger an overlay update

Various other Minor Fixes
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.2-build29
2.0.2-build30
2 changes: 1 addition & 1 deletion modules/overlay.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"anidb_rating", "anidb_average_rating", "anidb_score_rating", "mal_rating"
]
float_vars = ["audience_rating", "critic_rating", "user_rating"] + rating_sources
int_vars = ["runtime", "season_number", "episode_number", "episode_count", "versions"]
int_vars = ["runtime", "total_runtime", "season_number", "episode_number", "episode_count", "versions"]
date_vars = ["originally_available"]
types_for_var = {
"movie_show_season_episode_artist_album": ["runtime", "user_rating", "title"],
Expand Down
11 changes: 8 additions & 3 deletions modules/overlays.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,14 @@ def trakt_ratings():
if properties[over_name].name.startswith("text"):
for cache_key, cache_value in self.cache.query_overlay_special_text(item.ratingKey).items():
actual = plex.attribute_translation[cache_key] if cache_key in plex.attribute_translation else cache_key
if not hasattr(item, actual):
continue
real_value = getattr(item, actual)
if actual == "total_runtime":
sub_items = item.episodes() if current_overlay.level in ["show", "season"] else item.tracks()
sub_items = [ep.duration for ep in sub_items if hasattr(ep, "duration") and ep.duration]
real_value = sum(sub_items)
else:
if not hasattr(item, actual):
continue
real_value = getattr(item, actual)
if cache_value is None or real_value is None:
continue
if cache_key in overlay.float_vars:
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ requests==2.32.3
tenacity==9.0.0
ruamel.yaml==0.18.6
schedule==1.2.2
setuptools==72.1.0
setuptools==72.2.0
tmdbapis==1.2.16

0 comments on commit ce6a921

Please sign in to comment.