patch by: Christophe Fergeau <cfergeau@redhat.com)

* morituri/common/program.py:
	  When morituri finds multiple matches for a given release, it only
	  keeps the releases whose length are the closest to the CD being
	  ripped.
	  However, this currently interacts badly with the --release-id
	  parameter because this duration filtering is done before trying to
	  do the release-id matching. The release that the user has specified
	  may have been removed from the potential matches by the time the
	  release
	  id match is tried.
	  This commit removes the duration filtering when the user explicitly
	  specified a release id. I've observed this bug with the first disc
	  of The Wall (Experience Edition) by the Pink Floyd.
	  Fixes #91.
This commit is contained in:
Thomas Vander Stichele
2012-04-01 20:41:55 +00:00
parent 93f033dfca
commit 9bf5892dbd
2 changed files with 26 additions and 6 deletions

View File

@@ -1,3 +1,23 @@
2012-04-01 Thomas Vander Stichele <thomas at apestaart dot org>
patch by: Christophe Fergeau <cfergeau@redhat.com)
* morituri/common/program.py:
When morituri finds multiple matches for a given release, it only
keeps the releases whose length are the closest to the CD being
ripped.
However, this currently interacts badly with the --release-id
parameter because this duration filtering is done before trying to
do the release-id matching. The release that the user has specified
may have been removed from the potential matches by the time the
release
id match is tried.
This commit removes the duration filtering when the user explicitly
specified a release id. I've observed this bug with the first disc
of The Wall (Experience Edition) by the Pink Floyd.
Fixes #91.
2012-04-01 Thomas Vander Stichele <thomas at apestaart dot org>
patch by: Christophe Fergeau <cfergeau@redhat.com)

View File

@@ -267,12 +267,6 @@ class Program(log.Loggable):
deltas[delta] = []
deltas[delta].append(metadata)
# Select the release that most closely matches the duration.
lowest = min(deltas.keys())
# If we have multiple, make sure they match
metadatas = deltas[lowest]
if release:
metadatas = [m for m in metadatas if m.url.endswith(release)]
self.debug('Asked for release %r, only kept %r',
@@ -285,6 +279,12 @@ class Program(log.Loggable):
elif not metadatas:
print 'Requested release id %s but none match' % release
return
else:
# Select the release that most closely matches the duration.
lowest = min(deltas.keys())
# If we have multiple, make sure they match
metadatas = deltas[lowest]
if len(metadatas) > 1:
artist = metadatas[0].artist