Documentation
¶
Index ¶
- func RenameFile(filePath string, cfg RenameConfig, author, title, year string) (string, error)
- func VerifyEPUBTitle(epubPath, expectedTitle string, threshold float64) (bool, string, error)
- type AudioMeta
- type AudiobookScanner
- type EPUBMeta
- type LibraryTargets
- func (lt *LibraryTargets) ABSAutoMatch(itemID string)
- func (lt *LibraryTargets) ABSAutoMatchNewItems(knownIDs map[string]bool)
- func (lt *LibraryTargets) ABSCleanupDuplicateEbooks(title string)
- func (lt *LibraryTargets) ImportAudiobook()
- func (lt *LibraryTargets) ImportEbook(filePath, title, author string)
- func (lt *LibraryTargets) ImportManga(filePath, seriesTitle string)
- type Organizer
- type RenameConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RenameFile ¶ added in v1.0.0
func RenameFile(filePath string, cfg RenameConfig, author, title, year string) (string, error)
RenameFile renames a file according to the configured pattern. Returns the new file path.
Types ¶
type AudioMeta ¶
AudioMeta holds extracted audio metadata.
func ExtractAudioMeta ¶
ExtractAudioMeta extracts metadata from an audio file. It tries to read ID3v2 tags from MP3 files by parsing the header directly. Falls back to filename parsing if no tags found.
func ExtractAudioMetaFromDir ¶
ExtractAudioMetaFromDir scans a directory for audio files and extracts artist/album from the first valid file found.
type AudiobookScanner ¶
type AudiobookScanner struct {
// contains filtered or unexported fields
}
AudiobookScanner periodically scans the audiobook directory for untracked files.
func NewAudiobookScanner ¶
func NewAudiobookScanner(cfg *config.Config, database *db.DB, targets *LibraryTargets) *AudiobookScanner
NewAudiobookScanner creates a new audiobook folder scanner.
func (*AudiobookScanner) Start ¶
func (s *AudiobookScanner) Start(ctx context.Context)
Start begins the background scan loop. It blocks until ctx is cancelled.
type EPUBMeta ¶
EPUBMeta holds extracted EPUB metadata.
func ExtractEPUBMeta ¶
ExtractEPUBMeta reads an EPUB file (ZIP archive) and extracts dc:title and dc:creator from the OPF metadata file.
type LibraryTargets ¶
type LibraryTargets struct {
// contains filtered or unexported fields
}
LibraryTargets handles importing organized files into external libraries.
func NewLibraryTargets ¶
func NewLibraryTargets(cfg *config.Config) *LibraryTargets
NewLibraryTargets creates a new library targets handler.
func (*LibraryTargets) ABSAutoMatch ¶
func (lt *LibraryTargets) ABSAutoMatch(itemID string)
ABSAutoMatch triggers Audible metadata match for a library item.
func (*LibraryTargets) ABSAutoMatchNewItems ¶
func (lt *LibraryTargets) ABSAutoMatchNewItems(knownIDs map[string]bool)
ABSAutoMatchNewItems scans for new audiobook items and triggers Audible match.
func (*LibraryTargets) ABSCleanupDuplicateEbooks ¶
func (lt *LibraryTargets) ABSCleanupDuplicateEbooks(title string)
ABSCleanupDuplicateEbooks checks for duplicate entries after ebook import. Keeps the Calibre version and removes ABS-only duplicates.
func (*LibraryTargets) ImportAudiobook ¶
func (lt *LibraryTargets) ImportAudiobook()
ImportAudiobook triggers ABS library scan.
func (*LibraryTargets) ImportEbook ¶
func (lt *LibraryTargets) ImportEbook(filePath, title, author string)
ImportEbook copies to Calibre library and triggers scans on ABS and Kavita.
func (*LibraryTargets) ImportManga ¶
func (lt *LibraryTargets) ImportManga(filePath, seriesTitle string)
ImportManga copies to Kavita and Komga manga libraries and triggers scans.
type Organizer ¶
type Organizer struct {
// contains filtered or unexported fields
}
Organizer handles post-download file organization.
func NewOrganizer ¶
NewOrganizer creates a new file organizer.
func (*Organizer) OrganizeAudiobook ¶
OrganizeAudiobook moves audiobook files into the organized directory structure: {AudiobookDir}/{Author}/{Title}/
func (*Organizer) OrganizeEbook ¶
OrganizeEbook moves an ebook file into the organized directory structure: {EbookDir}/{Author}/{Title}/{file} Also copies to KAVITA_LIBRARY_PATH if configured.
type RenameConfig ¶ added in v1.0.0
type RenameConfig struct {
Enabled bool
Pattern string // e.g., "{author} - {title} ({year}).{ext}"
}
RenameConfig holds configuration for file renaming on import.