diff --git a/server/src/main/kotlin/suwayomi/tachidesk/graphql/mutations/MangaMutation.kt b/server/src/main/kotlin/suwayomi/tachidesk/graphql/mutations/MangaMutation.kt index c970495bb..23573571b 100644 --- a/server/src/main/kotlin/suwayomi/tachidesk/graphql/mutations/MangaMutation.kt +++ b/server/src/main/kotlin/suwayomi/tachidesk/graphql/mutations/MangaMutation.kt @@ -190,7 +190,7 @@ class MangaMutation { Manga.updateMangaAndChapters( mangaId = id, updateManga = fetchManga, - updateChapters = fetchChapters + updateChapters = fetchChapters, ) val (manga, chapters) = diff --git a/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/Manga.kt b/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/Manga.kt index 5d9fcf055..9d31f7fa2 100644 --- a/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/Manga.kt +++ b/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/Manga.kt @@ -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) diff --git a/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/extension/github/NetworkExtensionStore.kt b/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/extension/github/NetworkExtensionStore.kt index 8c5aba3ec..657b331cd 100644 --- a/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/extension/github/NetworkExtensionStore.kt +++ b/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/extension/github/NetworkExtensionStore.kt @@ -121,6 +121,14 @@ fun NetworkExtensionStore.toExtensionInfos(store: ExtensionStore): List ContentRating.SAFE + NetworkExtensionStore.ContentRating.SUGGESTIVE -> ContentRating.SUGGESTIVE + NetworkExtensionStore.ContentRating.EROTICA -> ContentRating.EROTICA + NetworkExtensionStore.ContentRating.PORNOGRAPHIC -> ContentRating.PORNOGRAPHIC + }, ) }, ) diff --git a/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/extension/github/NetworkLegacyExtension.kt b/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/extension/github/NetworkLegacyExtension.kt index 0a4807452..894b95984 100644 --- a/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/extension/github/NetworkLegacyExtension.kt +++ b/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/extension/github/NetworkLegacyExtension.kt @@ -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, ) } }, diff --git a/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/update/Updater.kt b/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/update/Updater.kt index c0b98942b..64156bdb8 100644 --- a/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/update/Updater.kt +++ b/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/update/Updater.kt @@ -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) { diff --git a/server/src/main/kotlin/suwayomi/tachidesk/manga/model/dataclass/ExtensionInfo.kt b/server/src/main/kotlin/suwayomi/tachidesk/manga/model/dataclass/ExtensionInfo.kt index 357f2de6d..ac09e2cac 100644 --- a/server/src/main/kotlin/suwayomi/tachidesk/manga/model/dataclass/ExtensionInfo.kt +++ b/server/src/main/kotlin/suwayomi/tachidesk/manga/model/dataclass/ExtensionInfo.kt @@ -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 { diff --git a/server/src/test/kotlin/suwayomi/tachidesk/test/TestUtils.kt b/server/src/test/kotlin/suwayomi/tachidesk/test/TestUtils.kt index de9a0c064..b04724c8b 100644 --- a/server/src/test/kotlin/suwayomi/tachidesk/test/TestUtils.kt +++ b/server/src/test/kotlin/suwayomi/tachidesk/test/TestUtils.kt @@ -66,6 +66,7 @@ fun createChapters( this[ChapterTable.sourceOrder] = it this[ChapterTable.isRead] = read this[ChapterTable.manga] = mangaId + this[ChapterTable.memo] = "{}" } } }