Rename MediaFolder to Library

This commit is contained in:
Deluan 2024-05-07 17:28:44 +02:00 committed by Deluan Quintão
parent 6f2643e55e
commit 081ef85db6
10 changed files with 92 additions and 94 deletions

View file

@ -20,10 +20,10 @@ type ResourceRepository interface {
}
type DataStore interface {
Library(ctx context.Context) LibraryRepository
Album(ctx context.Context) AlbumRepository
Artist(ctx context.Context) ArtistRepository
MediaFile(ctx context.Context) MediaFileRepository
MediaFolder(ctx context.Context) MediaFolderRepository
Genre(ctx context.Context) GenreRepository
Playlist(ctx context.Context) PlaylistRepository
PlayQueue(ctx context.Context) PlayQueueRepository

23
model/library.go Normal file
View file

@ -0,0 +1,23 @@
package model
import (
"io/fs"
"os"
)
type Library struct {
ID int32
Name string
Path string
}
func (f Library) FS() fs.FS {
return os.DirFS(f.Path)
}
type Libraries []Library
type LibraryRepository interface {
Get(id int32) (*Library, error)
GetAll() (Libraries, error)
}

View file

@ -1,23 +0,0 @@
package model
import (
"io/fs"
"os"
)
type MediaFolder struct {
ID int32
Name string
Path string
}
func (f MediaFolder) FS() fs.FS {
return os.DirFS(f.Path)
}
type MediaFolders []MediaFolder
type MediaFolderRepository interface {
Get(id int32) (*MediaFolder, error)
GetAll() (MediaFolders, error)
}