Fixes to notifactions icons and loading reader

pull/2497/head
Jay 5 years ago
parent 24d2245972
commit f63db1cc2c

@ -52,6 +52,14 @@ interface ChapterQueries : DbProvider {
.build())
.prepare()
fun getChapter(url: String, mangaId: Long) = db.get()
.`object`(Chapter::class.java)
.withQuery(Query.builder()
.table(ChapterTable.TABLE)
.where("${ChapterTable.COL_URL} = ? AND ${ChapterTable.COL_MANGA_ID} = ?")
.whereArgs(url, mangaId)
.build())
.prepare()
fun insertChapter(chapter: Chapter) = db.put().`object`(chapter).prepare()

@ -456,7 +456,8 @@ class LibraryUpdateService(
setSmallIcon(R.drawable.ic_book_white_24dp)
try {
val icon = GlideApp.with(this@LibraryUpdateService)
.asBitmap().load(manga).centerCrop().circleCrop().submit().get()
.asBitmap().load(manga).dontTransform().centerCrop().circleCrop()
.override(256, 256).submit().get()
setLargeIcon(icon)
}
catch (e: Exception) { }

@ -153,7 +153,7 @@ class ReaderActivity : BaseRxActivity<ReaderPresenter>(),
return
}
if (chapterUrl.isEmpty()) presenter.init(manga, chapter)
if (chapter > -1) presenter.init(manga, chapter)
else presenter.init(manga, chapterUrl)
}

@ -189,7 +189,7 @@ class ReaderPresenter(
if (!needsInit()) return
val context = Injekt.get<Application>()
val db = DatabaseHelper(context)
val chapterId = db.getChapter(chapterUrl).executeAsBlocking()?.id
val chapterId = db.getChapter(chapterUrl, mangaId).executeAsBlocking()?.id
if (chapterId != null)
init(mangaId, chapterId)
}

Loading…
Cancel
Save