Documentation
¶
Overview ¶
Package comicinfo MIT License
Copyright (c) 2023 Felipe Martin ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
https://github.com/fmartingr/go-comicinfo/blob/latest/schema.go, but with Tags support, and custom Kavitatags
Package comicinfo
MIT License ¶
Copyright (c) 2023 Felipe Martin ¶
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AgeRatingIndex = map[AgeRating]int{ AgeRatingUnknown: 0, AgeRatingPending: 1, AgeRatingEarlyChildhood: 2, AgeRatingEveryone: 3, AgeRatingG: 4, AgeRatingEveryone10Plus: 5, AgeRatingPG: 6, AgeRatingKidsToAdults: 7, AgeRatingTeen: 8, AgeRatingMAPlus15: 9, AgeRatingMaturePlus17: 10, AgeRatingM: 11, AgeRatingRPlus18: 12, AgeRatingAdultsOnlyPlus18: 13, AgeRatingXPlus18: 14, }
var ErrNoComicInfo = errors.New("zip file does not contain comic info")
var IndexToAgeRating = []AgeRating{ AgeRatingUnknown, AgeRatingPending, AgeRatingEarlyChildhood, AgeRatingEveryone, AgeRatingG, AgeRatingEveryone10Plus, AgeRatingPG, AgeRatingKidsToAdults, AgeRatingTeen, AgeRatingMAPlus15, AgeRatingMaturePlus17, AgeRatingM, AgeRatingRPlus18, AgeRatingAdultsOnlyPlus18, AgeRatingXPlus18, }
Functions ¶
Types ¶
type AgeRating ¶
type AgeRating string
AgeRating defines the AgeRating type
var ( AgeRatingUnknown AgeRating = "Unknown" AgeRatingPending AgeRating = "Rating Pending" AgeRatingEarlyChildhood AgeRating = "Early Childhood" AgeRatingEveryone AgeRating = "Everyone" AgeRatingG AgeRating = "G" AgeRatingEveryone10Plus AgeRating = "Everyone 10+" AgeRatingPG AgeRating = "PG" AgeRatingKidsToAdults AgeRating = "Kids to Adults" AgeRatingTeen AgeRating = "Teen" AgeRatingMAPlus15 AgeRating = "MA15+" AgeRatingMaturePlus17 AgeRating = "Mature 17+" AgeRatingM AgeRating = "M" AgeRatingRPlus18 AgeRating = "R18+" AgeRatingAdultsOnlyPlus18 AgeRating = "Adults Only 18+" AgeRatingXPlus18 AgeRating = "X18+" )
type ComicInfo ¶
type ComicInfo struct {
Title string `xml:"Title,omitempty"`
Series string `xml:"Series,omitempty"`
LocalizedSeries string `xml:"LocalizedSeries,omitempty"` // Kavita only
Number string `xml:"Number,omitempty"`
Count int `xml:"Count,omitempty"`
Volume int `xml:"Volume,omitempty"`
AlternateSeries string `xml:"AlternateSeries,omitempty"`
AlternateNumber string `xml:"AlternateNumber,omitempty"`
AlternateCount int `xml:"AlternateCount,omitempty"`
Summary string `xml:"Summary,omitempty"`
Notes string `xml:"Notes,omitempty"`
Year int `xml:"Year,omitempty"`
Month int `xml:"Month,omitempty"`
Day int `xml:"Day,omitempty"`
Writer string `xml:"Writer,omitempty"`
Penciller string `xml:"Penciller,omitempty"`
Inker string `xml:"Inker,omitempty"`
Colorist string `xml:"Colorist,omitempty"`
Letterer string `xml:"Letterer,omitempty"`
CoverArtist string `xml:"CoverArtist,omitempty"`
Editor string `xml:"Editor,omitempty"`
Publisher string `xml:"Publisher,omitempty"`
Imprint string `xml:"Imprint,omitempty"`
Genre string `xml:"Genre,omitempty"`
Tags string `xml:"Tags,omitempty"`
Web string `xml:"Web,omitempty"`
PageCount int `xml:"PageCount,omitempty"`
LanguageISO string `xml:"LanguageISO,omitempty"`
Format string `xml:"Format,omitempty"`
BlackAndWhite YesNo `xml:"BlackAndWhite,omitempty"`
Manga Manga `xml:"Manga,omitempty"`
Characters string `xml:"Characters,omitempty"`
Teams string `xml:"Teams,omitempty"`
Locations string `xml:"Locations,omitempty"`
ScanInformation string `xml:"ScanInformation,omitempty"`
StoryArc string `xml:"StoryArc,omitempty"`
SeriesGroup string `xml:"SeriesGroup,omitempty"`
AgeRating AgeRating `xml:"AgeRating,omitempty"`
Pages Pages `xml:"Pages,omitempty"`
CommunityRating Rating `xml:"CommunityRating,omitempty"`
MainCharacterOrTeam string `xml:"MainCharacterOrTeam,omitempty"`
Review string `xml:"Review,omitempty"`
// Internal
XmlnsXsd string `xml:"xmlns:xsd,attr"`
XmlNsXsi string `xml:"xmlns:xsi,attr"`
}
ComicInfo ...
func NewComicInfo ¶
func NewComicInfo() *ComicInfo
NewComicInfo provides a new ComicInfo struct with the XML attributes set
func (*ComicInfo) SetXMLAttributes ¶
func (ci *ComicInfo) SetXMLAttributes()
type ComicPageInfo ¶
type ComicPageInfo struct {
Image int `xml:"Image,attr"`
Type ComicPageType `xml:"Type,omitempty,attr"`
DoublePage bool `xml:"DoublePage,omitempty,attr"`
ImageSize int64 `xml:"ImageSize,omitempty,attr"`
Key string `xml:"Key,omitempty,attr"`
Bookmark string `xml:"Bookmark,omitempty,attr"`
ImageWidth int `xml:"ImageWidth,omitempty,attr"`
ImageHeight int `xml:"ImageHeight,omitempty,attr"`
}
ComicPageInfo defines the ComicPageInfo type
func NewComicPageInfo ¶
func NewComicPageInfo() ComicPageInfo
NewComicPageInfo provides a new ComicPageInfo struct with the XML attributes set
type ComicPageType ¶
type ComicPageType string
ComicPageType defines the ComicPageType type
var ( ComicPageTypeFrontCover ComicPageType = "FrontCover" ComicPageTypeInnerCover ComicPageType = "InnerCover" ComicPageTypeRoundup ComicPageType = "Roundup" ComicPageTypeStory ComicPageType = "Story" ComicPageTypeAdvertisement ComicPageType = "Advertisement" ComicPageTypeEditorial ComicPageType = "Editorial" ComicPageTypeLetters ComicPageType = "Letters" ComicPageTypePreview ComicPageType = "Preview" ComicPageTypeBackCover ComicPageType = "BackCover" ComicPageTypeOther ComicPageType = "Other" ComicPageTypeDeleted ComicPageType = "Deleted" )
type Pages ¶
type Pages struct {
Pages []ComicPageInfo `xml:"Page,omitempty"`
}
Pages defines the Pages type (slice of ComicPageInfo for proper XML marshalling)
func (*Pages) Append ¶
func (p *Pages) Append(page ComicPageInfo)