mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-22 17:11:51 +01:00
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
This commit is contained in:
parent
3463d6c752
commit
10ddeeb799
@ -56,7 +56,6 @@ class LocalSource(private val context: Context) : CatalogueSource {
|
||||
if (cover == null) {
|
||||
cover = File("${dir.absolutePath}/${manga.url}", COVER_NAME)
|
||||
}
|
||||
if (!cover.exists()) {
|
||||
// It might not exist if using the external SD card
|
||||
cover.parentFile?.mkdirs()
|
||||
input.use {
|
||||
@ -64,7 +63,7 @@ class LocalSource(private val context: Context) : CatalogueSource {
|
||||
input.copyTo(it)
|
||||
}
|
||||
}
|
||||
}
|
||||
manga.thumbnail_url = cover.absolutePath
|
||||
return cover
|
||||
}
|
||||
|
||||
|
@ -388,6 +388,8 @@ class MangaPresenter(
|
||||
if (manga.isLocal()) {
|
||||
LocalSource.updateCover(context, manga, it)
|
||||
manga.updateCoverLastModified(db)
|
||||
db.insertManga(manga).executeAsBlocking()
|
||||
coverCache.clearMemoryCache()
|
||||
} else if (manga.favorite) {
|
||||
coverCache.setCustomCoverToCache(manga, it)
|
||||
manga.updateCoverLastModified(db)
|
||||
|
Loading…
Reference in New Issue
Block a user