Documentation ¶
Index ¶
- type Chapter
- func (c *Chapter) ComicInfo() *ComicInfo
- func (c *Chapter) DownloadPages(temp bool, progress func(string)) (err error)
- func (c *Chapter) Filename() (filename string)
- func (c *Chapter) IsDownloaded() bool
- func (c *Chapter) Path(temp bool) (path string, err error)
- func (c *Chapter) SizeHuman() string
- func (c *Chapter) Source() Source
- func (c *Chapter) String() string
- func (c *Chapter) UpdatePages(pages []*Page)
- type ComicInfo
- type Manga
- func (m *Manga) BindWithAnilist() error
- func (m *Manga) Dirname() string
- func (m *Manga) DownloadCover(overwrite bool, path string, progress func(string)) error
- func (m *Manga) GetCover() (string, error)
- func (m *Manga) Path(temp bool) (path string, err error)
- func (m *Manga) PopulateMetadata(progress func(string)) error
- func (m *Manga) SeriesJSON() *SeriesJSON
- func (m *Manga) String() string
- type Page
- type SeriesJSON
- type Source
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chapter ¶
type Chapter struct { // Name of the chapter Name string `json:"name" jsonschema:"description=Name of the chapter"` // Number represent the chapter number like 145.5 0.5 Number float32 `json:"number" jsonschema:"description=Number of the chapter as defined in its source"` // URL of the chapter URL string `json:"url" jsonschema:"description=URL of the chapter"` // Index of the chapter in the manga. Index uint16 `json:"index" jsonschema:"description=Index of the chapter in the manga"` // ID of the chapter in the source. ID string `json:"id" jsonschema:"description=ID of the chapter in the source"` // Volume which the chapter belongs to. Volume string `json:"volume" jsonschema:"description=Volume which the chapter belongs to"` // Manga that the chapter belongs to. Manga *Manga `json:"-"` // Pages of the chapter. Pages []*Page `json:"pages" jsonschema:"description=Pages of the chapter"` // Date when the chapter was released. ChapterDate *time.Time `json:"chapter_date" jsonschema:"description=Date when the chapter was released"` // Scanlations team that translated the chapter. Scanlations []string `json:"scanlation,omitempty" jsonschema:"description=Scanlations team(s) that translated the chapter"` // contains filtered or unexported fields }
Chapter is a struct that represents a chapter of a manga.
func (*Chapter) DownloadPages ¶
DownloadPages downloads the Pages contents of the Chapter. Pages needs to be set before calling this function.
func (*Chapter) IsDownloaded ¶
func (*Chapter) UpdatePages ¶
type ComicInfo ¶
type ComicInfo struct { XMLName xml.Name `xml:"ComicInfo"` XmlnsXsi string `xml:"xmlns:xsi,attr"` XmlnsXsd string `xml:"xmlns:xsd,attr"` // General Title string `xml:"Title,omitempty"` Series string `xml:"Series,omitempty"` Number string `xml:"Number,omitempty"` Web string `xml:"Web,omitempty"` Genre string `xml:"Genre,omitempty"` PageCount int `xml:"PageCount,omitempty"` Summary string `xml:"Summary,omitempty"` Count int `xml:"Count,omitempty"` Characters string `xml:"Characters,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"` Letterer string `xml:"Letterer,omitempty"` Translator string `xml:"Translator,omitempty"` Tags string `xml:"Tags,omitempty"` Notes string `xml:"Notes,omitempty"` Manga string `xml:"Manga,omitempty"` Teams string `xml:"Teams,omitempty"` }
type Manga ¶
type Manga struct { // Name of the manga Name string `json:"name" jsonschema:"description=Name of the manga"` // URL of the manga URL string `json:"url" jsonschema:"description=URL of the manga"` // Index of the manga in the source. Index uint16 `json:"index" jsonschema:"description=Index of the manga in the source"` // ID of manga in the source. ID string `json:"id" jsonschema:"description=ID of manga in the source"` // Chapters of the manga Chapters []*Chapter `json:"chapters" jsonschema:"description=Chapters of the manga"` // Source that the manga belongs to. Source Source `json:"-"` // Anilist is the closest anilist match Anilist mo.Option[*anilist.Manga] `json:"-"` Metadata struct { // Genres of the manga Genres []string `json:"genres" jsonschema:"description=Genres of the manga"` // Summary in the plain text with newlines Summary string `json:"summary" jsonschema:"description=Summary in the plain text with newlines"` // Staff that worked on the manga Staff struct { // Story authors Story []string `json:"story" jsonschema:"description=Story authors"` // Art authors Art []string `json:"art" jsonschema:"description=Art authors"` // Translation group Translation []string `json:"translation" jsonschema:"description=Translation group"` // Lettering group Lettering []string `json:"lettering" jsonschema:"description=Lettering group"` } `json:"staff" jsonschema:"description=Staff that worked on the manga"` // Cover images of the manga Cover struct { // ExtraLarge is the largest cover image. If not available, Large will be used. ExtraLarge string `json:"extraLarge" jsonschema:"description=ExtraLarge is the largest cover image. If not available, Large will be used."` // Large is the second-largest cover image. Large string `json:"large" jsonschema:"description=Large is the second-largest cover image."` // Medium cover image. The smallest one. Medium string `json:"medium" jsonschema:"description=Medium cover image. The smallest one."` // Color average color of the cover image. Color string `json:"color" jsonschema:"description=Color average color of the cover image."` } `json:"cover" jsonschema:"description=Cover images of the manga"` // BannerImage is the banner image of the manga. BannerImage string `json:"bannerImage" jsonschema:"description=BannerImage is the banner image of the manga."` // Tags of the manga Tags []string `json:"tags" jsonschema:"description=Tags of the manga"` // Characters of the manga Characters []string `json:"characters" jsonschema:"description=Characters of the manga"` // Status of the manga Status string `json:"status" jsonschema:"enum=FINISHED,enum=RELEASING,enum=NOT_YET_RELEASED,enum=CANCELLED,enum=HIATUS"` // StartDate is the date when the manga started. StartDate date `json:"startDate" jsonschema:"description=StartDate is the date when the manga started."` // EndDate is the date when the manga ended. EndDate date `json:"endDate" jsonschema:"description=EndDate is the date when the manga ended."` // Synonyms other names of the manga. Synonyms []string `json:"synonyms" jsonschema:"description=Synonyms other names of the manga."` // Chapters is the amount of chapters the manga will have when completed. Chapters int `json:"chapters" jsonschema:"description=The amount of chapters the manga will have when completed."` // URLs external URLs of the manga. URLs []string `json:"urls" jsonschema:"description=External URLs of the manga."` } `json:"metadata"` // contains filtered or unexported fields }
Manga is a manga from a source.
func (*Manga) BindWithAnilist ¶
func (*Manga) DownloadCover ¶
func (*Manga) PopulateMetadata ¶
func (*Manga) SeriesJSON ¶
func (m *Manga) SeriesJSON() *SeriesJSON
type Page ¶
type Page struct { // URL of the page. Used to download the page. URL string `json:"url" jsonschema:"description=URL of the page. Used to download the image."` // Index of the page in the chapter. Index uint16 `json:"index" jsonschema:"description=Index of the page in the chapter."` // Extension of the page image. Extension string `json:"extension" jsonschema:"description=Extension of the page image."` // Size of the page in bytes Size uint64 `json:"-"` // Contents of the page Contents *bytes.Buffer `json:"-"` // Chapter that the page belongs to. Chapter *Chapter `json:"-"` // IsSplitted tell us if the page was cropped to multiple pieces IsSplitted bool `json:"is_cropped" jsonschema:"description=Was this page cropped."` // SplitPartIndex represent the index of the crop if the page was cropped SplitPartIndex uint16 `json:"crop_part_index" jsonschema:"description=Index of the crop if the image was cropped."` }
Page represents a page in a chapter
type SeriesJSON ¶
type SeriesJSON struct { Metadata struct { Type string `json:"type"` Name string `json:"name"` DescriptionFormatted string `json:"description_formatted"` DescriptionText string `json:"description_text"` Status string `json:"status"` Year int `json:"year"` ComicImage string `json:"ComicImage"` Publisher string `json:"publisher"` ComicID int `json:"comicId"` BookType string `json:"booktype"` TotalIssues int `json:"total_issues"` PublicationRun string `json:"publication_run"` } `json:"metadata"` }
Click to show internal directories.
Click to hide internal directories.