diff options
Diffstat (limited to 'lib/Ultramarine/Model/DB.pm6')
-rw-r--r-- | lib/Ultramarine/Model/DB.pm6 | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/Ultramarine/Model/DB.pm6 b/lib/Ultramarine/Model/DB.pm6 index 8b034ca..47791b4 100644 --- a/lib/Ultramarine/Model/DB.pm6 +++ b/lib/Ultramarine/Model/DB.pm6 @@ -7,4 +7,24 @@ role Ultramarine::Model::DB { method is-up-to-date(:$path,:$mtime --> Bool) { ... } method ensure-song(:$path,:$mtime,:%metadata) { ... } method ensure-file-absent(:$path) { ... } + + method top-folders(--> Iterable) { ... } + method dir-children-of(:$id) { ... } + method songs-children-of(:$id) { ... } +} + +class Ultramarine::Model::DB::File { + has Int $.id is required; + has IO::Path $.path is required; + has Int $.mtime is required; + has $.artist_id; + has $.album_id; + has %.metadata; + submethod BUILD(Int() :$!id!, IO() :$!path!,Int() :$!mtime!, Int :$!album_id!, :%!metadata!) {} +} + +class Ultramarine::Model::DB::Directory { + has Int $.id is required; + has Str $.name is required; + submethod BUILD(Int() :$!id!, Str() :$!name!) {} } |