From edda726b61f4802cb107294511fff22fcfc89faf Mon Sep 17 00:00:00 2001 From: Audionut Date: Wed, 11 Sep 2024 18:54:17 +1000 Subject: [PATCH 1/4] Multiple duration in DVD screenshot, use longest duration only --- src/prep.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/prep.py b/src/prep.py index 179855297..8ba8531e2 100644 --- a/src/prep.py +++ b/src/prep.py @@ -1125,7 +1125,8 @@ def dvd_screenshots(self, meta, disc_num, num_screens=None): sar = 1 for track in ifo_mi.tracks: if track.track_type == "Video": - length = float(track.duration)/1000 # noqa F841 + durations = [float(d) for d in track.duration.split(' / ')] + length = max(durations) / 1000 # noqa #F841 par = float(track.pixel_aspect_ratio) dar = float(track.display_aspect_ratio) width = float(track.width) From 98897e8bf9c3cbc904d36c1759c97a8ceb11b240 Mon Sep 17 00:00:00 2001 From: Audionut Date: Wed, 11 Sep 2024 18:54:59 +1000 Subject: [PATCH 2/4] Push a docker build --- .github/workflows/docker-image.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 84e6adfe1..b1b1e33bd 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -5,6 +5,7 @@ on: branches: - master - develop + - dvd-seasons env: REGISTRY: ghcr.io From 7271d1ca4c630cbb875199f26e3a1a159f5500bc Mon Sep 17 00:00:00 2001 From: Audionut Date: Thu, 12 Sep 2024 13:37:55 +1000 Subject: [PATCH 3/4] Use float directly --- src/prep.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/prep.py b/src/prep.py index 8ba8531e2..3b9cf2c2e 100644 --- a/src/prep.py +++ b/src/prep.py @@ -1125,8 +1125,15 @@ def dvd_screenshots(self, meta, disc_num, num_screens=None): sar = 1 for track in ifo_mi.tracks: if track.track_type == "Video": - durations = [float(d) for d in track.duration.split(' / ')] - length = max(durations) / 1000 # noqa #F841 + if isinstance(track.duration, str): + # If the duration is a string, split and find the longest duration + durations = [float(d) for d in track.duration.split(' / ')] + length = max(durations) / 1000 # Use the longest duration + else: + # If the duration is already an int or float, use it directly + length = float(track.duration) / 1000 # noqa #F841 # Convert to seconds + + # Proceed as usual for other fields par = float(track.pixel_aspect_ratio) dar = float(track.display_aspect_ratio) width = float(track.width) From 95b58068ef8415f0c0c9a6b1abb010e278e27098 Mon Sep 17 00:00:00 2001 From: Audionut Date: Thu, 12 Sep 2024 15:27:36 +1000 Subject: [PATCH 4/4] Lint --- src/prep.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/prep.py b/src/prep.py index 3b9cf2c2e..cff54730e 100644 --- a/src/prep.py +++ b/src/prep.py @@ -1132,7 +1132,7 @@ def dvd_screenshots(self, meta, disc_num, num_screens=None): else: # If the duration is already an int or float, use it directly length = float(track.duration) / 1000 # noqa #F841 # Convert to seconds - + # Proceed as usual for other fields par = float(track.pixel_aspect_ratio) dar = float(track.display_aspect_ratio)