Documentation
¶
Index ¶
- type DB
- func (db *DB) CleanupMissingFiles() ([]string, error)
- func (db *DB) Close() error
- func (db *DB) CountFavorites() (int, error)
- func (db *DB) CountImages() (int, error)
- func (db *DB) DeleteImage(id int) (string, error)
- func (db *DB) DeleteImageBySourceID(source, sourceID string) (string, error)
- func (db *DB) DeleteOldImages(keepCount int) ([]string, error)
- func (db *DB) ExistsByChecksum(checksum string) (bool, error)
- func (db *DB) ExistsBySourceID(source, sourceID string) (bool, error)
- func (db *DB) FindDuplicates() ([][]Image, error)
- func (db *DB) GetImageByID(id int) (*Image, error)
- func (db *DB) InsertImage(img *Image) error
- func (db *DB) ListFavorites(limit int) ([]Image, error)
- func (db *DB) ListImages(source string, limit int) ([]Image, error)
- func (db *DB) SetFavorite(id int, favorite bool) error
- func (db *DB) ToggleFavorite(id int) error
- type Image
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB represents the database connection
func (*DB) CleanupMissingFiles ¶
CleanupMissingFiles removes database entries for files that no longer exist on disk
func (*DB) CountFavorites ¶ added in v1.2.3
CountFavorites returns the number of favorite images
func (*DB) CountImages ¶
CountImages returns the total number of images
func (*DB) DeleteImage ¶
DeleteImage deletes an image by ID and returns the local path
func (*DB) DeleteImageBySourceID ¶
DeleteImageBySourceID deletes an image by source and source_id
func (*DB) DeleteOldImages ¶
DeleteOldImages deletes old images keeping only the most recent ones
func (*DB) ExistsByChecksum ¶
ExistsByChecksum checks if an image exists by checksum
func (*DB) ExistsBySourceID ¶
ExistsBySourceID checks if an image exists by source and source ID
func (*DB) FindDuplicates ¶
FindDuplicates finds duplicate images by checksum
func (*DB) GetImageByID ¶
GetImageByID gets an image by ID
func (*DB) InsertImage ¶
InsertImage inserts a new image record
func (*DB) ListFavorites ¶ added in v1.2.3
ListFavorites lists all favorite images
func (*DB) ListImages ¶
ListImages lists images with optional filtering
func (*DB) SetFavorite ¶ added in v1.2.3
SetFavorite sets the favorite status of an image
func (*DB) ToggleFavorite ¶ added in v1.2.3
ToggleFavorite toggles the favorite status of an image
type Image ¶
type Image struct {
ID int `json:"id"`
Source string `json:"source"`
SourceID string `json:"source_id"`
URL string `json:"url"`
LocalPath string `json:"local_path"`
Checksum string `json:"checksum"`
Tags string `json:"tags"`
Resolution string `json:"resolution"`
FileSize int64 `json:"file_size"`
DownloadedAt time.Time `json:"downloaded_at"`
Favorite bool `json:"favorite"`
}
Image represents an image record in the database