dto

package
v0.11.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2025 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Artwork

type Artwork struct {
	Work
	Page
	IllustType  *uint8 `json:"illustType"`
	UserIllusts map[string]*struct {
		Url string `json:"url"`
	} `json:"userIllusts"`
}

func (*Artwork) FromDto

func (dto *Artwork) FromDto(
	downloadTime time.Time, size *imageext.Size,
) (w *work.Work, firstPageUrl, thumbnailUrl *string)

Provided size is only used to determine the url of the first page. If you don't need this or you don't know the size, pass nil instead.

type ArtworkBookmarksBody

type ArtworkBookmarksBody struct {
	Works []BookmarkArtwork `json:"works"`
	Total uint64            `json:"total"`
}

type BookmarkArtwork

type BookmarkArtwork struct {
	BookmarkWork
	Page
	IllustType *uint8  `json:"illustType"`
	Url        *string `json:"url"`
}

func (*BookmarkArtwork) FromDto

func (dto *BookmarkArtwork) FromDto(
	downloadTime time.Time,
) (w *work.Work, unlisted bool, thumbnailUrl *string)

type BookmarkNovel

type BookmarkNovel struct {
	BookmarkWork
	BookmarkCount *uint64 `json:"bookmarkCount"`
	IsOriginal    *bool   `json:"isOriginal"`
	Url           *string `json:"url"`
}

func (*BookmarkNovel) FromDto

func (dto *BookmarkNovel) FromDto(
	downloadTime time.Time,
) (w *work.Work, unlisted bool, coverUrl *string)

type BookmarkWork

type BookmarkWork struct {
	Id                      any       `json:"id"`
	Title                   *string   `json:"title"`
	UserId                  any       `json:"userId"`
	UserName                *string   `json:"userName"`
	XRestrict               *uint8    `json:"xRestrict"`
	AiType                  *uint8    `json:"aiType"`
	PageCount               *uint64   `json:"pageCount"`
	CreateDate              *string   `json:"createDate"`
	Tags                    *[]string `json:"tags"`
	TitleCaptionTranslation struct {
		WorkTitle   *string `json:"workTitle"`
		WorkCaption *string `json:"workCaption"`
	} `json:"titleCaptionTranslation"`
}

func (*BookmarkWork) FromDto

func (dto *BookmarkWork) FromDto(
	kind *work.Kind, downloadTime time.Time,
) (w *work.Work, unlisted bool)

type Frame

type Frame struct {
	File  *string `json:"file"`
	Delay *int    `json:"delay"`
}

type FramesData

type FramesData struct {
	Src    *string `json:"src"`
	Frames []Frame `json:"frames"`
}

func (*FramesData) FromDto

func (f *FramesData) FromDto() (framesSrc *string, frames *[]imageext.Frame)

type Novel

type Novel struct {
	Work
	Content            *string `json:"content"`
	CoverUrl           *string `json:"coverUrl"`
	Language           *string `json:"language"`
	TextEmbeddedImages map[string]struct {
		Urls struct {
			Thumb    *string `json:"128x128"`
			Small    *string `json:"480mw"`
			Regular  *string `json:"1200x1200"`
			Original *string `json:"original"`
		} `json:"urls"`
	} `json:"textEmbeddedImages"`
}

func (*Novel) FromDto

func (dto *Novel) FromDto(downloadTime time.Time, size *imageext.Size) (
	w *work.Work, coverUrl *string, uploadedImages NovelUpladedImages,
	pixivImages NovelPixivImages, pages NovelPages, withPages bool,
)

Provided size is only used to determine embedded image urls. If you don't need novel content and images, pass nil instead.

type NovelBookmarksBody

type NovelBookmarksBody struct {
	Works []BookmarkNovel `json:"works"`
	Total uint64          `json:"total"`
}

type NovelPages added in v0.8.0

type NovelPages = func(
	imageName func(index int) string,
	pageName func(page int) string,
) []fsext.Asset

Call to finish parsing novel contents when all asset names are known.

type NovelPixivImages added in v0.8.0

type NovelPixivImages map[int]uint64

Map: index -> Pixiv work ID, used for downloading novel illustrations.

type NovelUpladedImages added in v0.8.0

type NovelUpladedImages map[int]string

Map: index -> URL, used for downloading novel illustrations.

type Page

type Page struct {
	Urls struct {
		Thumb     *string `json:"thumb"`
		ThumbMini *string `json:"thumb_mini"`
		Small     *string `json:"small"`
		Regular   *string `json:"regular"`
		Original  *string `json:"original"`
	} `json:"urls"`
}

func (*Page) FromDto

func (p *Page) FromDto(size imageext.Size) *string

type Response

type Response[T any] struct {
	Body T `json:"body"`
}

type Work

type Work struct {
	Id            *string `json:"id"`
	Title         *string `json:"title"`
	Description   *string `json:"description"`
	UserId        *string `json:"userId"`
	UserName      *string `json:"userName"`
	XRestrict     *uint8  `json:"xRestrict"`
	AiType        *uint8  `json:"aiType"`
	IsOriginal    *bool   `json:"isOriginal"`
	PageCount     *uint64 `json:"pageCount"`
	ViewCount     *uint64 `json:"viewCount"`
	BookmarkCount *uint64 `json:"bookmarkCount"`
	LikeCount     *uint64 `json:"likeCount"`
	CommentCount  *uint64 `json:"commentCount"`
	CreateDate    *string `json:"createDate"`
	SeriesNavData struct {
		SeriesId any     `json:"seriesId"`
		Order    *uint64 `json:"order"`
		Title    *string `json:"title"`
	} `json:"seriesNavData"`
	Tags struct {
		Tags *[](struct {
			Tag *string `json:"tag"`
		}) `json:"tags"`
	} `json:"tags"`
	TitleCaptionTranslation struct {
		WorkTitle   *string `json:"workTitle"`
		WorkCaption *string `json:"workCaption"`
	} `json:"titleCaptionTranslation"`
}

func (*Work) FromDto

func (dto *Work) FromDto(kind *work.Kind, downloadTime time.Time) *work.Work

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL