diff options
Diffstat (limited to 'app/src/main/java/github')
4 files changed, 12 insertions, 11 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/fragments/NowPlayingFragment.java b/app/src/main/java/github/daneren2005/dsub/fragments/NowPlayingFragment.java index 10623b4e..a813fce2 100644 --- a/app/src/main/java/github/daneren2005/dsub/fragments/NowPlayingFragment.java +++ b/app/src/main/java/github/daneren2005/dsub/fragments/NowPlayingFragment.java @@ -1175,10 +1175,10 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis downloadService.previous(); break; case ACTION_FORWARD: - downloadService.seekTo(downloadService.getPlayerPosition() + DownloadService.FAST_FORWARD); + downloadService.fastForward(); break; case ACTION_REWIND: - downloadService.seekTo(downloadService.getPlayerPosition() - DownloadService.REWIND); + downloadService.rewind(); break; } return null; diff --git a/app/src/main/java/github/daneren2005/dsub/fragments/SubsonicFragment.java b/app/src/main/java/github/daneren2005/dsub/fragments/SubsonicFragment.java index de230309..a8b21be9 100644 --- a/app/src/main/java/github/daneren2005/dsub/fragments/SubsonicFragment.java +++ b/app/src/main/java/github/daneren2005/dsub/fragments/SubsonicFragment.java @@ -1601,7 +1601,7 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR Share share = shares.get(0); shareExternal(share); } else { - Util.toast(context, context.getResources().getString(R.string.playlist_error), false); + Util.toast(context, context.getResources().getString(R.string.share_create_error), false); } } @@ -1611,9 +1611,10 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR if (error instanceof OfflineException || error instanceof ServerTooOldException) { msg = getErrorMessage(error); } else { - msg = context.getResources().getString(R.string.playlist_error) + " " + getErrorMessage(error); + msg = context.getResources().getString(R.string.share_create_error) + " " + getErrorMessage(error); } + Log.e(TAG, "Failed to create share", error); Util.toast(context, msg, false); } }.execute(); diff --git a/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java b/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java index 8213a7d4..4b8d9db3 100644 --- a/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java +++ b/app/src/main/java/github/daneren2005/dsub/service/DownloadService.java @@ -107,8 +107,6 @@ public class DownloadService extends Service { public static final String CMD_NEXT = "github.daneren2005.dsub.CMD_NEXT"; public static final String CANCEL_DOWNLOADS = "github.daneren2005.dsub.CANCEL_DOWNLOADS"; public static final String START_PLAY = "github.daneren2005.dsub.START_PLAYING"; - public static final int FAST_FORWARD = 30000; - public static final int REWIND = 10000; private static final long DEFAULT_DELAY_UPDATE_PROGRESS = 1000L; private static final double DELETE_CUTOFF = 0.84; private static final int REQUIRED_ALBUM_MATCHES = 4; @@ -1178,10 +1176,10 @@ public class DownloadService extends Service { } } public synchronized int rewind() { - return seekToWrapper(-REWIND); + return seekToWrapper(Integer.parseInt(Util.getPreferences(this).getString(Constants.PREFERENCES_KEY_REWIND_INTERVAL, "10"))*-1000); } public synchronized int fastForward() { - return seekToWrapper(FAST_FORWARD); + return seekToWrapper(Integer.parseInt(Util.getPreferences(this).getString(Constants.PREFERENCES_KEY_FASTFORWARD_INTERVAL, "30"))*1000); } protected int seekToWrapper(int difference) { int msPlayed = Math.max(0, getPlayerPosition()); @@ -2605,7 +2603,7 @@ public class DownloadService extends Service { // Check forwards for(int i = index + 1; i < downloadList.size() && matched < REQUIRED_ALBUM_MATCHES; i++) { - if(albumName.equals(downloadList.get(i).getSong().getAlbum())) { + if(Util.equals(albumName, downloadList.get(i).getSong().getAlbum())) { matched++; } else { break; @@ -2614,7 +2612,7 @@ public class DownloadService extends Service { // Check backwards for(int i = index - 1; i >= 0 && matched < REQUIRED_ALBUM_MATCHES; i--) { - if(albumName.equals(downloadList.get(i).getSong().getAlbum())) { + if(Util.equals(albumName, downloadList.get(i).getSong().getAlbum())) { matched++; } else { break; diff --git a/app/src/main/java/github/daneren2005/dsub/util/Constants.java b/app/src/main/java/github/daneren2005/dsub/util/Constants.java index 21adce8c..199fc56d 100644 --- a/app/src/main/java/github/daneren2005/dsub/util/Constants.java +++ b/app/src/main/java/github/daneren2005/dsub/util/Constants.java @@ -179,7 +179,9 @@ public final class Constants { public static final String PREFERENCES_KEY_PLAYBACK_SPEED = "playbackSpeed"; public static final String PREFERENCES_KEY_SONG_PLAYBACK_SPEED = "songPlaybackSpeed"; public static final String PREFERENCES_KEY_DLNA_CASTING_ENABLED = "dlnaCastingEnabled"; - + public static final String PREFERENCES_KEY_REWIND_INTERVAL = "rewindInterval"; + public static final String PREFERENCES_KEY_FASTFORWARD_INTERVAL = "fastforwardInterval"; + public static final String OFFLINE_SCROBBLE_COUNT = "scrobbleCount"; public static final String OFFLINE_SCROBBLE_ID = "scrobbleID"; public static final String OFFLINE_SCROBBLE_SEARCH = "scrobbleTitle"; |