Skip to content

Fixed 'ListItem.PercentPlayed' infolabel for skins #953

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions resources/lib/modules/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -1198,6 +1198,16 @@ def add_directory_item(self, name, **params):
):
params["resume"] = str(menu_item["resume_time"])
item.setProperty("resumetime", str(menu_item["resume_time"]))
if (
"percent_played" in menu_item
and menu_item.get("percent_played") is not None
and float(menu_item.get("percent_played", 0)) > 0
and "resume_time" in menu_item
and menu_item.get("resume_time") is not None
and int(menu_item.get("resume_time", 0)) > 0
):
totaltime = (float(menu_item["resume_time"]) / float(menu_item["percent_played"])) * 100
item.setProperty("totaltime", str(totaltime))
if "play_count" in menu_item and menu_item.get("play_count") is not None:
info["playcount"] = menu_item["play_count"]
if "air_date" in menu_item and menu_item.get("air_date") is not None:
Expand Down