history

package
v0.2.0-alpha Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

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

Logger handles logging operations to the history database

func NewLogger

func NewLogger(db *database.DB) *Logger

NewLogger creates a new history logger

func (*Logger) CleanupOldRecords

func (l *Logger) CleanupOldRecords(olderThan time.Duration) error

CleanupOldRecords removes history records older than the specified duration

func (*Logger) GetByMovieID

func (l *Logger) GetByMovieID(movieID string) ([]models.History, error)

GetByMovieID retrieves history for a specific movie

func (*Logger) GetByOperation

func (l *Logger) GetByOperation(operation string, limit int) ([]models.History, error)

GetByOperation retrieves history for a specific operation type

func (*Logger) GetByStatus

func (l *Logger) GetByStatus(status string, limit int) ([]models.History, error)

GetByStatus retrieves history with a specific status

func (*Logger) GetRecent

func (l *Logger) GetRecent(limit int) ([]models.History, error)

GetRecent retrieves recent history records

func (*Logger) GetStats

func (l *Logger) GetStats() (*Stats, error)

GetStats returns statistics about operations

func (*Logger) LogDownload

func (l *Logger) LogDownload(movieID, url, localPath, mediaType string, err error) error

LogDownload logs a media download operation

func (*Logger) LogNFO

func (l *Logger) LogNFO(movieID, nfoPath string, err error) error

LogNFO logs an NFO generation operation

func (*Logger) LogOrganize

func (l *Logger) LogOrganize(movieID, originalPath, newPath string, dryRun bool, err error) error

LogOrganize logs a file organization operation

func (*Logger) LogRevert

func (l *Logger) LogRevert(movieID, originalPath, revertedFrom string, err error) error

LogRevert logs a revert operation

func (*Logger) LogScrape

func (l *Logger) LogScrape(movieID, sourceURL string, metadata interface{}, err error) error

LogScrape logs a metadata scraping operation

type Stats

type Stats struct {
	Total    int64
	Success  int64
	Failed   int64
	Reverted int64
	Scrape   int64
	Organize int64
	Download int64
	NFO      int64
}

Stats represents history statistics

Jump to

Keyboard shortcuts

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