From 90687a6b4365ed5c75709df3654f77af1f34d6d0 Mon Sep 17 00:00:00 2001 From: Colin Powell Date: Mon, 16 Jan 2023 19:36:10 -0500 Subject: [PATCH] Fix complicated completion percentage --- vrobbler/apps/scrobbles/utils.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/vrobbler/apps/scrobbles/utils.py b/vrobbler/apps/scrobbles/utils.py index 251e1d8..40c3dcf 100644 --- a/vrobbler/apps/scrobbles/utils.py +++ b/vrobbler/apps/scrobbles/utils.py @@ -1,5 +1,4 @@ import logging -from typing import Any, Optional from urllib.parse import unquote from dateutil.parser import ParserError, parse @@ -68,13 +67,8 @@ def parse_mopidy_uri(uri: str) -> dict: def check_scrobble_for_finish(scrobble: "Scrobble") -> None: - completion_percent = getattr(settings, "MUSIC_COMPLETION_PERCENT", 95) - if scrobble.video: - completion_percent = getattr(settings, "VIDEO_COMPLETION_PERCENT", 90) - if scrobble.podcast_episode: - completion_percent = getattr( - settings, "PODCAST_COMPLETION_PERCENT", 25 - ) + completion_percent = scrobble.media_obj.COMPLETION_PERCENT + if scrobble.percent_played >= completion_percent: logger.debug( f"Beyond completion percent {completion_percent}, finishing scrobble"