diff options
author | dakkar <dakkar@thenautilus.net> | 2018-01-02 17:45:15 +0000 |
---|---|---|
committer | dakkar <dakkar@thenautilus.net> | 2018-01-02 17:45:15 +0000 |
commit | 5fe3c1e0ab6239be80c3f200bed9986c7a36cc93 (patch) | |
tree | e6abbeea68b8f96ebfa3dc6a16960c6772b6d359 | |
parent | give songs an id (diff) | |
download | Ultramarine-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.pm6 | 9 |
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; |