diff options
-rw-r--r-- | src/github/daneren2005/dsub/view/DownloadFileAdapter.java | 1 | ||||
-rw-r--r-- | src/github/daneren2005/dsub/view/SongView.java | 11 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/github/daneren2005/dsub/view/DownloadFileAdapter.java b/src/github/daneren2005/dsub/view/DownloadFileAdapter.java index f9676dbd..f535acef 100644 --- a/src/github/daneren2005/dsub/view/DownloadFileAdapter.java +++ b/src/github/daneren2005/dsub/view/DownloadFileAdapter.java @@ -42,6 +42,7 @@ public class DownloadFileAdapter extends ArrayAdapter<DownloadFile> { }
DownloadFile downloadFile = getItem(position);
view.setObject(downloadFile.getSong(), false);
+ view.setDownloadFile(downloadFile);
return view;
}
}
diff --git a/src/github/daneren2005/dsub/view/SongView.java b/src/github/daneren2005/dsub/view/SongView.java index 73efc9b9..3354b58b 100644 --- a/src/github/daneren2005/dsub/view/SongView.java +++ b/src/github/daneren2005/dsub/view/SongView.java @@ -55,6 +55,7 @@ public class SongView extends UpdateView implements Checkable { private DownloadService downloadService; private long revision = -1; private DownloadFile downloadFile; + private boolean dontChangeDownloadFile = false; private boolean playing = false; private boolean rightImage = false; @@ -150,7 +151,13 @@ public class SongView extends UpdateView implements Checkable { revision = -1; loaded = false; - } + dontChangeDownloadFile = false; + } + + public void setDownloadFile(DownloadFile downloadFile) { + this.downloadFile = downloadFile; + dontChangeDownloadFile = true; + } @Override protected void updateBackground() { @@ -162,7 +169,7 @@ public class SongView extends UpdateView implements Checkable { } long newRevision = downloadService.getDownloadListUpdateRevision(); - if(revision != newRevision || downloadFile == null) { + if((revision != newRevision && dontChangeDownloadFile == false) || downloadFile == null) { downloadFile = downloadService.forSong(song); revision = newRevision; } |