doesnt build. Dont want to fix it
CI / Prepare job (push) Successful in 3s Details
CI / Build multisrc modules (push) Successful in 2m34s Details
CI / Build individual modules (push) Successful in 38s Details
CI / Publish repo (push) Successful in 2m14s Details

This commit is contained in:
Draff 2024-01-22 23:53:22 +00:00
parent 9c512ea3ac
commit 152405613e
23 changed files with 0 additions and 2208 deletions

View File

@ -1,2 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest />

View File

@ -1,93 +0,0 @@
## 1.3.13
### Fixed
* Fixed 'null cannot be cast to non-null type' exception
## 1.3.12
### Features
* Migrate filters to v2
* Implemented smartFilters
* Added localization support
### Fixed
* Fixed publication status not showing
## 1.3.10
### Features
* API Change for Kavita v0.7.2
## 1.3.9
### Features
* Added pdf support
## 1.3.8
### Fix
* Fixed `Expected URL scheme 'http' or 'https` when downloading
## 1.3.7
### Features
* New Sort filter: Time to read
* New Filter: Year release filter
### Fix
* Filters can now be used together with search
* Epub and pdfs no longer show in format filter (currently not supported)
## 1.3.6
### Fix
* Fixed "lateinit property title not initialized"
## 1.3.5
### Features
* Ignore DOH
* Added sort option `Item Added`
* Latest button now shows latest `Item Added`
## 1.3.4
### Features
* Exclude from bulk update warnings
## 1.2.3
### Fix
* Fixed Rating filter
* Fixed Chapter list not sorting correctly
* Fixed search
* Fixed manga details not showing correctly
* Fixed filters not populating if account was not admin
### Features
* The extension is now ready to implement tracking.
* Min required version for the extension to work properly: `v0.5.1.1`
## 1.2.2
### Features
* Add `CHANGELOG.md` & `README.md`
## 1.2.1
### Features
* first version

View File

@ -1,37 +0,0 @@
# Kavita
Table of Content
- [FAQ](#FAQ)
- [Why do I see no manga?](#why-do-i-see-no-manga)
- [Where can I get more information about Kavita?](#where-can-i-get-more-information-about-kavita)
- [The Kavita extension stopped working?](#the-kavita-extension-stopped-working)
- [Can I add more than one Kavita server or user?](#can-i-add-more-than-one-kavita-server-or-user)
- [Can I test the Kavita extension before setting up my own server?](#can-i-test-the-kavita-extension-before-setting-up-my-own-server)
- [Guides](#Guides)
- [How do I add my Kavita server to Tachiyomi?](#how-do-i-add-my-kavita-server-to-tachiyomi)
Don't find the question you are look for go check out our general FAQs and Guides over at [Extension FAQ](https://tachiyomi.org/help/faq/#extensions) or [Getting Started](https://tachiyomi.org/help/guides/getting-started/#installation)
Kavita also has a documentation about the Tachiyomi Kavita extension at the [Kavita wiki](https://wiki.kavitareader.com/en/guides/misc/tachiyomi).
## FAQ
### Why do I see no manga?
Kavita is a self-hosted comic/manga media server.
### Where can I get more information about Kavita?
You can visit the [Kavita](https://www.kavitareader.com/) website for for more information.
### The Kavita extension stopped working?
Make sure that your Kavita server and extension are on the newest version.
### Can I add more than one Kavita server or user?
Yes, currently you can add up to 3 different Kavita instances to Tachiyomi.
### Can I test the Kavita extension before setting up my own server?
Yes, you can try it out with the DEMO servers OPDS url `https://demo.kavitareader.com/api/opds/aca1c50d-7e08-4f37-b356-aecd6bf69b72`.
## Guides
### How do I add my Kavita server to Tachiyomi?
Go into the settings of the Kavita extension from the Extension tab in Browse and fill in your OPDS url.

View File

@ -1,18 +0,0 @@
login_errors_failed_login=Login failed. Something went wrong
login_errors_header_token_empty="Error: The JSON Web Token is empty.\nTry opening the extension first."
login_errors_invalid_url=Invalid URL:
login_errors_parse_tokendto=There was an error parsing the auth token
pref_customsource_title=Displayed name for source
pref_edit_customsource_summary=Here you can change this source name.\nYou can write a descriptive name to identify this OPDS URL.
pref_filters_summary=Show these filters in the filter list
pref_filters_title=Default filters shown
pref_opds_badformed_url=Incorrect OPDS address. Please copy it from User settings \u2192 3rd party apps \u2192 OPDS URL
pref_opds_duplicated_source_url=The URL is configured in a different source ->
pref_opds_must_setup_address=You must set up the address to communicate with Kavita
pref_opds_summary=The OPDS URL copied from User Settings. This should include address and end with the API key.
restartapp_settings=Restart Tachiyomi to apply new setting.
version_exceptions_chapters_parse=Unhandled exception parsing chapters. Send your logs to the Kavita devs.
check_version=Ensure you have the newest version of the extension and Kavita. (0.7.8 or newer.)\nIf the issue persists, report it to the Kavita developers with the accompanying logs.
version_exceptions_smart_filter=Could not decode SmartFilter. Ensure you are using Kavita version 0.7.11 or later.
http_errors_500=Something went wrong
http_errors_401=There was an error logging in. Try again or reload the app

View File

@ -1,18 +0,0 @@
pref_customsource_title=Nombre de la instancia
pref_edit_customsource_summary=Aqui puedes cambiar el nombre de la instancia.\nPuedes escribir un nombre descriptivo que identifique esta url/instancia
restartapp_settings=Reinicia la aplicación para aplicar los cambios
version_exceptions_chapters_parse=Algo ha ido mal al procesar los capitulos. Envia los registros de fallo a los desarrolladores de Kavita
check_version=Comprueba que tienes tanto Kavita como la extension actualizada. (Version minima: 0.7.8)\nSi el problema persiste, reportalo a los desarrolladores de Kavita aportando los registros de fallo.
version_exceptions_smart_filter=Fallo al decodificar los filtros inteligentes. Aseg\u00FArate que estas al menos en la version 0.7.11 de Kavita
http_errors_500=Algo ha ido mal
http_errors_401=Ha habido un error al iniciar sesi\u00F3n. Prueba otra vez o reinicia la aplicaci\u00F3n
pref_opds_summary=La url del OPDS copiada de la configuraci\u00F3n del usuario. Debe incluir la direcci\u00F3n y la clave api al final.
pref_filters_summary=Mostrar estos filtros en la lista de filtros
pref_filters_title=Filtros por defecto
pref_opds_badformed_url=La direcci\u00F3n OPDS no es correcta. Por favor, c\u00F3piela desde la Configuraci\u00F3n de usuario-> aplicaciones de terceros -> url de OPDS
login_errors_parse_tokendto=Se ha producido un error al procesar el token de autenticaci\u00F3n
pref_opds_duplicated_source_url=Url est\u00E1 configurado en una fuente diferente ->
pref_opds_must_setup_address=Debe configurar la direcci\u00F3n para comunicarse con Kavita
login_errors_failed_login=Error en el inicio de sesi\u00F3n. Algo ha ido mal
login_errors_header_token_empty="Error: el token jwt est\u00E1 vac\u00EDo.\nIntente abrir primero la extensi\u00F3n"
login_errors_invalid_url=URL no v\u00E1lida:

View File

@ -1,20 +0,0 @@
version_exceptions_chapters_parse=Exception non trait\u00E9e durant l'analyse des chapitres. Envoyez les journaux aux d\u00E9velopeurs de Kavita
pref_customsource_title=Nom d'affichage pour la source
version_exceptions_smart_filter=\u00C9chec du d\u00E9codage de SmartFilter. Assurez-vous que vous utilisez au moins Kavita version 0.7.11
pref_opds_summary=L'URL OPDS a \u00E9t\u00E9 copi\u00E9e \u00E0 partir des param\u00E8tres de l'utilisateur. Ceci devrait inclure l'adresse et la cl\u00E9 API.
pref_filters_summary=Afficher ces filtres dans la liste des filtres
check_version=Assurez-vous que vous avez l'extension et Kavita mises \u00E0 jour. (version Mini\u202F: 0.7.8)\nSi le probl\u00E8me persiste, signalez-le aux d\u00E9veloppeurs de Kavita en fournissant des journaux
pref_filters_title=Filtres par d\u00E9faut affich\u00E9s
pref_edit_customsource_summary=Ici vous pouvez changer ce nom source.\nVous pouvez \u00E9crire un nom descriptif pour identifier cette URL opds
pref_opds_badformed_url=L'adresse OPDS n'est pas correcte. Veuillez la copiez \u00E0 partir des param\u00E8tres de l'utilisateur - > Applis tierces -> URL OPDS
login_errors_parse_tokendto=Il y a eu une erreur pendant l'analyse du jeton d'authentification
restartapp_settings=Red\u00E9marrez Tachiyomi pour appliquer le nouveau r\u00E9glage.
pref_opds_duplicated_source_url=L'URL est configur\u00E9e dans une autre source ->
pref_opds_must_setup_address=Vous devez configurer l'adresse pour communiquer avec Kavita
login_errors_failed_login=\u00C9chec de la connexion. Quelque chose s'est mal pass\u00E9
http_errors_500=Quelque chose s'est mal pass\u00E9
login_errors_header_token_empty=\u00AB\u00A0Erreur\u202F: le jeton jwt est vide.\nEssayez d'abord d'ouvrir l'extension\u00A0\u00BB
login_errors_invalid_url=URL invalide\u202F:
http_errors_401=Il y a eu une erreur. Essayez de nouveau ou rechargez l'application

View File

@ -1,21 +0,0 @@
pref_customsource_title=Vist kildenavn
pref_edit_customsource_summary=Her kan du endre dette kildenavnet.\nDu kan skrive et beskrivende navn for \u00E5 identifisere denne OPDS-nettadressen.
restartapp_settings=Ny innstilling trer i kraft n\u00E5r du starter Tachiyomi p\u00E5 ny.
duplicated_source_url=Nettadressen er satt opp i en annen Kavita-instans
pref_filters_summary=Vis disse filterne i filterlisten
pref_filters_title=Forvalgte filtre valgt
login_errors_parse_tokendto=Kunne ikke tolke identifiseringssymbolet
login_errors_failed_login=Innlogging mislyktes. Noe gikk galt.
http_errors_500=Noe gikk galt
login_errors_header_token_empty="Feil: JSON-nettsymbol er tomt.\nPr\u00F8v \u00E5 \u00E5pne utvidelsen f\u00F8rst."
login_errors_invalid_url=Ugyldig nettadresse:
version_exceptions_chapters_parse=Uh\u00E5ndtert unntak i tolking av kapitler. Send loggene dine til Kavita-utviklerne.
version_exceptions_smart_filter=Kunne ikke dekode smartfilter. Forsikre deg om at du bruker Kavita versjon 0.7.11 eller nyere.
pref_opds_summary=OPDS-nettadressen kopiert fra brukerinnstillingene. Denne skal inkludere med adressen og slutte med API-n\u00F8kkelen.
check_version=Forsikre deg om at b\u00E5de utvidelsen og Kavita er av nyeste versjon. (Ihvertfall 0.7.8)\nHvis problemet vedvarer kan du rapportere det til Kavita-utviklerne med tilh\u00F8rende loggf\u00F8ring.
pref_opds_badformed_url=OPDS-adressen er ikke riktig. Kopier den fra brukerinnstillinger -> tredjepartsprogrammer -> OPDS-nettadresse
pref_opds_duplicated_source_url=Nettadressen er satt opp i en annen instans ->
pref_opds_must_setup_address=Du m\u00E5 sette opp adressen som skal kommunisere med Kavita
http_errors_401=Feil med innlogging. Pr\u00F8v \u00E5 laste inn p\u00E5 ny, eller start programmet p\u00E5 ny.

View File

@ -1,12 +0,0 @@
ext {
extName = 'Kavita'
extClass = '.KavitaFactory'
extVersionCode = 13
}
dependencies {
implementation 'info.debatty:java-string-similarity:2.0.0'
implementation(project(':lib:i18n'))
}
apply from: "$rootDir/common.gradle"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

View File

@ -1,112 +0,0 @@
package eu.kanade.tachiyomi.extension.all.kavita
import eu.kanade.tachiyomi.extension.all.kavita.KavitaConstants.noSmartFilterSelected
import eu.kanade.tachiyomi.source.model.Filter
class UserRating :
Filter.Select<String>(
"Minimum Rating",
arrayOf(
"Any",
"1 star",
"2 stars",
"3 stars",
"4 stars",
"5 stars",
),
)
class SmartFiltersFilter(smartFilters: Array<String>) :
Filter.Select<String>("Smart Filters", arrayOf(noSmartFilterSelected) + smartFilters)
class SortFilter(sortables: Array<String>) : Filter.Sort("Sort by", sortables, Selection(0, true))
val sortableList = listOf(
Pair("Sort name", 1),
Pair("Created", 2),
Pair("Last modified", 3),
Pair("Item added", 4),
Pair("Time to Read", 5),
Pair("Release year", 6),
)
class StatusFilter(name: String) : Filter.CheckBox(name, false)
class StatusFilterGroup(filters: List<StatusFilter>) :
Filter.Group<StatusFilter>("Status", filters)
class ReleaseYearRange(name: String) : Filter.Text(name)
class ReleaseYearRangeGroup(filters: List<ReleaseYearRange>) :
Filter.Group<ReleaseYearRange>("Release Year", filters)
class GenreFilter(name: String) : Filter.TriState(name)
class GenreFilterGroup(genres: List<GenreFilter>) :
Filter.Group<GenreFilter>("Genres", genres)
class TagFilter(name: String) : Filter.TriState(name)
class TagFilterGroup(tags: List<TagFilter>) : Filter.Group<TagFilter>("Tags", tags)
class AgeRatingFilter(name: String) : Filter.TriState(name)
class AgeRatingFilterGroup(ageRatings: List<AgeRatingFilter>) :
Filter.Group<AgeRatingFilter>("Age Rating", ageRatings)
class FormatFilter(name: String) : Filter.CheckBox(name, false)
class FormatsFilterGroup(formats: List<FormatFilter>) :
Filter.Group<FormatFilter>("Formats", formats)
class CollectionFilter(name: String) : Filter.TriState(name)
class CollectionFilterGroup(collections: List<CollectionFilter>) :
Filter.Group<CollectionFilter>("Collection", collections)
class LanguageFilter(name: String) : Filter.TriState(name)
class LanguageFilterGroup(languages: List<LanguageFilter>) :
Filter.Group<LanguageFilter>("Language", languages)
class LibraryFilter(library: String) : Filter.TriState(library)
class LibrariesFilterGroup(libraries: List<LibraryFilter>) :
Filter.Group<LibraryFilter>("Libraries", libraries)
class PubStatusFilter(name: String) : Filter.CheckBox(name, false)
class PubStatusFilterGroup(status: List<PubStatusFilter>) :
Filter.Group<PubStatusFilter>("Publication Status", status)
class PeopleHeaderFilter(name: String) :
Filter.Header(name)
class PeopleSeparatorFilter :
Filter.Separator()
class WriterPeopleFilter(name: String) : Filter.CheckBox(name, false)
class WriterPeopleFilterGroup(peoples: List<WriterPeopleFilter>) :
Filter.Group<WriterPeopleFilter>("Writer", peoples)
class PencillerPeopleFilter(name: String) : Filter.CheckBox(name, false)
class PencillerPeopleFilterGroup(peoples: List<PencillerPeopleFilter>) :
Filter.Group<PencillerPeopleFilter>("Penciller", peoples)
class InkerPeopleFilter(name: String) : Filter.CheckBox(name, false)
class InkerPeopleFilterGroup(peoples: List<InkerPeopleFilter>) :
Filter.Group<InkerPeopleFilter>("Inker", peoples)
class ColoristPeopleFilter(name: String) : Filter.CheckBox(name, false)
class ColoristPeopleFilterGroup(peoples: List<ColoristPeopleFilter>) :
Filter.Group<ColoristPeopleFilter>("Colorist", peoples)
class LettererPeopleFilter(name: String) : Filter.CheckBox(name, false)
class LettererPeopleFilterGroup(peoples: List<LettererPeopleFilter>) :
Filter.Group<LettererPeopleFilter>("Letterer", peoples)
class CoverArtistPeopleFilter(name: String) : Filter.CheckBox(name, false)
class CoverArtistPeopleFilterGroup(peoples: List<CoverArtistPeopleFilter>) :
Filter.Group<CoverArtistPeopleFilter>("Cover Artist", peoples)
class EditorPeopleFilter(name: String) : Filter.CheckBox(name, false)
class EditorPeopleFilterGroup(peoples: List<EditorPeopleFilter>) :
Filter.Group<EditorPeopleFilter>("Editor", peoples)
class PublisherPeopleFilter(name: String) : Filter.CheckBox(name, false)
class PublisherPeopleFilterGroup(peoples: List<PublisherPeopleFilter>) :
Filter.Group<PublisherPeopleFilter>("Publisher", peoples)
class CharacterPeopleFilter(name: String) : Filter.CheckBox(name, false)
class CharacterPeopleFilterGroup(peoples: List<CharacterPeopleFilter>) :
Filter.Group<CharacterPeopleFilter>("Character", peoples)
class TranslatorPeopleFilter(name: String) : Filter.CheckBox(name, false)
class TranslatorPeopleFilterGroup(peoples: List<TranslatorPeopleFilter>) :
Filter.Group<TranslatorPeopleFilter>("Translator", peoples)

View File

@ -1,81 +0,0 @@
package eu.kanade.tachiyomi.extension.all.kavita
object KavitaConstants {
// toggle filters
const val toggledFiltersPref = "toggledFilters"
val filterPrefEntries = arrayOf(
"Sort Options",
"Format",
"Libraries",
"Read Status",
"Genres",
"Tags",
"Collections",
"Languages",
"Publication Status",
"Rating",
"Age Rating",
"Writers",
"Penciller",
"Inker",
"Colorist",
"Letterer",
"Cover Artist",
"Editor",
"Publisher",
"Character",
"Translators",
"ReleaseYearRange",
)
val filterPrefEntriesValue = arrayOf(
"Sort Options",
"Format",
"Libraries",
"Read Status",
"Genres",
"Tags",
"Collections",
"Languages",
"Publication Status",
"Rating",
"Age Rating",
"Writers",
"Penciller",
"Inker",
"Colorist",
"Letterer",
"CoverArtist",
"Editor",
"Publisher",
"Character",
"Translators",
"ReleaseYearRange",
)
val defaultFilterPrefEntries = setOf(
"Sort Options",
"Format",
"Libraries",
"Read Status",
"Genres",
"Tags",
"Collections",
"Languages",
"Publication Status",
"Rating",
"Age Rating",
"Writers",
"Penciller",
"Inker",
"Colorist",
"Letterer",
"CoverArtist",
"Editor",
"Publisher",
"Character",
"Translators",
"ReleaseYearRange",
)
const val customSourceNamePref = "customSourceName"
const val noSmartFilterSelected = "No smart filter loaded"
}

View File

@ -1,13 +0,0 @@
package eu.kanade.tachiyomi.extension.all.kavita
import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.SourceFactory
class KavitaFactory : SourceFactory {
override fun createSources(): List<Source> =
listOf(
Kavita("1"),
Kavita("2"),
Kavita("3"),
)
}

View File

@ -1,141 +0,0 @@
package eu.kanade.tachiyomi.extension.all.kavita
import eu.kanade.tachiyomi.extension.all.kavita.dto.ChapterDto
import eu.kanade.tachiyomi.extension.all.kavita.dto.PaginationInfo
import eu.kanade.tachiyomi.extension.all.kavita.dto.SeriesDto
import eu.kanade.tachiyomi.extension.all.kavita.dto.VolumeDto
import eu.kanade.tachiyomi.lib.i18n.Intl
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.model.SManga
import kotlinx.serialization.decodeFromString
import kotlinx.serialization.json.Json
import okhttp3.Response
import java.text.SimpleDateFormat
import java.util.Locale
import java.util.TimeZone
class KavitaHelper {
val json = Json {
isLenient = true
ignoreUnknownKeys = true
allowSpecialFloatingPointValues = true
useArrayPolymorphism = true
prettyPrint = true
}
inline fun <reified T : Enum<T>> safeValueOf(type: String): T {
return java.lang.Enum.valueOf(T::class.java, type)
}
val dateFormatter = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSSSSSS", Locale.US)
.apply { timeZone = TimeZone.getTimeZone("UTC") }
fun parseDate(dateAsString: String): Long =
dateFormatter.parse(dateAsString)?.time ?: 0
fun hasNextPage(response: Response): Boolean {
val paginationHeader = response.header("Pagination")
var hasNextPage = false
if (!paginationHeader.isNullOrEmpty()) {
val paginationInfo = json.decodeFromString<PaginationInfo>(paginationHeader)
hasNextPage = paginationInfo.currentPage + 1 > paginationInfo.totalPages
}
return !hasNextPage
}
fun getIdFromUrl(url: String): Int {
return url.split("/").last().toInt()
}
fun createSeriesDto(obj: SeriesDto, baseUrl: String, apiKey: String): SManga =
SManga.create().apply {
url = "$baseUrl/Series/${obj.id}"
title = obj.name
// Deprecated: description = obj.summary
thumbnail_url = "$baseUrl/image/series-cover?seriesId=${obj.id}&apiKey=$apiKey"
}
class CompareChapters {
companion object : Comparator<SChapter> {
override fun compare(a: SChapter, b: SChapter): Int {
if (a.chapter_number < 1.0 && b.chapter_number < 1.0) {
// Both are volumes, multiply by 100 and do normal sort
return if ((a.chapter_number * 100) < (b.chapter_number * 100)) {
1
} else {
-1
}
} else {
if (a.chapter_number < 1.0 && b.chapter_number >= 1.0) {
// A is volume, b is not. A should sort first
return 1
} else if (a.chapter_number >= 1.0 && b.chapter_number < 1.0) {
return -1
}
}
if (a.chapter_number < b.chapter_number) return 1
if (a.chapter_number > b.chapter_number) return -1
return 0
}
}
}
fun chapterFromObject(obj: ChapterDto): SChapter = SChapter.create().apply {
url = obj.id.toString()
name = if (obj.number == "0" && obj.isSpecial) {
// This is a special. Chapter name is special name
obj.range
} else {
val cleanedName = obj.title.replaceFirst("^0+(?!$)".toRegex(), "")
"Chapter $cleanedName"
}
date_upload = parseDate(obj.created)
chapter_number = obj.number.toFloat()
scanlator = "${obj.pages} pages"
}
fun chapterFromVolume(obj: ChapterDto, volume: VolumeDto): SChapter =
SChapter.create().apply {
// If there are multiple chapters to this volume, then prefix with Volume number
if (volume.chapters.isNotEmpty() && obj.number != "0") {
// This volume is not volume 0, hence they are not loose chapters
// We just add a nice Volume X to the chapter title
// Chapter-based Volume
name = "Volume ${volume.number} Chapter ${obj.number}"
chapter_number = obj.number.toFloat()
} else if (obj.number == "0") {
// Both specials and volume has chapter number 0
if (volume.number == 0) {
// Treat as special
// Special is not in a volume
if (obj.range == "") {
// Special does not have any Title
name = "Chapter 0"
chapter_number = obj.number.toFloat()
} else {
// We use it's own special tile
name = obj.range
chapter_number = obj.number.toFloat()
}
} else {
// Is a single-file volume
// We encode the chapter number to support tracking
name = "Volume ${volume.number}"
chapter_number = volume.number.toFloat() / 10000
}
} else {
name = "Unhandled Else Volume ${volume.number}"
}
url = obj.id.toString()
date_upload = parseDate(obj.created)
scanlator = "${obj.pages} pages"
}
val intl = Intl(
language = Locale.getDefault().toString(),
baseLanguage = "en",
availableLanguages = KavitaInt.AVAILABLE_LANGS,
classLoader = this::class.java.classLoader!!,
createMessageFileName = { lang ->
when (lang) {
KavitaInt.SPANISH_LATAM -> Intl.createDefaultMessageFileName(KavitaInt.SPANISH)
else -> Intl.createDefaultMessageFileName(lang)
}
},
)
}

View File

@ -1,17 +0,0 @@
package eu.kanade.tachiyomi.extension.all.kavita
object KavitaInt {
const val ENGLISH = "en"
const val SPANISH = "es_ES"
const val SPANISH_LATAM = "es-419"
const val FRENCH = "fr_FR"
const val NORWEGIAN = "nb_NO"
val AVAILABLE_LANGS = setOf(
ENGLISH,
SPANISH,
SPANISH_LATAM,
NORWEGIAN,
FRENCH,
)
const val KAVITA_NAME = "Kavita"
}

View File

@ -1,124 +0,0 @@
package eu.kanade.tachiyomi.extension.all.kavita.dto
import kotlinx.serialization.Serializable
import kotlin.Triple
@Serializable
data class FilterV2Dto(
val id: Int? = null,
val name: String? = null,
val statements: MutableList<FilterStatementDto> = mutableListOf(),
val combination: Int = 0, // FilterCombination = FilterCombination.And,
val sortOptions: SortOptions = SortOptions(),
val limitTo: Int = 0,
) {
fun addStatement(comparison: FilterComparison, field: FilterField, value: String) {
if (value.isNotBlank()) {
statements.add(FilterStatementDto(comparison.type, field.type, value))
}
}
fun addStatement(comparison: FilterComparison, field: FilterField, values: java.util.ArrayList<out Any>) {
if (values.isNotEmpty()) {
statements.add(FilterStatementDto(comparison.type, field.type, values.joinToString(",")))
}
}
fun addContainsNotTriple(list: List<Triple<FilterField, java.util.ArrayList<out Any>, ArrayList<Int>>>) {
list.map {
addStatement(FilterComparison.Contains, it.first, it.second)
addStatement(FilterComparison.NotContains, it.first, it.third)
}
}
fun addPeople(list: List<Pair<FilterField, ArrayList<Int>>>) {
list.map {
addStatement(FilterComparison.MustContains, it.first, it.second)
}
}
}
@Serializable
data class FilterStatementDto(
// todo: Create custom serializator for comparison and field and remove .type extension in Kavita.kt
val comparison: Int,
val field: Int,
val value: String,
)
@Serializable
enum class SortFieldEnum(val type: Int) {
SortName(1),
CreatedDate(2),
LastModifiedDate(3),
LastChapterAdded(4),
TimeToRead(5),
ReleaseYear(6),
;
companion object {
private val map = SortFieldEnum.values().associateBy(SortFieldEnum::type)
fun fromInt(type: Int) = map[type]
}
}
@Serializable
data class SortOptions(
var sortField: Int = SortFieldEnum.SortName.type,
var isAscending: Boolean = true,
)
@Serializable
enum class FilterCombination {
Or,
And,
}
@Serializable
enum class FilterField(val type: Int) {
Summary(0),
SeriesName(1),
PublicationStatus(2),
Languages(3),
AgeRating(4),
UserRating(5),
Tags(6),
CollectionTags(7),
Translators(8),
Characters(9),
Publisher(10),
Editor(11),
CoverArtist(12),
Letterer(13),
Colorist(14),
Inker(15),
Penciller(16),
Writers(17),
Genres(18),
Libraries(19),
ReadProgress(20),
Formats(21),
ReleaseYear(22),
ReadTime(23),
Path(24),
FilePath(25),
}
@Serializable
enum class FilterComparison(val type: Int) {
Equal(0),
GreaterThan(1),
GreaterThanEqual(2),
LessThan(3),
LessThanEqual(4),
Contains(5),
MustContains(6),
Matches(7),
NotContains(8),
NotEqual(9),
BeginsWith(10),
EndsWith(11),
IsBefore(12),
IsAfter(13),
IsInLast(14),
IsNotInLast(15),
}

View File

@ -1,103 +0,0 @@
package eu.kanade.tachiyomi.extension.all.kavita.dto
import kotlinx.serialization.Serializable
@Serializable
enum class MangaFormat(val format: Int) {
Image(0),
Archive(1),
Unknown(2),
Epub(3),
Pdf(4),
;
companion object {
private val map = PersonRole.values().associateBy(PersonRole::role)
fun fromInt(type: Int) = map[type]
}
}
enum class PersonRole(val role: Int) {
Other(1),
Writer(3),
Penciller(4),
Inker(5),
Colorist(6),
Letterer(7),
CoverArtist(8),
Editor(9),
Publisher(10),
Character(11),
Translator(12),
;
companion object {
private val map = PersonRole.values().associateBy(PersonRole::role)
fun fromInt(type: Int) = map[type]
}
}
@Serializable
data class SeriesDto(
val id: Int,
val name: String,
val originalName: String = "",
val thumbnail_url: String? = "",
val localizedName: String? = "",
val sortName: String? = "",
val pages: Int,
val coverImageLocked: Boolean = true,
val pagesRead: Int,
val userRating: Float,
val userReview: String? = "",
val format: Int,
val created: String? = "",
val libraryId: Int,
val libraryName: String? = "",
)
@Serializable
data class SeriesMetadataDto(
val id: Int,
val summary: String? = "",
val writers: List<Person> = emptyList(),
val coverArtists: List<Person> = emptyList(),
val genres: List<Genres> = emptyList(),
val seriesId: Int,
val ageRating: Int,
val publicationStatus: Int,
)
@Serializable
data class Genres(
val title: String,
)
@Serializable
data class Person(
val name: String,
)
@Serializable
data class VolumeDto(
val id: Int,
val number: Int,
val name: String,
val pages: Int,
val pagesRead: Int,
val lastModified: String,
val created: String,
val seriesId: Int,
val chapters: List<ChapterDto> = emptyList(),
)
@Serializable
data class ChapterDto(
val id: Int,
val range: String,
val number: String,
val pages: Int,
val isSpecial: Boolean,
val title: String,
val pagesRead: Int,
val coverImageLocked: Boolean,
val volumeId: Int,
val created: String,
)

View File

@ -1,104 +0,0 @@
package eu.kanade.tachiyomi.extension.all.kavita.dto
import kotlinx.serialization.Serializable
/**
* This file contains all class for filtering
* */
@Serializable
data class MetadataGenres(
val id: Int,
val title: String,
)
@Serializable
data class MetadataPeople(
val id: Int,
val name: String,
val role: Int,
)
@Serializable
data class MetadataPubStatus(
val value: Int,
val title: String,
)
@Serializable
data class MetadataTag(
val id: Int,
val title: String,
)
@Serializable
data class MetadataAgeRatings(
val value: Int,
val title: String,
)
@Serializable
data class MetadataLanguages(
val isoCode: String,
val title: String,
)
@Serializable
data class MetadataLibrary(
val id: Int,
val name: String,
val type: Int,
)
@Serializable
data class MetadataCollections(
val id: Int,
val title: String,
)
data class MetadataPayload(
val forceUseMetadataPayload: Boolean = true,
var sorting: Int = 1,
var sorting_asc: Boolean = true,
var readStatus: ArrayList<String> = arrayListOf<String>(),
val readStatusList: List<String> = listOf("notRead", "inProgress", "read"),
// _i = included, _e = excluded
var genres_i: ArrayList<Int> = arrayListOf<Int>(),
var genres_e: ArrayList<Int> = arrayListOf<Int>(),
var tags_i: ArrayList<Int> = arrayListOf<Int>(),
var tags_e: ArrayList<Int> = arrayListOf<Int>(),
var ageRating_i: ArrayList<Int> = arrayListOf<Int>(),
var ageRating_e: ArrayList<Int> = arrayListOf<Int>(),
var formats: ArrayList<Int> = arrayListOf<Int>(),
var collections_i: ArrayList<Int> = arrayListOf<Int>(),
var collections_e: ArrayList<Int> = arrayListOf<Int>(),
var userRating: Int = 0,
var people: ArrayList<Int> = arrayListOf<Int>(),
// _i = included, _e = excluded
var language_i: ArrayList<String> = arrayListOf<String>(),
var language_e: ArrayList<String> = arrayListOf<String>(),
var libraries_i: ArrayList<Int> = arrayListOf<Int>(),
var libraries_e: ArrayList<Int> = arrayListOf<Int>(),
var pubStatus: ArrayList<Int> = arrayListOf<Int>(),
var seriesNameQuery: String = "",
var releaseYearRangeMin: Int = 0,
var releaseYearRangeMax: Int = 0,
var peopleWriters: ArrayList<Int> = arrayListOf<Int>(),
var peoplePenciller: ArrayList<Int> = arrayListOf<Int>(),
var peopleInker: ArrayList<Int> = arrayListOf<Int>(),
var peoplePeoplecolorist: ArrayList<Int> = arrayListOf<Int>(),
var peopleLetterer: ArrayList<Int> = arrayListOf<Int>(),
var peopleCoverArtist: ArrayList<Int> = arrayListOf<Int>(),
var peopleEditor: ArrayList<Int> = arrayListOf<Int>(),
var peoplePublisher: ArrayList<Int> = arrayListOf<Int>(),
var peopleCharacter: ArrayList<Int> = arrayListOf<Int>(),
var peopleTranslator: ArrayList<Int> = arrayListOf<Int>(),
)
@Serializable
data class SmartFilter(
val id: Int,
val name: String,
val filter: String,
)

View File

@ -1,28 +0,0 @@
package eu.kanade.tachiyomi.extension.all.kavita.dto
import kotlinx.serialization.Serializable
@Serializable // Used to process login
data class AuthenticationDto(
val username: String,
val token: String,
val apiKey: String,
)
@Serializable
data class PaginationInfo(
val currentPage: Int,
val itemsPerPage: Int,
val totalItems: Int,
val totalPages: Int,
)
@Serializable
data class ServerInfoDto(
val installId: String,
val os: String,
val isDocker: Boolean,
val dotnetVersion: String,
val kavitaVersion: String,
val numOfCores: Int,
)