~aleteoryx/bcdl

12521e41a410727e479e24128591f18af37b55da — Aleteoryx 24 days ago 29172a7
leading disc #
1 files changed, 2 insertions(+), 2 deletions(-)

M playback2scrob.py
M playback2scrob.py => playback2scrob.py +2 -2
@@ 2,7 2,7 @@

doc = '''
scrobble .rockbox/playback.log, handling exclusions and such.
this script assumes filenames of the form '$root/<artist>/<album>? (Disc <#>)?/<#> - <name>.<ext>'
this script assumes filenames of the form '$root/<artist>/<album>? (Disc <#>)?/[Disk # - ]<#> - <name>.<ext>'

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]