summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordakkar <dakkar@thenautilus.net>2018-01-02 17:45:15 +0000
committerdakkar <dakkar@thenautilus.net>2018-01-02 17:45:15 +0000
commit5fe3c1e0ab6239be80c3f200bed9986c7a36cc93 (patch)
treee6abbeea68b8f96ebfa3dc6a16960c6772b6d359
parentgive songs an id (diff)
downloadUltramarine-5fe3c1e0ab6239be80c3f200bed9986c7a36cc93.tar.gz
Ultramarine-5fe3c1e0ab6239be80c3f200bed9986c7a36cc93.tar.bz2
Ultramarine-5fe3c1e0ab6239be80c3f200bed9986c7a36cc93.zip
use root-relative dirs in db
this way, the actual path of songs doesn't matter
-rw-r--r--lib/Ultramarine/Model/DB.pm69
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Ultramarine/Model/DB.pm6 b/lib/Ultramarine/Model/DB.pm6
index 572d35c..422cd3e 100644
--- a/lib/Ultramarine/Model/DB.pm6
+++ b/lib/Ultramarine/Model/DB.pm6
@@ -122,11 +122,12 @@ class Ultramarine::Model::DB {
LEAVE { .finish with $sth }
}
- method ensure-directories(IO() :$path! is copy) {
+ method ensure-directories(IO() :$path!) {
+ my $rel-path = $path.relative($path.CWD).IO;
my @components = gather {
- while $path ne '.'|'/' {
- take $path.basename;
- $path .= parent;
+ while $rel-path ne '.'|'/' {
+ take $rel-path.basename;
+ $rel-path .= parent;
}
};
my $parent-id=Nil;