From 5029e4a28c97b3d8fda1c9cf7f6cb1d1ba647e71 Mon Sep 17 00:00:00 2001 From: len Date: Sun, 3 Apr 2016 18:47:56 +0200 Subject: [PATCH] Fix a bug when opening a chapter from the recents tab and changing the viewer from the reader would not update chapters for that manga anymore --- .../main/java/eu/kanade/tachiyomi/data/database/RawQueries.kt | 2 +- .../data/database/resolvers/MangaChapterGetResolver.kt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/database/RawQueries.kt b/app/src/main/java/eu/kanade/tachiyomi/data/database/RawQueries.kt index e61b20679..a72dce1ab 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/database/RawQueries.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/database/RawQueries.kt @@ -36,7 +36,7 @@ val libraryQuery = * @param date the delimiting date. */ fun getRecentsQuery(date: Date): String = - "SELECT * FROM ${Manga.TABLE} JOIN ${Chapter.TABLE} " + + "SELECT ${Manga.TABLE}.${Manga.COLUMN_URL} as mangaUrl, * FROM ${Manga.TABLE} JOIN ${Chapter.TABLE} " + "ON ${Manga.TABLE}.${Manga.COLUMN_ID} = ${Chapter.TABLE}.${Chapter.COLUMN_MANGA_ID} " + "WHERE ${Manga.COLUMN_FAVORITE} = 1 AND ${Chapter.COLUMN_DATE_UPLOAD} > ${date.time} " + "ORDER BY ${Chapter.COLUMN_DATE_UPLOAD} DESC" diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/database/resolvers/MangaChapterGetResolver.kt b/app/src/main/java/eu/kanade/tachiyomi/data/database/resolvers/MangaChapterGetResolver.kt index e057c6a44..880372f7c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/database/resolvers/MangaChapterGetResolver.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/database/resolvers/MangaChapterGetResolver.kt @@ -20,6 +20,7 @@ class MangaChapterGetResolver : DefaultGetResolver() { val manga = mangaGetResolver.mapFromCursor(cursor) val chapter = chapterGetResolver.mapFromCursor(cursor) manga.id = chapter.manga_id + manga.url = cursor.getString(cursor.getColumnIndex("mangaUrl")); return MangaChapter(manga, chapter) }