Store MusicFolder as a library in DB

This commit is contained in:
Deluan
2024-05-07 17:29:45 +02:00
committed by Deluan Quintão
parent 081ef85db6
commit 477bcaee58
5 changed files with 136 additions and 22 deletions
+11 -5
View File
@@ -3,12 +3,17 @@ package model
import (
"io/fs"
"os"
"time"
)
type Library struct {
ID int32
Name string
Path string
ID int
Name string
Path string
RemotePath string
LastScanAt time.Time
UpdatedAt time.Time
CreatedAt time.Time
}
func (f Library) FS() fs.FS {
@@ -18,6 +23,7 @@ func (f Library) FS() fs.FS {
type Libraries []Library
type LibraryRepository interface {
Get(id int32) (*Library, error)
GetAll() (Libraries, error)
Get(id int) (*Library, error)
Put(*Library) error
GetAll(...QueryOptions) (Libraries, error)
}