summaryrefslogtreecommitdiff
path: root/lib/Ultramarine/Model/Collection.pm6
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2017-12-30 14:11:49 +0000
committerdakkar <dakkar@thenautilus.net>2017-12-30 14:13:24 +0000
commit9dc58af844d82da2b6e7181d9f7912b0a3d76dec (patch)
treef79f3d4f3cd93849847f225a6bd7450479078c9f /lib/Ultramarine/Model/Collection.pm6
parentsubmethod is probably the wrong thing here (diff)
downloadUltramarine-9dc58af844d82da2b6e7181d9f7912b0a3d76dec.tar.gz
Ultramarine-9dc58af844d82da2b6e7181d9f7912b0a3d76dec.tar.bz2
Ultramarine-9dc58af844d82da2b6e7181d9f7912b0a3d76dec.zip
better db structure, plus notes
Diffstat (limited to 'lib/Ultramarine/Model/Collection.pm6')
-rw-r--r--lib/Ultramarine/Model/Collection.pm65
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Ultramarine/Model/Collection.pm6 b/lib/Ultramarine/Model/Collection.pm6
index 449e7ed..e894f1c 100644
--- a/lib/Ultramarine/Model/Collection.pm6
+++ b/lib/Ultramarine/Model/Collection.pm6
@@ -23,13 +23,16 @@ class Ultramarine::Model::Collection {
when $path ~~ Ultramarine::Model::DirScanner::EndOfScan {
# we should use this to check that all the files in
# the db have been seen, and delete those that haven't
+ #
+ # calling db.remove-unseen-files, plus db.remove-empty
$!mark-ready.keep(True);
}
when $path ~~ IO::Path & :f {
my $mtime = $path.modified.floor;
+ # call db.ensure-song and db.seen-file
unless $.db.is-up-to-date(:$path,:$mtime) {
my %metadata = $.file-class.new(:$path).metadata;
- $.db.set-song(:$path,:$mtime,:%metadata) if %metadata.keys;
+ $.db.ensure-song(:$path,:$mtime,:%metadata) if %metadata.keys;
}
}
}