Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Favorites error #2

Closed
skarllot opened this issue Dec 1, 2015 · 5 comments
Closed

Favorites error #2

skarllot opened this issue Dec 1, 2015 · 5 comments

Comments

@skarllot
Copy link

skarllot commented Dec 1, 2015

Should have hundreds of favorites but couldn't get none.

Migrating 0 favorites for Fabricio Godoy
Traceback (most recent call last):
  File "rdio-export.py", line 117, in <module>
    migrate_favorites(args.rdio_username)
  File "rdio-export.py", line 110, in migrate_favorites
    for match in matched_tracks:
  File "/home/fgodoy/Projects/External/rdio-export/match.py", line 228, in match_tracks
    percentage = int(100 * count / float(num_tracks))
ZeroDivisionError: float division by zero
@yns88
Copy link

yns88 commented Dec 1, 2015

This is because it uses user['trackCount'] to compute num_tracks, which is a deprecated field that was just recently broken. I'd like to import my Favorites to Google Play, so I'll see if I can post a bugfix.

@ghost
Copy link

ghost commented Dec 1, 2015

Hit he same issue an hour ago. My quick fix, I changed line 109 of rdio-export.py to:

matched_tracks = match_tracks(list(rdio_tracks), 1, pm)

This means the percentage complete won't work, but you won't divide by zero. And I had to wrap rdio_tracks in a list() for some reason to turn it from a generator into a list or else the match_tracks function wasn't processing it correctly. I'm not a python guru so this was all very hacky.

@yns88
Copy link

yns88 commented Dec 1, 2015

I just posted a pull request that will omit the total and percentage calculations from the Favorites import: #4

@ianloic
Copy link
Owner

ianloic commented Dec 1, 2015

I've got a better solution in the works. Sorry for the issue....

@ianloic
Copy link
Owner

ianloic commented Dec 1, 2015

Fixed it in c74277e

Update and try again. Let me know if you see the issue again.

@ianloic ianloic closed this as completed Dec 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants