From 5fe3c1e0ab6239be80c3f200bed9986c7a36cc93 Mon Sep 17 00:00:00 2001 From: dakkar Date: Tue, 2 Jan 2018 17:45:15 +0000 Subject: use root-relative dirs in db this way, the actual path of songs doesn't matter --- lib/Ultramarine/Model/DB.pm6 | 9 +++++---- 1 file 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; -- cgit v1.2.3