Merge lp:~samuel-buffet/entertainer/bug_310413 into lp:entertainer
Proposed by
Samuel Buffet
Status: | Superseded | ||||
---|---|---|---|---|---|
Proposed branch: | lp:~samuel-buffet/entertainer/bug_310413 | ||||
Merge into: | lp:entertainer | ||||
To merge this branch: | bzr merge lp:~samuel-buffet/entertainer/bug_310413 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Paul Hummer | Needs Fixing | ||
Review via email: mp+2727@code.launchpad.net |
This proposal has been superseded by a proposal from 2009-01-31.
To post a comment you must log in.
We now do care of the status of the answer we receive from the CDDB query.
I've also fixed a unicode/charset issue. At least for western occidental accentuated languages.
Samuel,
NOTE:
To test you'll need to find the 2 types of CD.
the one with on dictionnary result (status 200)
the one which gives a list of 3 dictionnaries (status 210 or 211)
(I had difficulties to find a type 200)
the diff: /frontend/ medialibrary/ music.py' frontend/ medialibrary/ music.py 2008-08-05 07:42:50 +0000 frontend/ medialibrary/ music.py 2009-01-08 21:46:01 +0000
=== modified file 'entertainerlib
--- entertainerlib/
+++ entertainerlib/
@@ -601,65 +601,49 @@
- # FIXME: query_info contains code that we could use instead of TRY cddb-py. sourceforge. net/CDDB/ README title.index( ' / ')] query_info[ 'category' ], 'disc_id' ]) len(disc_ id) - 1] - cumulative_length append( CompactDiscTrac k(i + 1, track_title, title'] [:query[ 'title' ].index( ' / ')] title'] [query[ 'title' ].index( ' / ') + 3:] query_info[ 0]['category' ], 0]['disc_ id']) len(disc_ id) - 1] - cumulative_length
- # EXCEPT
- #See CDDB documentation for more information.
+ #See CDDB documentation for more information
#http://
-
- if query_info is not None:
- # query_info variable's type depends on how many matches we get.
- # If we get just one match then it's a map and if we get more
- # than one it's a list.
- try:
- title = query_info['title']
- self.artist = title[:
- self.album = title[title.index(' / ') + 3:]
-
- # Get track titles
- (read_status, read_info) = CDDB.read(
- query_info[
- cumulative_length = 0
- for i in range(disc_id[1]):
- if i + 4 == len(disc_id):
- # We must calculate last track length different way
- length = disc_id[
- else:
- # Calculate track length in seconds
- length = (disc_id[i+3] - disc_id[i+2]) / 75
- cumulative_length = cumulative_length + length
-
- track_title = read_info['TTITLE' + str(i)]
- self.tracks.
- length))
- except:
- query = query_info[0]
- self.artist = query['
- self.album = query['
-
- # Get track titles
- (read_status, read_info) = CDDB.read(
- query_info[
- cumulative_length = 0
- for i in range(disc_id[1]):
- if i + 4 == len(disc_id):
- # We must calculate last track length different way
- length = disc_id[
- else:
- # Calculate track length in seconds
- length = (disc_id[i+3] - disc_id[i+2]) / 75
- cumulative_length = cumu...