database

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivityLog

type ActivityLog struct {
	ID        int64     `json:"id"`
	Timestamp time.Time `json:"timestamp"`
	JobType   string    `json:"job_type"`
	MediaType string    `json:"media_type"` // "movie" or "show"
	Title     string    `json:"title"`
	Year      int       `json:"year"`
	TMDBID    int       `json:"tmdb_id,omitempty"`
	TVDBID    int       `json:"tvdb_id,omitempty"`
	IMDBID    string    `json:"imdb_id,omitempty"`
	PosterURL string    `json:"poster_url,omitempty"`
	Status    string    `json:"status"` // "added", "failed", "skipped"
	Message   string    `json:"message,omitempty"`
}

type Database

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

func New

func New(dataDir string) (*Database, error)

func (*Database) ClearOldLogs

func (d *Database) ClearOldLogs(daysToKeep int) (int64, error)

ClearOldLogs removes logs older than the specified number of days

func (*Database) Close

func (d *Database) Close() error

func (*Database) GetActivityStats

func (d *Database) GetActivityStats() (map[string]interface{}, error)

GetActivityStats returns statistics about activity

func (*Database) GetRecentActivity

func (d *Database) GetRecentActivity(limit int) ([]ActivityLog, error)

GetRecentActivity retrieves recent activity logs

func (*Database) LogActivity

func (d *Database) LogActivity(log ActivityLog) error

LogActivity adds a new activity log entry

Jump to

Keyboard shortcuts

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