diff options
author | Scott Jackson <daneren2005@gmail.com> | 2018-08-17 16:50:13 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2018-08-17 16:50:13 -0700 |
commit | f3c2f7d46309391119120ceb74c198e6062afb1c (patch) | |
tree | 023123dae62fbc92894a0fcbb8eb20801cdb048b | |
parent | 05bc7185cb6d35dfd6ea7b0c3aeaf977357e3b64 (diff) | |
download | dsub-f3c2f7d46309391119120ceb74c198e6062afb1c.tar.gz dsub-f3c2f7d46309391119120ceb74c198e6062afb1c.tar.bz2 dsub-f3c2f7d46309391119120ceb74c198e6062afb1c.zip |
Fixes #869 Android Auto using the cached indexes from the main app
-rw-r--r-- | app/src/main/java/github/daneren2005/dsub/service/CachedMusicService.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/service/CachedMusicService.java b/app/src/main/java/github/daneren2005/dsub/service/CachedMusicService.java index 9fd26fe5..1e91a61e 100644 --- a/app/src/main/java/github/daneren2005/dsub/service/CachedMusicService.java +++ b/app/src/main/java/github/daneren2005/dsub/service/CachedMusicService.java @@ -148,7 +148,11 @@ public class CachedMusicService implements MusicService { cachedIndexes.clear(); cachedMusicFolders.clear(); } - Indexes result = cachedIndexes.get(); + Indexes result = null; + if(Util.equals(musicFolderId, this.musicFolderId)) { + result = cachedIndexes.get(); + } + if (result == null) { String name = Util.isTagBrowsing(context, musicService.getInstance(context)) ? "artists" : "indexes"; name = getCacheName(context, name, musicFolderId); @@ -160,7 +164,10 @@ public class CachedMusicService implements MusicService { result = musicService.getIndexes(musicFolderId, refresh, context, progressListener); FileUtil.serialize(context, result, name); } - cachedIndexes.set(result); + + if(Util.equals(musicFolderId, this.musicFolderId)) { + cachedIndexes.set(result); + } } return result; } |