navidrome/model/library.go

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

33 lines
542 B
Go
Raw Normal View History

2024-05-07 17:28:44 +02:00
package model
import (
"io/fs"
"os"
2024-05-07 17:29:45 +02:00
"time"
2024-05-07 17:28:44 +02:00
)
type Library struct {
2024-05-07 17:29:45 +02:00
ID int
Name string
Path string
RemotePath string
LastScanAt time.Time
UpdatedAt time.Time
CreatedAt time.Time
2024-05-07 17:28:44 +02:00
}
func (f Library) FS() fs.FS {
return os.DirFS(f.Path)
}
type Libraries []Library
type LibraryRepository interface {
2024-05-07 17:29:45 +02:00
Get(id int) (*Library, error)
Put(*Library) error
2024-05-07 17:52:13 +02:00
StoreMusicFolder() error
AddArtist(id int, artistID string) error
UpdateLastScan(id int, t time.Time) error
2024-05-07 17:29:45 +02:00
GetAll(...QueryOptions) (Libraries, error)
2024-05-07 17:28:44 +02:00
}