aboutsummaryrefslogtreecommitdiff
path: root/app/src/main/java/github
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2016-05-19 17:30:03 -0700
committerScott Jackson <daneren2005@gmail.com>2016-05-19 17:30:03 -0700
commit3b95f554b3b99f77c99e5962291b1678fa2f1fd9 (patch)
treed9953e2abf9d4eb81f335502430748388e083cfe /app/src/main/java/github
parent1109f27f3c39670a959338062cf52bfa9521a4e2 (diff)
downloaddsub-3b95f554b3b99f77c99e5962291b1678fa2f1fd9.tar.gz
dsub-3b95f554b3b99f77c99e5962291b1678fa2f1fd9.tar.bz2
dsub-3b95f554b3b99f77c99e5962291b1678fa2f1fd9.zip
Don't stop trying when we encounter a bad scrobble
Diffstat (limited to 'app/src/main/java/github')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/service/RESTMusicService.java22
1 files changed, 11 insertions, 11 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/service/RESTMusicService.java b/app/src/main/java/github/daneren2005/dsub/service/RESTMusicService.java
index 7a2edf79..1d9fd4af 100644
--- a/app/src/main/java/github/daneren2005/dsub/service/RESTMusicService.java
+++ b/app/src/main/java/github/daneren2005/dsub/service/RESTMusicService.java
@@ -1769,13 +1769,13 @@ public class RESTMusicService implements MusicService {
int count = offline.getInt(Constants.OFFLINE_SCROBBLE_COUNT, 0);
int retry = 0;
for(int i = 1; i <= count; i++) {
- String id = offline.getString(Constants.OFFLINE_SCROBBLE_ID + i, null);
- long time = offline.getLong(Constants.OFFLINE_SCROBBLE_TIME + i, 0);
- if(id != null) {
- scrobble(id, true, time, context, progressListener);
- } else {
- String search = offline.getString(Constants.OFFLINE_SCROBBLE_SEARCH + i, "");
- try{
+ try {
+ String id = offline.getString(Constants.OFFLINE_SCROBBLE_ID + i, null);
+ long time = offline.getLong(Constants.OFFLINE_SCROBBLE_TIME + i, 0);
+ if(id != null) {
+ scrobble(id, true, time, context, progressListener);
+ } else {
+ String search = offline.getString(Constants.OFFLINE_SCROBBLE_SEARCH + i, "");
SearchCritera critera = new SearchCritera(search, 0, 0, 1);
SearchResult result = searchNew(critera, context, progressListener);
if(result.getSongs().size() == 1){
@@ -1787,10 +1787,10 @@ public class RESTMusicService implements MusicService {
throw new Exception("Song not found on server");
}
}
- catch(Exception e){
- Log.e(TAG, e.toString());
- retry++;
- }
+ }
+ catch(Exception e){
+ Log.e(TAG, e.toString());
+ retry++;
}
}