Skip to content

Commit

Permalink
Include MusicBrainz Release URL in log output
Browse files Browse the repository at this point in the history
This also passes *all* metadata to the `result` object, giving loggers a
lot more (release) metadata to work with, in case custom, “3rd party”
loggers (or even ourselves in the future!) want to do something more
fancy or expansive with the metadata in the log file.

Fixes #381

Signed-off-by: Frederik “Freso” S. Olesen <freso.dk@gmail.com>
  • Loading branch information
Freso committed Mar 16, 2019
1 parent a9bb51a commit a758ea5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions whipper/command/cd.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ def do(self):
_, self.program.result.vendor, self.program.result.model, \
self.program.result.release = \
cdio.Device(self.device).get_hwinfo()
self.program.result.metadata = self.program.metadata

self.doCommand()

Expand Down
3 changes: 3 additions & 0 deletions whipper/result/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ def logRip(self, ripResult, epoch):
ripResult. table.getMusicBrainzDiscId())
lines.append(" MusicBrainz lookup url: %s" %
ripResult. table.getMusicBrainzSubmitURL())
if ripResult.metadata:
lines.append(" MusicBrainz Release url: %s" %
ripResult.metadata.url)
lines.append("")

# TOC section
Expand Down
3 changes: 3 additions & 0 deletions whipper/result/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ class RipResult:
@ivar offset: sample read offset
@ivar table: the full index table
@type table: L{whipper.image.table.Table}
@ivar metadata: disc metadata from MusicBrainz (if available)
@type metadata: L{whipper.common.mbngs.DiscMetadata}
@ivar vendor: vendor of the CD drive
@ivar model: model of the CD drive
Expand All @@ -88,6 +90,7 @@ class RipResult:
table = None
artist = None
title = None
metadata = None

vendor = None
model = None
Expand Down

0 comments on commit a758ea5

Please sign in to comment.