diff options
-rw-r--r-- | README | 8 | ||||
-rw-r--r-- | res/values-hu/strings.xml | 14 | ||||
-rw-r--r-- | src/github/daneren2005/dsub/service/CachedMusicService.java | 78 |
3 files changed, 39 insertions, 61 deletions
@@ -11,9 +11,10 @@ Replace the file DragSortListView/library/libs/android-support-v4.jar with the o Roadmap of major planned features in rough order that I plan to work on them in (little features get sprinkled in wherever): -Background Sync - -Mark playlists as 'offline', syncs changes - -Mark podcasts as 'offline', download new episodes only +Tag Browsing +Album Art Grid View + -Display albums in a grid + -Display artists if supported (yes for tags, no for folders currently) RemoteControl -Chromecast -DLNA/UpNP Client @@ -22,7 +23,6 @@ New Tabs -Admin functions -Change your password -Create/delete users if admin - -Sharing tab -Internet Radio tab HLS Video -Display video where album art is currently (double tap to fullscreen) diff --git a/res/values-hu/strings.xml b/res/values-hu/strings.xml index 9670b311..1cf6075f 100644 --- a/res/values-hu/strings.xml +++ b/res/values-hu/strings.xml @@ -70,7 +70,7 @@ <string name="menu.settings">Beállítások</string>
<string name="menu.help">Súgó</string>
<string name="menu.about">Névjegy</string>
- <string name="menu.add_playlist">Hozzáadás lejátszási listához</string>
+ <string name="menu.add_playlist">Mentés lejátszási listába</string>
<string name="menu.remove_playlist">Eltávolítás a lejátszási listából</string>
<string name="menu.deleted_playlist">%s lejátszási lista törölve</string>
<string name="menu.deleted_playlist_error">%s lejátszási lista törlése sikertelen!</string>
@@ -85,11 +85,11 @@ <string name="menu.share">Megosztás</string>
<string name="playlist.label">Lejátszási listák</string>
- <string name="playlist.update_info">Módosítás</string>
+ <string name="playlist.update_info">Szerkesztés</string>
<string name="playlist.updated_info">%s lejátszási lista módosítva</string>
<string name="playlist.updated_info_error">%s lejátszási lista módosítása sikertelen!</string>
<string name="playlist.overwrite">Létező lejátszási lista felülírása</string>
- <string name="playlist.add_to">Hozzáadás lejátszási listához</string>
+ <string name="playlist.add_to">Mentés lejátszási listába</string>
<string name="playlist.create_new">Új lejátszási lista</string>
<string name="help.label">Súgó</string>
@@ -163,7 +163,7 @@ <string name="download.menu_show_album">Ugrás az albumhoz</string>
<string name="download.menu_lyrics">Dalszöveg</string>
<string name="download.menu_remove">Eltávolítás a várólistáról</string>
- <string name="download.menu_delete">Gyorsítótár ürítése</string>
+ <string name="download.menu_delete">Törlés a gyorsítótárból</string>
<string name="download.menu_remove_all">Összes eltávolítása</string>
<string name="download.menu_screen_on">Kijelző be</string>
<string name="download.menu_screen_off">Kijelző ki</string>
@@ -206,8 +206,8 @@ <string name="sync.new_albums">Új albumok: %s</string>
<string name="sync.new_starred">Új csillagozott dalok</string>
- <string name="starring_content_starred">\"%s"\ csillagozás be</string>
- <string name="starring_content_unstarred">\"%s"\ csillagozás ki</string>
+ <string name="starring_content_starred">\"%s\" csillagozás be</string>
+ <string name="starring_content_unstarred">\"%s\" csillagozás ki</string>
<string name="starring_content_error">Nem sikerült frissíteni \"%s\", próbálja később!</string>
<string name="playlist_error">Nem sikerült elérni a lejátszási lista adatait!</string>
@@ -273,7 +273,7 @@ <string name="settings.track_title">Dalsorszám megjelenítése #</string>
<string name="settings.track_summary">Dalsorszám megjelenítése # a dal címe előtt, ha létezik.</string>
<string name="settings.custom_sort">Egyéni rendezés</string>
- <string name="settings.custom_sort_summary">Könyvtárlisa rendezése a lemez sorszámának megfelelően. Ütközhet a kiszolgáló év szerinti albumrendezésével.</string>
+ <string name="settings.custom_sort_summary">Könyvtárlisa rendezése a lemez sorszámának megfelelően. Ütközhet a kiszolgáló év szerinti albumrendezésével!</string>
<string name="settings.network_title">Hálózat</string>
<string name="settings.max_bitrate_wifi">Max. audió bitráta - Wi-Fi</string>
<string name="settings.max_bitrate_mobile">Max. audió bitráta - Mobilhálózat</string>
diff --git a/src/github/daneren2005/dsub/service/CachedMusicService.java b/src/github/daneren2005/dsub/service/CachedMusicService.java index b8bdf94c..b93a6e1e 100644 --- a/src/github/daneren2005/dsub/service/CachedMusicService.java +++ b/src/github/daneren2005/dsub/service/CachedMusicService.java @@ -60,18 +60,15 @@ public class CachedMusicService implements MusicService { private static final int TTL_MUSIC_DIR = 5 * 60; // Five minutes private final RESTMusicService musicService; - private final LruCache<String, TimeLimitedCache<MusicDirectory>> cachedMusicDirectories; private final TimeLimitedCache<Boolean> cachedLicenseValid = new TimeLimitedCache<Boolean>(120, TimeUnit.SECONDS); private final TimeLimitedCache<Indexes> cachedIndexes = new TimeLimitedCache<Indexes>(60 * 60, TimeUnit.SECONDS); private final TimeLimitedCache<List<Playlist>> cachedPlaylists = new TimeLimitedCache<List<Playlist>>(3600, TimeUnit.SECONDS); private final TimeLimitedCache<List<MusicFolder>> cachedMusicFolders = new TimeLimitedCache<List<MusicFolder>>(10 * 3600, TimeUnit.SECONDS); - private final TimeLimitedCache<List<Genre>> cachedGenres = new TimeLimitedCache<List<Genre>>(10 * 3600, TimeUnit.SECONDS); private final TimeLimitedCache<List<PodcastChannel>> cachedPodcastChannels = new TimeLimitedCache<List<PodcastChannel>>(10 * 3600, TimeUnit.SECONDS); private String restUrl; public CachedMusicService(RESTMusicService musicService) { this.musicService = musicService; - cachedMusicDirectories = new LruCache<String, TimeLimitedCache<MusicDirectory>>(MUSIC_DIR_CACHE_SIZE); } @Override @@ -118,7 +115,6 @@ public class CachedMusicService implements MusicService { if (refresh) { cachedIndexes.clear(); cachedMusicFolders.clear(); - cachedMusicDirectories.evictAll(); } Indexes result = cachedIndexes.get(); if (result == null) { @@ -130,23 +126,18 @@ public class CachedMusicService implements MusicService { @Override public MusicDirectory getMusicDirectory(String id, String name, boolean refresh, Context context, ProgressListener progressListener) throws Exception { - checkSettingsChanged(context); - TimeLimitedCache<MusicDirectory> cache = refresh ? null : cachedMusicDirectories.get(id); - MusicDirectory dir = cache == null ? null : cache.get(); - if (dir == null) { - if(!refresh) { - dir = FileUtil.deserialize(context, getCacheName(context, "directory", id), MusicDirectory.class); - } - - if(dir == null) { - dir = musicService.getMusicDirectory(id, name, refresh, context, progressListener); - FileUtil.serialize(context, dir, getCacheName(context, "directory", id)); - } - cache = new TimeLimitedCache<MusicDirectory>(TTL_MUSIC_DIR, TimeUnit.SECONDS); - cache.set(dir); - cachedMusicDirectories.put(id, cache); - } - return dir; + MusicDirectory dir = null; + + if(!refresh) { + dir = FileUtil.deserialize(context, getCacheName(context, "directory", id), MusicDirectory.class); + } + + if(dir == null) { + dir = musicService.getMusicDirectory(id, name, refresh, context, progressListener); + FileUtil.serialize(context, dir, getCacheName(context, "directory", id)); + } + + return dir; } @Override @@ -354,19 +345,15 @@ public class CachedMusicService implements MusicService { @Override public List<Genre> getGenres(boolean refresh, Context context, ProgressListener progressListener) throws Exception { - checkSettingsChanged(context); - List<Genre> result = refresh ? null : cachedGenres.get(); + List<Genre> result = null; - if (result == null) { - if(!refresh) { - result = FileUtil.deserialize(context, getCacheName(context, "genre"), ArrayList.class); - } - - if(result == null) { - result = musicService.getGenres(refresh, context, progressListener); - FileUtil.serialize(context, new ArrayList<Genre>(result), getCacheName(context, "genre")); - } - cachedGenres.set(result); + if(!refresh) { + result = FileUtil.deserialize(context, getCacheName(context, "genre"), ArrayList.class); + } + + if(result == null) { + result = musicService.getGenres(refresh, context, progressListener); + FileUtil.serialize(context, new ArrayList<Genre>(result), getCacheName(context, "genre")); } return result; @@ -399,27 +386,19 @@ public class CachedMusicService implements MusicService { @Override public MusicDirectory getPodcastEpisodes(boolean refresh, String id, Context context, ProgressListener progressListener) throws Exception { - checkSettingsChanged(context); String altId = "p-" + id; - TimeLimitedCache<MusicDirectory> cache = refresh ? null : cachedMusicDirectories.get(altId); - MusicDirectory result = (cache == null) ? null : cache.get(); + MusicDirectory result = null; - if(result == null) { - if(!refresh) { - result = FileUtil.deserialize(context, getCacheName(context, "directory", altId), MusicDirectory.class, 10); - } - - if(result == null) { - result = musicService.getPodcastEpisodes(refresh, id, context, progressListener); - FileUtil.serialize(context, result, getCacheName(context, "directory", altId)); - } - cache = new TimeLimitedCache<MusicDirectory>(TTL_MUSIC_DIR, TimeUnit.SECONDS); - cache.set(result); - cachedMusicDirectories.put(altId, cache); + if(!refresh) { + result = FileUtil.deserialize(context, getCacheName(context, "directory", altId), MusicDirectory.class, 10); } - return result; + if(result == null) { + result = musicService.getPodcastEpisodes(refresh, id, context, progressListener); + FileUtil.serialize(context, result, getCacheName(context, "directory", altId)); + } + return result; } @Override @@ -494,7 +473,6 @@ public class CachedMusicService implements MusicService { String newUrl = musicService.getRestUrl(context, null, false); if (!Util.equals(newUrl, restUrl)) { cachedMusicFolders.clear(); - cachedMusicDirectories.evictAll(); cachedLicenseValid.clear(); cachedIndexes.clear(); cachedPlaylists.clear(); |