Fix error when updating manga details with uninitialized title (#8045)
(cherry picked from commit 2ced56e490ecd175b9575eda6514a933f2893a72) # Conflicts: # app/src/main/java/eu/kanade/domain/manga/interactor/UpdateManga.kt
This commit is contained in:
parent
bdc45fb8aa
commit
7e7692c3cf
@ -34,10 +34,16 @@ class UpdateManga(
|
||||
downloadManager: DownloadManager = Injekt.get(),
|
||||
// SY <--
|
||||
): Boolean {
|
||||
// SY -->
|
||||
val title = if (remoteManga.title.isNotBlank() && localManga.ogTitle != remoteManga.title) {
|
||||
downloadManager.renameMangaDir(localManga.ogTitle, remoteManga.title, localManga.source)
|
||||
val remoteTitle = try {
|
||||
remoteManga.title
|
||||
} catch (_: UninitializedPropertyAccessException) {
|
||||
""
|
||||
}
|
||||
|
||||
// SY -->
|
||||
val title = if (remoteTitle.isNotBlank() && localManga.ogTitle != remoteTitle) {
|
||||
downloadManager.renameMangaDir(localManga.ogTitle, remoteTitle, localManga.source)
|
||||
remoteTitle
|
||||
} else {
|
||||
null
|
||||
}
|
||||
@ -59,16 +65,18 @@ class UpdateManga(
|
||||
}
|
||||
}
|
||||
|
||||
val thumbnailUrl = remoteManga.thumbnail_url?.takeIf { it.isNotEmpty() }
|
||||
|
||||
return mangaRepository.update(
|
||||
MangaUpdate(
|
||||
id = localManga.id,
|
||||
title = title?.takeIf { it.isNotEmpty() },
|
||||
title = title,
|
||||
coverLastModified = coverLastModified,
|
||||
author = remoteManga.author,
|
||||
artist = remoteManga.artist,
|
||||
description = remoteManga.description,
|
||||
genre = remoteManga.getGenres(),
|
||||
thumbnailUrl = remoteManga.thumbnail_url?.takeIf { it.isNotEmpty() },
|
||||
thumbnailUrl = thumbnailUrl,
|
||||
status = remoteManga.status.toLong(),
|
||||
initialized = true,
|
||||
),
|
||||
|
Loading…
x
Reference in New Issue
Block a user