Skip to content

Commit

Permalink
fixed some small issues in the PlayerService
Browse files Browse the repository at this point in the history
  • Loading branch information
fennifith committed Jun 14, 2016
1 parent 3e91f84 commit 45d3685
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ android {
applicationId "pasta.streamer"
minSdkVersion 16
targetSdkVersion 23
versionCode 3
versionName "1.2"
versionCode 4
versionName "1.3"
renderscriptTargetApi 19
renderscriptSupportModeEnabled true
vectorDrawables.useSupportLibrary = true
Expand Down
13 changes: 5 additions & 8 deletions app/src/main/java/pasta/streamer/PlayerService.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,14 +155,11 @@ public void onConnectionMessage(String s) {
private void onError(String message) {
if (spotifyPlayer != null) {
errorCount++;
if (errorCount < 5) {
if (spotifyPlayer.isShutdown()) {
Toast.makeText(getApplicationContext(), message + ", please restart the app.", Toast.LENGTH_SHORT).show();
} else {
Toast.makeText(getApplicationContext(), message + ", attempting to restart...", Toast.LENGTH_SHORT).show();
stopService(new Intent(this, PlayerService.class));
startService(new Intent(this, PlayerService.class));
}
if (errorCount > 5 && errorCount < 20) {
Toast.makeText(getApplicationContext(), message + ", attempting to restart...", Toast.LENGTH_SHORT).show();
stopService(new Intent(this, PlayerService.class));
startService(new Intent(this, PlayerService.class));
errorCount = 20;
} else Toast.makeText(getApplicationContext(), message, Toast.LENGTH_LONG).show();
}
}
Expand Down

0 comments on commit 45d3685

Please sign in to comment.