diff options
Diffstat (limited to 'src/github')
3 files changed, 7 insertions, 4 deletions
diff --git a/src/github/daneren2005/dsub/service/CachedMusicService.java b/src/github/daneren2005/dsub/service/CachedMusicService.java index 34a0118d..6b23730f 100644 --- a/src/github/daneren2005/dsub/service/CachedMusicService.java +++ b/src/github/daneren2005/dsub/service/CachedMusicService.java @@ -196,9 +196,9 @@ public class CachedMusicService implements MusicService { dir = musicService.getPlaylist(refresh, id, name, context, progressListener); FileUtil.serialize(context, dir, getCacheName(context, "playlist", id)); - if(cachedPlaylist == null || !cachedPlaylist.equals(dir)) { + if(cachedPlaylist == null || !cachedPlaylist.getChildren().equals(dir.getChildren())) { File playlistFile = FileUtil.getPlaylistFile(Util.getServerName(context, musicService.getInstance(context)), name); - FileUtil.writePlaylistFile(playlistFile, dir); + FileUtil.writePlaylistFile(context, playlistFile, dir); } } return dir; diff --git a/src/github/daneren2005/dsub/service/sync/SubsonicSyncAdapter.java b/src/github/daneren2005/dsub/service/sync/SubsonicSyncAdapter.java index 1ef01328..1f380e90 100644 --- a/src/github/daneren2005/dsub/service/sync/SubsonicSyncAdapter.java +++ b/src/github/daneren2005/dsub/service/sync/SubsonicSyncAdapter.java @@ -148,7 +148,7 @@ public class SubsonicSyncAdapter extends AbstractThreadedSyncAdapter { } private boolean isValidServer(Context context, int instance) { - String url = Util.getRESTUrl(context, "null", instance, false); + String url = Util.getRestUrl(context, "null", instance, false); if(url.contains("demo.subsonic.org") || url.contains("yourhost")) { return false; } else { diff --git a/src/github/daneren2005/dsub/util/FileUtil.java b/src/github/daneren2005/dsub/util/FileUtil.java index 7d106305..3356456d 100644 --- a/src/github/daneren2005/dsub/util/FileUtil.java +++ b/src/github/daneren2005/dsub/util/FileUtil.java @@ -18,11 +18,14 @@ */ package github.daneren2005.dsub.util; +import java.io.BufferedWriter; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; +import java.io.FileWriter; import java.io.FilenameFilter; +import java.io.IOException; import java.io.RandomAccessFile; import java.io.Serializable; import java.util.Arrays; @@ -126,7 +129,7 @@ public class FileUtil { File playlistDir = getPlaylistDirectory(server); return new File(playlistDir, fileSystemSafe(name) + ".m3u"); } - public static void writePlaylistFile(File file, MusicDirectory playlist) { + public static void writePlaylistFile(Context context, File file, MusicDirectory playlist) throws IOException { FileWriter fw = new FileWriter(file); BufferedWriter bw = new BufferedWriter(fw); try { |