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