From 12521e41a410727e479e24128591f18af37b55da Mon Sep 17 00:00:00 2001 From: Aleteoryx Date: Mon, 10 Nov 2025 11:18:29 -0500 Subject: [PATCH] leading disc # --- playback2scrob.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/playback2scrob.py b/playback2scrob.py index 1bab7ff3aed8cde6ad2bcc6121e7a8479cde3b5f..d80f61447c2ffd8934182123a0d0749cfdc71fa4 100755 --- a/playback2scrob.py +++ b/playback2scrob.py @@ -2,7 +2,7 @@ doc = ''' scrobble .rockbox/playback.log, handling exclusions and such. -this script assumes filenames of the form '$root//? (Disc <#>)?/<#> - .' +this script assumes filenames of the form '$root//? (Disc <#>)?/[Disk # - ]<#> - .' config is INI-format. it supports the following parameters: [pb2s] @@ -126,7 +126,7 @@ def scrobblify(entries: Iterator[RawLogEntry]) -> Iterator[Scrobble]: if (m := re.search(' ?\\(Disc \\d+\\)$', album)) is not None: album = album[:m.start()] - if (m := re.match('\\d+ - ', track)) is not None: + if (m := re.match('(Disc \\d+ - )?\\d+ - ', track)) is not None: track = track[m.end():] track = track.rsplit('.', 1)[0]