Documentation
¶
Index ¶
- Constants
- Variables
- func New(scope *dig.Scope) core.Downloadable
- type Author
- type Builder
- func (b *Builder) Client() services.Client
- func (b *Builder) DownloadMetadata() payload.DownloadMetadata
- func (b *Builder) Logger() zerolog.Logger
- func (b *Builder) Normalize(t []SearchResult) []payload.Info
- func (b *Builder) Provider() models.Provider
- func (b *Builder) Search(s SearchOptions) ([]SearchResult, error)
- func (b *Builder) Transform(request payload.SearchRequest) SearchOptions
- type Chapter
- type ImageRenderProps
- type Publication
- type Repository
- type SearchOptions
- type SearchResult
- type Series
Constants ¶
View Source
const ( Domain = "https://bato.to" QueryTag = "word" GenresTag = "genres" OriginalLangTag = "orig" TranslatedLangTag = "lang" StatusTag = "status" UploadTag = "upload" )
Variables ¶
View Source
var ( VolumeChapterRegexes = []volumeChapterMapping{ {regexp.MustCompile(`(?:(?:Volume|Vol\.?) (\d+)\s+)?(?:Chapter|Ch\.?) ([\d\\.]+)`), ""}, {regexp.MustCompile(`(?:\[S(\d+)] ?)?Episode ([\d\\.]+)`), ""}, } AuthorMappings = map[string]comicinfo.Roles{ "(Story&Art)": {comicinfo.Writer, comicinfo.Colorist}, "(Story)": {comicinfo.Writer}, "(Art)": {comicinfo.Colorist}, } TitleCleans = []string{ "Official", "Unofficial", "Mature", } Braces = map[string]string{ "[": "]", "(": ")", "«": "»", } )
TODO: Make these configurable? Especially mapping and cleans
Would be fun to have YAMLs for these. I think UI/DB is over the top for them But maybe not?
Functions ¶
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func NewBuilder ¶
func NewBuilder(log zerolog.Logger, httpClient *menou.Client, ps core.Client, repository Repository, cache services.CacheService) *Builder
func (*Builder) DownloadMetadata ¶
func (b *Builder) DownloadMetadata() payload.DownloadMetadata
func (*Builder) Search ¶
func (b *Builder) Search(s SearchOptions) ([]SearchResult, error)
func (*Builder) Transform ¶
func (b *Builder) Transform(request payload.SearchRequest) SearchOptions
type Chapter ¶
func (Chapter) ChapterFloat ¶
func (Chapter) GetChapter ¶
func (Chapter) VolumeFloat ¶
type ImageRenderProps ¶
type Publication ¶
type Publication string
const ( PublicationPending Publication = "pending" PublicationOngoing Publication = "ongoing" PublicationCompleted Publication = "completed" PublicationHiatus Publication = "hiatus" PublicationCancelled Publication = "cancelled" )
type Repository ¶
type Repository interface {
Search(ctx context.Context, options SearchOptions) ([]SearchResult, error)
SeriesInfo(ctx context.Context, id string) (Series, error)
ChapterImages(ctx context.Context, id string) ([]string, error)
}
func NewRepository ¶
func NewRepository(httpClient *menou.Client, logger zerolog.Logger, markdown services.MarkdownService) Repository
type SearchOptions ¶
type SearchOptions struct {
Query string
Genres []string
OriginalLang []string
TranslatedLang []string
OriginalWorkStatus []Publication
BatoUploadStatus []Publication
}
type SearchResult ¶
type Series ¶
type Series struct {
Id string
Title string
CoverUrl string
OriginalTitle string
Authors []Author
Tags []string
PublicationStatus Publication
BatoUploadStatus Publication
Summary string
WebLinks []string
Chapters []Chapter
}
func (*Series) AllChapters ¶
Click to show internal directories.
Click to hide internal directories.