use v6.d.PREVIEW;
role Ultramarine::Model::DB {
method seen-file(:$path) { ... }
method remove-unseen-files() { ... }
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!) {}
}