mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-06-30 17:34:39 -05:00
Fixes
This commit is contained in:
@@ -190,7 +190,7 @@ class MangaMutation {
|
||||
Manga.updateMangaAndChapters(
|
||||
mangaId = id,
|
||||
updateManga = fetchManga,
|
||||
updateChapters = fetchChapters
|
||||
updateChapters = fetchChapters,
|
||||
)
|
||||
|
||||
val (manga, chapters) =
|
||||
|
||||
@@ -160,8 +160,9 @@ object Manga {
|
||||
mangaInfoMutex.get(mangaId) { Mutex() }.withLock {
|
||||
var mangaEntry =
|
||||
transaction { MangaTable.selectAll().where { MangaTable.id eq mangaId }.first() }
|
||||
val source = getCatalogueSourceOrNull(mangaEntry[MangaTable.sourceReference])
|
||||
?: throw NullPointerException("Missing source ${mangaEntry[MangaTable.sourceReference]}")
|
||||
val source =
|
||||
getCatalogueSourceOrNull(mangaEntry[MangaTable.sourceReference])
|
||||
?: throw NullPointerException("Missing source ${mangaEntry[MangaTable.sourceReference]}")
|
||||
val mangaUpdate =
|
||||
fetchMangaAndChapters(
|
||||
mangaEntry,
|
||||
@@ -172,9 +173,10 @@ object Manga {
|
||||
|
||||
if (updateManga) {
|
||||
updateMangaDatabase(mangaEntry, source, mangaUpdate.manga)
|
||||
mangaEntry = transaction {
|
||||
MangaTable.selectAll().where { MangaTable.id eq mangaId }.first()
|
||||
}
|
||||
mangaEntry =
|
||||
transaction {
|
||||
MangaTable.selectAll().where { MangaTable.id eq mangaId }.first()
|
||||
}
|
||||
}
|
||||
if (updateChapters) {
|
||||
Chapter.updateChapterListDatabase(mangaEntry, mangaUpdate.chapters, source)
|
||||
|
||||
@@ -121,6 +121,14 @@ fun NetworkExtensionStore.toExtensionInfos(store: ExtensionStore): List<Extensio
|
||||
name = source.name,
|
||||
lang = source.language,
|
||||
homeUrl = source.homeUrl,
|
||||
message = source.message,
|
||||
contentRating =
|
||||
when (source.contentRating) {
|
||||
NetworkExtensionStore.ContentRating.SAFE -> ContentRating.SAFE
|
||||
NetworkExtensionStore.ContentRating.SUGGESTIVE -> ContentRating.SUGGESTIVE
|
||||
NetworkExtensionStore.ContentRating.EROTICA -> ContentRating.EROTICA
|
||||
NetworkExtensionStore.ContentRating.PORNOGRAPHIC -> ContentRating.PORNOGRAPHIC
|
||||
},
|
||||
)
|
||||
},
|
||||
)
|
||||
|
||||
@@ -58,6 +58,8 @@ fun NetworkLegacyExtension.toExtensionInfo(
|
||||
name = name,
|
||||
lang = lang,
|
||||
homeUrl = "",
|
||||
message = null,
|
||||
contentRating = if (nsfw == 1) ContentRating.PORNOGRAPHIC else ContentRating.SAFE,
|
||||
),
|
||||
)
|
||||
} else {
|
||||
@@ -67,6 +69,8 @@ fun NetworkLegacyExtension.toExtensionInfo(
|
||||
name = source.name,
|
||||
lang = source.lang,
|
||||
homeUrl = source.baseUrl,
|
||||
message = null,
|
||||
contentRating = if (nsfw == 1) ContentRating.PORNOGRAPHIC else ContentRating.SAFE,
|
||||
)
|
||||
}
|
||||
},
|
||||
|
||||
@@ -313,7 +313,7 @@ class Updater : IUpdater {
|
||||
logger.info { "Updating ${job.manga}" }
|
||||
Manga.updateMangaAndChapters(
|
||||
job.manga.id,
|
||||
updateManga = serverConfig.updateMangas.value || !job.manga.initialized
|
||||
updateManga = serverConfig.updateMangas.value || !job.manga.initialized,
|
||||
)
|
||||
job.copy(status = JobStatus.COMPLETE)
|
||||
} catch (e: Exception) {
|
||||
|
||||
@@ -26,6 +26,8 @@ data class ExtensionSource(
|
||||
val name: String,
|
||||
val lang: String,
|
||||
val homeUrl: String,
|
||||
val message: String?,
|
||||
val contentRating: ContentRating,
|
||||
)
|
||||
|
||||
enum class ContentRating {
|
||||
|
||||
@@ -66,6 +66,7 @@ fun createChapters(
|
||||
this[ChapterTable.sourceOrder] = it
|
||||
this[ChapterTable.isRead] = read
|
||||
this[ChapterTable.manga] = mangaId
|
||||
this[ChapterTable.memo] = "{}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user