Merge lp:~cmiller/ubuntuone-android-music/cache-random-list into lp:ubuntuone-android-music
Proposed by
Chad Miller
Status: | Merged |
---|---|
Merged at revision: | 515 |
Proposed branch: | lp:~cmiller/ubuntuone-android-music/cache-random-list |
Merge into: | lp:ubuntuone-android-music |
Diff against target: | 0 lines |
To merge this branch: | bzr merge lp:~cmiller/ubuntuone-android-music/cache-random-list |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michał Karnicki (community) | Approve | ||
Review via email: mp+68757@code.launchpad.net |
To post a comment you must log in.
I was worried about one issue, but I wasn't able to reproduce it (by modifying the code for it to think I have 0 songs), so I may be wrong here. The call to public MusicDirectory getRandomSongs - if user has 0 songs (new user), this will call updateGetRandom Songs with sleepDuration == 0L. I think the second part of the alternative getChildren( ).size( ) == 0))""" Songs() , and in turn musicService. getRandomSongs( ). If cache is of size 0, it may also mean user has 0 songs and there's no need to refresh (can we somehow tell?).
"""if ((cached == null) || (cached.
should not cause immediate call to updateGetRandom
One silly detail. If ShufflePlayBuffer ln 110 expects songs may be null, I wouldn't include printing the exception stack trace in ln 118 Log.w(TAG, "Failed to refill shuffle-play buffer.", x); -- IMHO if we're anticipating a null value, we shouldn't log "ShufflePlayBuffer W java.lang. NullPointerExce ption" + stack trace -- it just looks terribly in the logs ;) I assume you didn't add an if (songs == null), because you wanted to increase the errorCount in catch clause.
Interesting catch with the project name!
With the first paragraph in mind, well done! +1