library

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteEmptyTags added in v0.0.3

func DeleteEmptyTags(ctx jobs.JobContext)

DeleteEmptyTags removes tags that are no longer associated with any chapters.

func DetectBadFiles added in v0.0.3

func DetectBadFiles(ctx jobs.JobContext)

DetectBadFiles scans the library for chapter files that fail inspection (corrupt or invalid).

func ExtractMetadataFromPath

func ExtractMetadataFromPath(filePath, libraryPath string) (seriesTitle, chapterName string)

ExtractMetadataFromPath uses simple heuristics to determine the series title and chapter name from a file's path. For example: /path/to/library/One-Piece/Chapter-100.cbz Series Title: One-Piece Chapter Name: Chapter-100.cbz

func GenerateThumbnail

func GenerateThumbnail(imageData []byte) (string, error)

GenerateThumbnail takes raw image data, resizes it, encodes it as a Base64 JPEG, and returns it as a data URI string.

func IncrementalLibrarySync added in v0.1.3

func IncrementalLibrarySync(ctx jobs.JobContext, changedPaths []string) error

IncrementalLibrarySync performs an incremental scan of specific paths. It only scans the provided paths and their parent directories.

func LibrarySync

func LibrarySync(ctx jobs.JobContext)

LibrarySync performs a full synchronization between the filesystem and the database.

func RegenerateThumbnails

func RegenerateThumbnails(ctx jobs.JobContext)

RegenerateThumbnails regenerates thumbnails for all chapters and folders.

func ThumbnailForChapterFile added in v0.1.6

func ThumbnailForChapterFile(ctx context.Context, path string) (string, error)

ThumbnailForChapterFile builds a data-URI thumbnail from the first page of a chapter file.

Types

type Scanner

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

Scanner is responsible for scanning the library and updating the database.

func NewScanner

func NewScanner(cfg *config.Config, db *sql.DB) *Scanner

NewScanner creates a new Scanner instance.

type WatcherService added in v0.1.3

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

WatcherService watches the library directory for file system changes and triggers incremental scans when files are added, modified, or deleted.

func NewWatcherService added in v0.1.3

func NewWatcherService(ctx jobs.JobContext) *WatcherService

NewWatcherService creates a new file system watcher service.

func (*WatcherService) Start added in v0.1.3

func (w *WatcherService) Start() error

Start begins watching the library directory for changes.

func (*WatcherService) Stop added in v0.1.3

func (w *WatcherService) Stop() error

Stop stops the file watcher service.

func (*WatcherService) TriggerIncrementalScanForPath added in v0.1.3

func (w *WatcherService) TriggerIncrementalScanForPath(path string)

TriggerIncrementalScanForPath manually triggers an incremental scan for a specific path. This is used by the downloader when files are downloaded.

Directories

Path Synopsis
Package chapterfiles routes chapter files (archives and PDF) to type-specific handlers.
Package chapterfiles routes chapter files (archives and PDF) to type-specific handlers.

Jump to

Keyboard shortcuts

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