Merge pull request #1586 from mfietz/issue/1529-delayed-availability

Reset episode to new if media becomes available
This commit is contained in:
Tom Hennen 2016-01-23 09:51:49 -05:00
commit c0884f72d8
1 changed files with 6 additions and 0 deletions

View File

@ -8,6 +8,7 @@ import android.net.Uri;
import android.os.Parcel;
import android.os.Parcelable;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import java.util.Date;
import java.util.List;
@ -167,6 +168,11 @@ public class FeedMedia extends FeedFile implements Playable {
}
public void updateFromOther(FeedMedia other) {
// we try to cover two cases: (1) feed did include file before (2) feed contained wrong URL
// if item.getAutoDownload() is false, the file has been downloaded before
if((TextUtils.isEmpty(download_url) || item.getAutoDownload()) && !TextUtils.isEmpty(other.download_url)) {
item.setNew();
}
super.updateFromOther(other);
if (other.size > 0) {
size = other.size;