Refactoring OPDS API for a more versatile root, allowing selection of manga listing by: all, source, genre, category, language, status. (#1262)

* Añadiendo algunos cambios iniciales para probar OPDS

* Add suport to OPDS v1.2

* Added support for OPDS-PSE and reorganized controllers

* Rename chapterIndex to chapterId in the API and controller, and update descriptions in OPDS

* Refactor OPDS to use formatted timestamps and proxy thumbnail URLs

* Refactor OPDS to use formatted timestamps and proxy thumbnail URLs

* Update Manga API to download chapters cbz using only chapterId and improve chapter download query

* Optimize OPDS queries

* Update Manga API to download chapters cbz using only chapterId and improve chapter download query

* Optimize OPDS queries

* Use SourceDataClass to map sources and optimize thumbnail URL retrieval

* Kotlin lint errors in ChapterDownloadHelper and Opds

* Kotlin lint errors in ChapterDownloadHelper and Opds

* Refactor OPDS API endpoints and rename OpdsController to OpdsV1Controller

* Translate OpdsV1Controller comments to English and remove unused imports

* Translate comments in OpdsAPI.kt to English

* Add SearchCriteria class and update OpdsV1Controller

* Remove spanish comments

* Refactor search handling in OpdsV1Controller and update search feed endpoint

* Fix search
This commit is contained in:
Zeedif
2025-02-09 15:03:18 -06:00
committed by GitHub
parent 01c37cb0ba
commit c2f7cdd72e
6 changed files with 1248 additions and 221 deletions

View File

@@ -1,22 +1,53 @@
package suwayomi.tachidesk.opds
/*
* 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/. */
import io.javalin.apibuilder.ApiBuilder.get
import io.javalin.apibuilder.ApiBuilder.path
import suwayomi.tachidesk.opds.controller.OpdsController
import suwayomi.tachidesk.opds.controller.OpdsV1Controller
object OpdsAPI {
fun defineEndpoints() {
path("opds/v1.2") {
get(OpdsController.rootFeed)
get("source/{sourceId}", OpdsController.sourceFeed)
get("manga/{mangaId}", OpdsController.mangaFeed)
// Root feed (Navigation Feed)
get(OpdsV1Controller.rootFeed)
// Search Description
get("search", OpdsV1Controller.searchFeed)
// Complete feed for crawlers
// get("complete", OpdsV1Controller.completeFeed)
// Main groupings
get("mangas", OpdsV1Controller.mangasFeed)
get("sources", OpdsV1Controller.sourcesFeed)
get("categories", OpdsV1Controller.categoriesFeed)
get("genres", OpdsV1Controller.genresFeed)
get("status", OpdsV1Controller.statusFeed)
get("languages", OpdsV1Controller.languagesFeed)
// Faceted feeds (Acquisition Feeds)
path("manga/{mangaId}") {
get(OpdsV1Controller.mangaFeed)
}
path("source/{sourceId}") {
get(OpdsV1Controller.sourceFeed)
}
path("category/{categoryId}") {
get(OpdsV1Controller.categoryFeed)
}
path("genre/{genre}") {
get(OpdsV1Controller.genreFeed)
}
path("status/{statusId}") {
get(OpdsV1Controller.statusMangaFeed)
}
path("language/{langCode}") {
get(OpdsV1Controller.languageFeed)
}
}
}
}