Fix local source cover changing (#6252)
* fix local source cover changing * Remove unnecessary check for `exists()` * fix for when there is no thumbnail_url in the db (cherry picked from commit 10ddeeb7999214f1ed2fa579dadab7e9e379c1a6)
This commit is contained in:
parent
8ad6e89ca6
commit
b2b5854910
@ -54,7 +54,6 @@ class LocalSource(private val context: Context) : CatalogueSource {
|
|||||||
if (cover == null) {
|
if (cover == null) {
|
||||||
cover = File("${dir.absolutePath}/${manga.url}", COVER_NAME)
|
cover = File("${dir.absolutePath}/${manga.url}", COVER_NAME)
|
||||||
}
|
}
|
||||||
if (!cover.exists()) {
|
|
||||||
// It might not exist if using the external SD card
|
// It might not exist if using the external SD card
|
||||||
cover.parentFile?.mkdirs()
|
cover.parentFile?.mkdirs()
|
||||||
input.use {
|
input.use {
|
||||||
@ -62,7 +61,7 @@ class LocalSource(private val context: Context) : CatalogueSource {
|
|||||||
input.copyTo(it)
|
input.copyTo(it)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
manga.thumbnail_url = cover.absolutePath
|
||||||
return cover
|
return cover
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -719,6 +719,8 @@ class MangaPresenter(
|
|||||||
if (manga.isLocal()) {
|
if (manga.isLocal()) {
|
||||||
LocalSource.updateCover(context, manga, it)
|
LocalSource.updateCover(context, manga, it)
|
||||||
manga.updateCoverLastModified(db)
|
manga.updateCoverLastModified(db)
|
||||||
|
db.insertManga(manga).executeAsBlocking()
|
||||||
|
coverCache.clearMemoryCache()
|
||||||
} else if (manga.favorite) {
|
} else if (manga.favorite) {
|
||||||
coverCache.setCustomCoverToCache(manga, it)
|
coverCache.setCustomCoverToCache(manga, it)
|
||||||
manga.updateCoverLastModified(db)
|
manga.updateCoverLastModified(db)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user