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

This commit is contained in:
len 2016-04-03 18:47:56 +02:00
parent 908e60dea4
commit 5029e4a28c
2 changed files with 2 additions and 1 deletions

View file

@ -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"

View file

@ -20,6 +20,7 @@ class MangaChapterGetResolver : DefaultGetResolver<MangaChapter>() {
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)
}