Use local filtering. Use long class instead of primitives again for database keys (they can be null)

This commit is contained in:
inorichi
2015-12-02 21:45:41 +01:00
parent 6b8ccbe01b
commit ab216a3608
8 changed files with 69 additions and 61 deletions

View File

@@ -10,10 +10,10 @@ import eu.kanade.mangafeed.util.UrlUtil;
public class Chapter {
@StorIOSQLiteColumn(name = ChapterTable.COLUMN_ID, key = true)
public long id;
public Long id;
@StorIOSQLiteColumn(name = ChapterTable.COLUMN_MANGA_ID)
public long manga_id;
public Long manga_id;
@StorIOSQLiteColumn(name = ChapterTable.COLUMN_URL)
public String url;

View File

@@ -10,7 +10,7 @@ import eu.kanade.mangafeed.util.UrlUtil;
public class Manga {
@StorIOSQLiteColumn(name = MangaTable.COLUMN_ID, key = true)
public long id;
public Long id;
@StorIOSQLiteColumn(name = MangaTable.COLUMN_SOURCE)
public int source;

View File

@@ -133,7 +133,7 @@ public class DownloadManager {
private boolean prepareDownload(Download download) {
// If the chapter is already queued, don't add it again
for (Download queuedDownload : queue.get()) {
if (download.chapter.id == queuedDownload.chapter.id)
if (download.chapter.id.equals(queuedDownload.chapter.id))
return true;
}

View File

@@ -31,7 +31,7 @@ public class DownloadQueue {
public void remove(Chapter chapter) {
for (Download download : queue) {
if (download.chapter.id == chapter.id) {
if (download.chapter.id.equals(chapter.id)) {
remove(download);
break;
}