projects
/
id3fs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
tweak relativise
[id3fs.git]
/
lib
/
ID3FS
/
DB.pm
diff --git
a/lib/ID3FS/DB.pm
b/lib/ID3FS/DB.pm
index
fced79e
..
955e117
100644
(file)
--- a/
lib/ID3FS/DB.pm
+++ b/
lib/ID3FS/DB.pm
@@
-23,11
+23,11
@@
sub new
$self->{base}=shift;
my $fallbackdir=shift;
$self->{base}=shift;
my $fallbackdir=shift;
- $
dbpath
=$self->find_db($init, $dbpath, $fallbackdir);
- return undef unless($
dbpath
);
+ $
self->{dbpath}
=$self->find_db($init, $dbpath, $fallbackdir);
+ return undef unless($
self->{dbpath}
);
$self->{absbase}=Cwd::abs_path($self->{base});
$self->{absbase}=Cwd::abs_path($self->{base});
- my $connectstr="dbi:SQLite:dbname=$
dbpath
";
+ my $connectstr="dbi:SQLite:dbname=$
self->{dbpath}
";
my ($user, $pass)=("", "");
if($self->{postgres})
{
my ($user, $pass)=("", "");
if($self->{postgres})
{
@@
-35,7
+35,7
@@
sub new
$user="ianb";
$pass="foo";
}
$user="ianb";
$pass="foo";
}
- my $exists=-f $
dbpath
;
+ my $exists=-f $
self->{dbpath}
;
$self->{dbh}=DBI->connect($connectstr, $user, $pass,
{ AutoCommit=>1 } );
unless(defined($self->{dbh}))
$self->{dbh}=DBI->connect($connectstr, $user, $pass,
{ AutoCommit=>1 } );
unless(defined($self->{dbh}))
@@
-207,7
+207,8
@@
sub tag_has_values
sub relativise
{
sub relativise
{
- my($self, $path, $name, $mountpoint, $id3fs_path)=@_;
+ my($self, $path, $name, $mountpoint)=@_;
+ my $id3fs_path=$self->{dbpath};
$id3fs_path=~s/(.*)\/.*/$1/;
my $rpath="$self->{absbase}/$path";
my $vpath="$mountpoint/$id3fs_path";
$id3fs_path=~s/(.*)\/.*/$1/;
my $rpath="$self->{absbase}/$path";
my $vpath="$mountpoint/$id3fs_path";