diff options
author | Martin Fietz <Martin.Fietz@gmail.com> | 2016-01-30 16:19:27 +0100 |
---|---|---|
committer | Martin Fietz <Martin.Fietz@gmail.com> | 2016-01-30 18:30:48 +0100 |
commit | 23b56542e0e151e3a624e8122c466f690823c7f1 (patch) | |
tree | adb9fbc81ac8eebe6c496711bf05624ce3b6120d | |
parent | 8b486e22d2483c0b6957dcc7302aab53ac1a0541 (diff) | |
download | AntennaPod-23b56542e0e151e3a624e8122c466f690823c7f1.zip |
Migrate database
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/service/download/HttpDownloader.java | 2 | ||||
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/service/download/HttpDownloader.java b/core/src/main/java/de/danoeh/antennapod/core/service/download/HttpDownloader.java index 0f083f659..e3a195253 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/service/download/HttpDownloader.java +++ b/core/src/main/java/de/danoeh/antennapod/core/service/download/HttpDownloader.java @@ -67,7 +67,7 @@ public class HttpDownloader extends Downloader { final URI uri = URIUtil.getURIFromRequestUrl(request.getSource()); Request.Builder httpReq = new Request.Builder().url(uri.toURL()) .header("User-Agent", ClientConfig.USER_AGENT); - if(request.getLastModified() != null) { + if(!TextUtils.isEmpty(request.getLastModified())) { String lastModified = request.getLastModified(); Date lastModifiedDate = DateUtils.parse(lastModified); if(lastModifiedDate != null) { diff --git a/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java b/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java index 9901bead0..0cceebd6f 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java +++ b/core/src/main/java/de/danoeh/antennapod/core/storage/PodDBAdapter.java @@ -1512,7 +1512,7 @@ public class PodDBAdapter { */ private static class PodDBHelper extends SQLiteOpenHelper { - private final static int VERSION = 1050003; + private final static int VERSION = 1050004; private Context context; @@ -1756,7 +1756,6 @@ public class PodDBAdapter { db.execSQL(PodDBAdapter.CREATE_INDEX_FEEDITEMS_PUBDATE); db.execSQL(PodDBAdapter.CREATE_INDEX_FEEDITEMS_READ); } - if (oldVersion < 1050003) { // Migrates feed list filter data @@ -1804,6 +1803,11 @@ public class PodDBAdapter { db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS + " ADD COLUMN " + PodDBAdapter.KEY_KEEP_UPDATED + " INTEGER DEFAULT 1"); } + if (oldVersion < 1050004) { + // prevent old timestamps to be misinterpreted as ETags + db.execSQL("UPDATE " + PodDBAdapter.TABLE_NAME_FEEDS + +" SET " + PodDBAdapter.KEY_LASTUPDATE + "=NULL"); + } EventBus.getDefault().post(ProgressEvent.end()); } |