mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-08 13:24:34 -05:00
sync anime lib implementation with 12 (#133)
* sync anime lib implementation with 11 * fix wrong api * delete unused classes * adapt to lib 12 * add LICENSE for eu.kanade.tachiyomi * changes for lib 12 * update to lib 12 * update webUI
This commit is contained in:
@@ -19,6 +19,7 @@ import org.jetbrains.exposed.sql.update
|
||||
import suwayomi.tachidesk.anime.impl.Anime.getAnime
|
||||
import suwayomi.tachidesk.anime.impl.util.GetAnimeHttpSource.getAnimeHttpSource
|
||||
import suwayomi.tachidesk.anime.model.dataclass.EpisodeDataClass
|
||||
import suwayomi.tachidesk.anime.model.dataclass.VideoDataClass
|
||||
import suwayomi.tachidesk.anime.model.table.AnimeTable
|
||||
import suwayomi.tachidesk.anime.model.table.EpisodeTable
|
||||
import suwayomi.tachidesk.anime.model.table.toDataClass
|
||||
@@ -135,7 +136,7 @@ object Episode {
|
||||
|
||||
val animeEntry = transaction { AnimeTable.select { AnimeTable.id eq animeId }.first() }
|
||||
val source = getAnimeHttpSource(animeEntry[AnimeTable.sourceReference])
|
||||
val fetchedLinkUrl = source.fetchEpisodeLink(
|
||||
val fetchedVideos = source.fetchVideoList(
|
||||
SEpisode.create().also {
|
||||
it.url = episode.url
|
||||
it.name = episode.name
|
||||
@@ -154,7 +155,13 @@ object Episode {
|
||||
episode.lastPageRead,
|
||||
episode.index,
|
||||
episode.episodeCount,
|
||||
fetchedLinkUrl
|
||||
fetchedVideos.map {
|
||||
VideoDataClass(
|
||||
it.url,
|
||||
it.quality,
|
||||
it.videoUrl,
|
||||
)
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -41,8 +41,8 @@ object PackageTools {
|
||||
const val METADATA_SOURCE_CLASS = "tachiyomi.animeextension.class"
|
||||
const val METADATA_SOURCE_FACTORY = "tachiyomi.animeextension.factory"
|
||||
const val METADATA_NSFW = "tachiyomi.animeextension.nsfw"
|
||||
const val LIB_VERSION_MIN = 10
|
||||
const val LIB_VERSION_MAX = 10
|
||||
const val LIB_VERSION_MIN = 12
|
||||
const val LIB_VERSION_MAX = 12
|
||||
|
||||
private const val officialSignature = "50ab1d1e3a20d204d0ad6d334c7691c632e41b98dfa132bf385695fdfa63839c" // jmir1's key
|
||||
var trustedSignatures = mutableSetOf<String>() + officialSignature
|
||||
|
||||
@@ -31,5 +31,5 @@ data class EpisodeDataClass(
|
||||
val episodeCount: Int? = null,
|
||||
|
||||
/** used to construct pages in the front-end */
|
||||
val linkUrl: String? = null,
|
||||
val videos: List<VideoDataClass>? = null,
|
||||
)
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package suwayomi.tachidesk.anime.model.dataclass
|
||||
|
||||
/*
|
||||
* Copyright (C) Contributors to the Suwayomi project
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
data class VideoDataClass(
|
||||
val url: String,
|
||||
val quality: String,
|
||||
var videoUrl: String?,
|
||||
)
|
||||
@@ -68,7 +68,7 @@ object MangaAPI {
|
||||
|
||||
patch(":mangaId/chapter/:chapterIndex/meta", MangaController::chapterMeta)
|
||||
|
||||
get(":mangaId/chapter/:chapterIndex/page/:index", MangaController::chapterList)
|
||||
get(":mangaId/chapter/:chapterIndex/page/:index", MangaController::pageRetrieve)
|
||||
}
|
||||
|
||||
path("") {
|
||||
|
||||
Reference in New Issue
Block a user