source

package
v0.0.0-...-ae655b9 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2025 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chapter

type Chapter struct {
	ID             string
	MangaID        string
	Title          string
	ChapterNumber  float64
	VolumeNumber   float64
	PageCount      int
	ScanlatorGroup string
	UploadDate     time.Time
	SourceType     SourceType
	SourceID       string
	IsRead         bool
	IsBookmarked   bool
	IsDownloaded   bool
}

Chapter represents a manga chapter

type LocalSource

type LocalSource struct {
	// contains filtered or unexported fields
}

LocalSource represents a local file source for manga

func NewLocalSource

func NewLocalSource(id, name, baseDir string) *LocalSource

NewLocalSource creates a new local file source

func (*LocalSource) AddFile

func (ls *LocalSource) AddFile(filePath string) error

AddFile adds a specific manga file (CBZ, CBR, PDF)

func (*LocalSource) AddScanDirectory

func (ls *LocalSource) AddScanDirectory(dir string) error

AddScanDirectory adds a directory to scan for manga files

func (*LocalSource) GetAllPages

func (ls *LocalSource) GetAllPages(chapter *Chapter) ([]*Page, error)

GetAllPages retrieves all pages from a chapter

func (*LocalSource) GetChapter

func (ls *LocalSource) GetChapter(chapterID string) (*Chapter, error)

GetChapter retrieves chapter details

func (*LocalSource) GetID

func (ls *LocalSource) GetID() string

GetID returns the source ID

func (*LocalSource) GetManga

func (ls *LocalSource) GetManga(mangaID string) (*Manga, error)

GetManga retrieves manga details

func (*LocalSource) GetName

func (ls *LocalSource) GetName() string

GetName returns the source name

func (*LocalSource) GetPage

func (ls *LocalSource) GetPage(chapter *Chapter, pageIndex int) (*Page, error)

GetPage retrieves a specific page from a chapter

func (*LocalSource) GetType

func (ls *LocalSource) GetType() SourceType

GetType returns the source type

func (*LocalSource) IsAvailable

func (ls *LocalSource) IsAvailable() bool

IsAvailable checks if the local source is accessible

func (*LocalSource) ListChapters

func (ls *LocalSource) ListChapters(mangaID string) ([]*Chapter, error)

ListChapters lists all chapters for a manga

func (*LocalSource) ListManga

func (ls *LocalSource) ListManga() ([]*Manga, error)

ListManga lists all manga from local files

func (*LocalSource) Scan

func (ls *LocalSource) Scan() error

Scan scans all configured directories for manga files

func (*LocalSource) Search

func (ls *LocalSource) Search(query string) ([]*Manga, error)

Search searches for manga by title

type Manga

type Manga struct {
	ID            string
	Title         string
	Author        string
	Artist        string
	Description   string
	Status        string
	CoverURL      string
	Genres        []string
	SourceType    SourceType
	SourceID      string
	SourceName    string
	URL           string
	InLibrary     bool
	UnreadCount   int
	DownloadCount int
	ChapterCount  int
	LastReadAt    *time.Time
}

Manga represents manga metadata

type Page

type Page struct {
	Index     int
	URL       string
	ImageData []byte // For local files or cached data
	ImageType string // MIME type (e.g., "image/jpeg", "image/png")
}

Page represents a manga page

type Source

type Source interface {
	// GetType returns the type of this source
	GetType() SourceType

	// GetID returns a unique identifier for this source instance
	GetID() string

	// GetName returns a human-readable name for this source
	GetName() string

	// ListManga lists all available manga from this source
	ListManga() ([]*Manga, error)

	// GetManga retrieves detailed metadata for a specific manga
	GetManga(mangaID string) (*Manga, error)

	// ListChapters lists all chapters for a specific manga
	ListChapters(mangaID string) ([]*Chapter, error)

	// GetChapter retrieves detailed metadata for a specific chapter
	GetChapter(chapterID string) (*Chapter, error)

	// GetPage retrieves a specific page from a chapter
	GetPage(chapter *Chapter, pageIndex int) (*Page, error)

	// GetAllPages retrieves all pages from a chapter
	GetAllPages(chapter *Chapter) ([]*Page, error)

	// Search searches for manga by query (optional, may return nil for unsupported sources)
	Search(query string) ([]*Manga, error)

	// IsAvailable checks if the source is currently accessible
	IsAvailable() bool
}

Source is the interface that all manga sources must implement

type SourceManager

type SourceManager struct {
	// contains filtered or unexported fields
}

SourceManager manages multiple manga sources

func NewSourceManager

func NewSourceManager() *SourceManager

NewSourceManager creates a new source manager

func (*SourceManager) AddSource

func (sm *SourceManager) AddSource(source Source)

AddSource adds a source to the manager

func (*SourceManager) GetAllPages

func (sm *SourceManager) GetAllPages(chapter *Chapter) ([]*Page, error)

GetAllPages retrieves all pages for a chapter from its source

func (*SourceManager) GetPage

func (sm *SourceManager) GetPage(chapter *Chapter, pageIndex int) ([]byte, error)

GetPage retrieves a specific page from a chapter

func (*SourceManager) GetSource

func (sm *SourceManager) GetSource(id string) Source

GetSource retrieves a source by ID

func (*SourceManager) GetSources

func (sm *SourceManager) GetSources() []Source

GetSources returns all registered sources

func (*SourceManager) GetSourcesByType

func (sm *SourceManager) GetSourcesByType(sourceType SourceType) []Source

GetSourcesByType retrieves all sources of a specific type

func (*SourceManager) ListAllManga

func (sm *SourceManager) ListAllManga() ([]*Manga, error)

ListAllManga lists manga from all available sources

func (*SourceManager) SearchAllSources

func (sm *SourceManager) SearchAllSources(query string) ([]*Manga, error)

SearchAllSources searches for manga across all sources

type SourceType

type SourceType string

SourceType represents the type of manga source

const (
	SourceTypeSuwayomi SourceType = "suwayomi"
	SourceTypeLocal    SourceType = "local"
)

type SuwayomiSource

type SuwayomiSource struct {
	// contains filtered or unexported fields
}

SuwayomiSource represents a Suwayomi server source

func NewSuwayomiSource

func NewSuwayomiSource(id, name, baseURL string) *SuwayomiSource

NewSuwayomiSource creates a new Suwayomi source

func (*SuwayomiSource) GetAllPages

func (s *SuwayomiSource) GetAllPages(chapter *Chapter) ([]*Page, error)

GetAllPages retrieves all pages from a chapter

func (*SuwayomiSource) GetChapter

func (s *SuwayomiSource) GetChapter(chapterID string) (*Chapter, error)

GetChapter retrieves chapter details

func (*SuwayomiSource) GetID

func (s *SuwayomiSource) GetID() string

GetID returns the source ID

func (*SuwayomiSource) GetManga

func (s *SuwayomiSource) GetManga(mangaID string) (*Manga, error)

GetManga retrieves manga details from the Suwayomi server

func (*SuwayomiSource) GetName

func (s *SuwayomiSource) GetName() string

GetName returns the source name

func (*SuwayomiSource) GetPage

func (s *SuwayomiSource) GetPage(chapter *Chapter, pageIndex int) (*Page, error)

GetPage retrieves a specific page from a chapter

func (*SuwayomiSource) GetType

func (s *SuwayomiSource) GetType() SourceType

GetType returns the source type

func (*SuwayomiSource) IsAvailable

func (s *SuwayomiSource) IsAvailable() bool

IsAvailable checks if the Suwayomi server is accessible

func (*SuwayomiSource) ListChapters

func (s *SuwayomiSource) ListChapters(mangaID string) ([]*Chapter, error)

ListChapters lists all chapters for a manga

func (*SuwayomiSource) ListManga

func (s *SuwayomiSource) ListManga() ([]*Manga, error)

ListManga lists all manga from the Suwayomi server

func (*SuwayomiSource) Search

func (s *SuwayomiSource) Search(query string) ([]*Manga, error)

Search searches for manga on the Suwayomi server

Jump to

Keyboard shortcuts

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