diff --git a/AndroidManifest.xml b/AndroidManifest.xml index b3d95ebb..e4c45f96 100644 --- a/AndroidManifest.xml +++ b/AndroidManifest.xml @@ -2,8 +2,8 @@ + a:versionCode="30" + a:versionName="1.2.0.3" > diff --git a/res/xml/settings.xml b/res/xml/settings.xml index 925294f5..8b309959 100644 --- a/res/xml/settings.xml +++ b/res/xml/settings.xml @@ -39,11 +39,6 @@ a:key="discAndTrackSort" a:summary="@string/settings.disc_sort_summary" a:title="@string/settings.disc_sort" /> - + cache = refresh ? null : cachedMusicDirectories.get(Constants.INTENT_EXTRA_NAME_VIDEOS); + + MusicDirectory dir = cache == null ? null : cache.get(); + + if (dir == null) { + dir = musicService.getVideos(refresh, context, progressListener); + cache = new TimeLimitedCache(Util.getDirectoryCacheTime(context), TimeUnit.SECONDS); + cache.set(dir); + cachedMusicDirectories.put(Constants.INTENT_EXTRA_NAME_VIDEOS, cache); + } + + return dir; } } diff --git a/src/com/thejoshwa/ultrasonic/androidapp/service/MusicService.java b/src/com/thejoshwa/ultrasonic/androidapp/service/MusicService.java index 9aaa1b7e..187dc779 100644 --- a/src/com/thejoshwa/ultrasonic/androidapp/service/MusicService.java +++ b/src/com/thejoshwa/ultrasonic/androidapp/service/MusicService.java @@ -136,5 +136,5 @@ public interface MusicService { void createBookmark(String id, int position, Context context, ProgressListener progressListener) throws Exception; - MusicDirectory getVideos(Context context, ProgressListener progressListener) throws Exception; + MusicDirectory getVideos(boolean refresh, Context context, ProgressListener progressListener) throws Exception; } \ No newline at end of file diff --git a/src/com/thejoshwa/ultrasonic/androidapp/service/RESTMusicService.java b/src/com/thejoshwa/ultrasonic/androidapp/service/RESTMusicService.java index 307eef19..9e44a86d 100644 --- a/src/com/thejoshwa/ultrasonic/androidapp/service/RESTMusicService.java +++ b/src/com/thejoshwa/ultrasonic/androidapp/service/RESTMusicService.java @@ -1274,7 +1274,7 @@ public class RESTMusicService implements MusicService { } @Override - public MusicDirectory getVideos(Context context, ProgressListener progressListener) throws Exception { + public MusicDirectory getVideos(boolean refresh, Context context, ProgressListener progressListener) throws Exception { checkServerVersion(context, "1.8", "Videos not supported."); Reader reader = getReader(context, progressListener, "getVideos", null);