https://bugs.gpodder.org/show_bug.cgi?id=631

Thomas Perl <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
                 CC|                            |[email protected]
         AssignedTo|[email protected]             |[email protected]
     Ever Confirmed|0                           |1

--- Comment #1 from Thomas Perl <[email protected]> 2009-11-03 18:41:02 GMT ---
Thanks for your patch. Looks good, but some comments about the style:

+                a = entry.split("\t")
+                if len(a)>6:
+                    artist=a[0]
+                    album=a[1]
+                    track=a[2]
+                    length=a[4]
+                    rating=a[5].strip().lower()

This could be better written as something like this:

entry = entry.split('\t')
if len(entry) >= 5:
    artist, album, track, length, rating = entry[:5]
    if 'L' in rating or 'l' in rating:
        # ...
    else:
        # ...

Be sure to fix the log message, as the entry variable has now changed (entry
isn't really used, so I decided to overwrite it instead of using a new variable
"a", which does not have a describing name):

+            log('Skipping scrobbler entry: %d elements %s', len(a), entry)

BTW: The wiki page mentions only a uppercase "L" or "S", so should we really
allow lowercase L's here? I guess Rockbox (the only target so far?) correctly
produces the uppercase version.

After these things have been fixed, please attach the new patch to this bug,
and I'll apply it. Thanks :)

-- 
Configure bugmail: https://bugs.gpodder.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.
_______________________________________________
gPodder-Bugs mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/gpodder-bugs

Reply via email to