Create ComicInfo Metadata files on chapter download (#8033)

* generate ComicInfo files at the chapter root and inside CBZ archives on chapter download.

* Update app/src/main/java/eu/kanade/tachiyomi/source/LocalSource.kt

Co-authored-by: Andreas <andreas.everos@gmail.com>

* Improvements suggested by @ghostbear

* now creates ComicInfo files in normal chapter folders as well
use manga directly instead of converting it to SManga
truncate old files before overwriting them

Co-authored-by: Andreas <6576096+ghostbear@users.noreply.github.com>

* remove empty line after resolving merge conflict

* fixes Serializer for class 'ComicInfo' is not found error

* some changes to comments and variable names

* Revert leftover changes to archiveChapter() function

* minor cleanup

* Changed Chapter to SChapter

Co-authored-by: Andreas <andreas.everos@gmail.com>
Co-authored-by: Andreas <6576096+ghostbear@users.noreply.github.com>
This commit is contained in:
Shamicen
2022-11-11 22:16:37 +01:00
committed by GitHub
parent a8eebd824a
commit 4e628fe6de
4 changed files with 126 additions and 1 deletions

View File

@@ -1,12 +1,14 @@
package eu.kanade.domain.manga.model
import kotlinx.serialization.Serializable
import nl.adaptivity.xmlutil.serialization.XmlElement
import nl.adaptivity.xmlutil.serialization.XmlSerialName
import nl.adaptivity.xmlutil.serialization.XmlValue
@Serializable
@XmlSerialName("ComicInfo", "", "")
data class ComicInfo(
val title: ComicInfoTitle?,
val series: ComicInfoSeries?,
val summary: ComicInfoSummary?,
val writer: ComicInfoWriter?,
@@ -15,9 +17,24 @@ data class ComicInfo(
val colorist: ComicInfoColorist?,
val letterer: ComicInfoLetterer?,
val coverArtist: ComicInfoCoverArtist?,
val translator: ComicInfoTranslator?,
val genre: ComicInfoGenre?,
val tags: ComicInfoTags?,
)
val web: ComicInfoWeb?,
val publishingStatusTachiyomi: ComicInfoPublishingStatusTachiyomi?,
) {
@XmlElement(false)
@XmlSerialName("xmlns:xsd", "", "")
val xmlSchema: String = "http://www.w3.org/2001/XMLSchema"
@XmlElement(false)
@XmlSerialName("xmlns:xsi", "", "")
val xmlSchemaInstance: String = "http://www.w3.org/2001/XMLSchema-instance"
}
@Serializable
@XmlSerialName("Title", "", "")
data class ComicInfoTitle(@XmlValue(true) val value: String = "")
@Serializable
@XmlSerialName("Series", "", "")
@@ -51,6 +68,10 @@ data class ComicInfoLetterer(@XmlValue(true) val value: String = "")
@XmlSerialName("CoverArtist", "", "")
data class ComicInfoCoverArtist(@XmlValue(true) val value: String = "")
@Serializable
@XmlSerialName("Translator", "", "")
data class ComicInfoTranslator(@XmlValue(true) val value: String = "")
@Serializable
@XmlSerialName("Genre", "", "")
data class ComicInfoGenre(@XmlValue(true) val value: String = "")
@@ -58,3 +79,11 @@ data class ComicInfoGenre(@XmlValue(true) val value: String = "")
@Serializable
@XmlSerialName("Tags", "", "")
data class ComicInfoTags(@XmlValue(true) val value: String = "")
@Serializable
@XmlSerialName("Web", "", "")
data class ComicInfoWeb(@XmlValue(true) val value: String = "")
@Serializable
@XmlSerialName("PublishingStatusTachiyomi", "http://www.w3.org/2001/XMLSchema", "ty")
data class ComicInfoPublishingStatusTachiyomi(@XmlValue(true) val value: String = "")