diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/github/daneren2005/dsub/service/sync/StarredSyncAdapter.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/github/daneren2005/dsub/service/sync/StarredSyncAdapter.java b/src/github/daneren2005/dsub/service/sync/StarredSyncAdapter.java index cc9db1f8..10ab58b6 100644 --- a/src/github/daneren2005/dsub/service/sync/StarredSyncAdapter.java +++ b/src/github/daneren2005/dsub/service/sync/StarredSyncAdapter.java @@ -63,9 +63,14 @@ public class StarredSyncAdapter extends SubsonicSyncAdapter { oldSyncedList.removeAll(syncedList);
for(String path: oldSyncedList) {
- File file = new File(path);
- if(!file.delete()) {
- Log.w(TAG, "Failed to delete " + path);
+ File saveFile = new File(path);
+
+ // Unpin file, rename to .complete
+ File completeFile = new File(saveFile.getParent(), FileUtil.getBaseName(saveFile.getName()) +
+ ".complete." + FileUtil.getExtension(saveFile.getName()));
+
+ if(!saveFile.renameTo(completeFile)) {
+ Log.w(TAG, "Failed to rename " + path + " to " + completeFile.getPath());
}
}
|