mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-02 02:14:36 -05:00
Extension API 1.6 (#2120)
* Non-Extension Index changes for 1.6 * Changelog * Minor fixes * Implement extension store * Test build fix * Docs * Simplify fetching manga and chapters * Use EMPTY JsonObject * Update docs/Configuring-Suwayomi‐Server.md Co-authored-by: Constantin Piber <59023762+cpiber@users.noreply.github.com> * Improve Fetch Extension Store * Fixes * Simplify deprecated isNsfw in SourceQuery * Simplify ContentRating in Source.kt * Simplify isNsfw in SourceType * No magic numbers for ContentRating, improves safety for future versions of extension api * Fix SearchTest * Lint * Lint * Optimize imports and fix unchecked cast warning * Proper extension store queries * Optimize import fixes * Add ContentRatingFilter * Improve extension store sync * fix: re-sync (#2121) * Lint * Add ExtenionStores to the fetchExtensions result since its possible for the stores to change. * Use a single version of ContentRating * Exclude ServerConfig.extensionStores from GraphQL * Use syncDbToPrefs in ExtensionStoreMutation * Optimize Imports * Update server/server-config/src/main/kotlin/suwayomi/tachidesk/server/ServerConfig.kt Co-authored-by: Constantin Piber <59023762+cpiber@users.noreply.github.com> * Remove replaceWith and add specific description for GQL APIs * Include OkHttp ZSTD * Update to latest Mihon extension lib * Fix latest Mihon Extension Lib * Lint * Optimize imports * Lint * Review fixes * Add a index to extesnion table store url * Lint --------- Co-authored-by: Constantin Piber <59023762+cpiber@users.noreply.github.com>
This commit is contained in:
@@ -276,30 +276,38 @@ class ServerConfig(
|
||||
description = "Ignore re-uploaded chapters from auto-download",
|
||||
)
|
||||
|
||||
val extensionRepos: MutableStateFlow<List<String>> by ListSetting<String>(
|
||||
@Deprecated("Will get removed", replaceWith = ReplaceWith("extensionStores"))
|
||||
val extensionRepos: MutableStateFlow<List<String>> by MigratedConfigValue(
|
||||
protoNumber = 22,
|
||||
group = SettingGroup.EXTENSION,
|
||||
privacySafe = false,
|
||||
defaultValue = emptyList(),
|
||||
itemValidator = { url ->
|
||||
if (url.matches(repoMatchRegex)) {
|
||||
null
|
||||
} else {
|
||||
"Invalid repository URL format"
|
||||
}
|
||||
},
|
||||
itemToValidValue = { url ->
|
||||
if (url.matches(repoMatchRegex)) {
|
||||
url
|
||||
} else {
|
||||
null
|
||||
}
|
||||
},
|
||||
deprecated =
|
||||
SettingsRegistry.SettingDeprecated(
|
||||
message = "Replaced with addExtensionStore and removeExtensionStore mutations",
|
||||
migrateConfigValue = {
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
(it.unwrapped() as? List<String>)
|
||||
?.map {
|
||||
if (it.contains("github.com")) {
|
||||
it.replace(repoMatchRegex) {
|
||||
"https://raw.githubusercontent.com/${it.groupValues[2]}/${it.groupValues[3]}/" +
|
||||
(it.groupValues.getOrNull(4)?.ifBlank { null } ?: "repo") +
|
||||
"/" +
|
||||
(it.groupValues.getOrNull(5)?.ifBlank { null } ?: "index.min.json")
|
||||
}
|
||||
} else {
|
||||
it
|
||||
}
|
||||
}
|
||||
},
|
||||
),
|
||||
readMigrated = { extensionStores.value },
|
||||
setMigrated = { extensionStores.value = it.distinct() },
|
||||
typeInfo =
|
||||
SettingsRegistry.PartialTypeInfo(
|
||||
specificType = "List<String>",
|
||||
),
|
||||
description = "example: [\"https://github.com/MY_ACCOUNT/MY_REPO/tree/repo\"]",
|
||||
)
|
||||
|
||||
val maxSourcesInParallel: MutableStateFlow<Int> by IntSetting(
|
||||
@@ -1104,7 +1112,29 @@ class ServerConfig(
|
||||
privacySafe = true,
|
||||
defaultValue = false,
|
||||
description = "Skips the metadata feed and provides download/stream links directly in the chapter list. Improves compatibility with KOReader auto-downloader. KoSync strategies are applied, but PROMPT conflicts are ignored (treating local progress as priority)."
|
||||
)
|
||||
|
||||
val extensionStores: MutableStateFlow<List<String>> by ListSetting<String>(
|
||||
protoNumber = 97,
|
||||
group = SettingGroup.EXTENSION,
|
||||
privacySafe = true,
|
||||
defaultValue = emptyList(),
|
||||
requiresRestart = true,
|
||||
itemValidator = { url ->
|
||||
if (url.isNotEmpty()) {
|
||||
null
|
||||
} else {
|
||||
"Invalid store URL format"
|
||||
}
|
||||
},
|
||||
itemToValidValue = { url ->
|
||||
url.ifEmpty { null }
|
||||
},
|
||||
typeInfo =
|
||||
SettingsRegistry.PartialTypeInfo(
|
||||
specificType = "List<String>",
|
||||
),
|
||||
description = "List of extension store index URLs",
|
||||
)
|
||||
|
||||
/** ****************************************************************** **/
|
||||
|
||||
Reference in New Issue
Block a user