projects
/
id3fs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
d37f9e0
)
merge duplicate id lookup functions
author
Ian Beckwith
<ianb@erislabs.net>
Sun, 17 Oct 2010 04:19:15 +0000
(
05:19
+0100)
committer
Ian Beckwith
<ianb@erislabs.net>
Sun, 17 Oct 2010 04:19:15 +0000
(
05:19
+0100)
lib/ID3FS/DB.pm
patch
|
blob
|
history
lib/ID3FS/PathElement/Album.pm
patch
|
blob
|
history
lib/ID3FS/PathElement/Artist.pm
patch
|
blob
|
history
lib/ID3FS/PathElement/File.pm
patch
|
blob
|
history
lib/ID3FS/PathElement/Tag.pm
patch
|
blob
|
history
lib/ID3FS/PathElement/Tagval.pm
patch
|
blob
|
history
diff --git
a/lib/ID3FS/DB.pm
b/lib/ID3FS/DB.pm
index
1638c54
..
29c50e3
100644
(file)
--- a/
lib/ID3FS/DB.pm
+++ b/
lib/ID3FS/DB.pm
@@
-169,14
+169,6
@@
sub last_update
return $newval;
}
return $newval;
}
-sub id
-{
- my($self, $type, $val)=@_;
- my $sql="SELECT id FROM $type WHERE name=?";
- my ($id)=$self->cmd_onerow($sql, $val);
- return($id);
-}
-
sub tag_has_values
{
my($self, $id)=@_;
sub tag_has_values
{
my($self, $id)=@_;
diff --git
a/lib/ID3FS/PathElement/Album.pm
b/lib/ID3FS/PathElement/Album.pm
index
46836aa
..
9826fd1
100644
(file)
--- a/
lib/ID3FS/PathElement/Album.pm
+++ b/
lib/ID3FS/PathElement/Album.pm
@@
-12,7
+12,7
@@
sub new
$self->{db}=shift;
$self->{name}=shift;
$self->{db}=shift;
$self->{name}=shift;
- $self->{id}=($self->{db}->id("albums", $self->{name}));
+ $self->{id}=($self->{db}->
lookup_
id("albums", $self->{name}));
return(undef) unless(defined($self->{id}));
return $self;
}
return(undef) unless(defined($self->{id}));
return $self;
}
diff --git
a/lib/ID3FS/PathElement/Artist.pm
b/lib/ID3FS/PathElement/Artist.pm
index
9bcf4aa
..
a0bc50b
100644
(file)
--- a/
lib/ID3FS/PathElement/Artist.pm
+++ b/
lib/ID3FS/PathElement/Artist.pm
@@
-12,7
+12,7
@@
sub new
$self->{db}=shift;
$self->{name}=shift;
$self->{db}=shift;
$self->{name}=shift;
- $self->{id}=($self->{db}->id("artists", $self->{name}));
+ $self->{id}=($self->{db}->
lookup_
id("artists", $self->{name}));
return(undef) unless(defined($self->{id}));
return $self;
}
return(undef) unless(defined($self->{id}));
return $self;
}
diff --git
a/lib/ID3FS/PathElement/File.pm
b/lib/ID3FS/PathElement/File.pm
index
6987440
..
7a5a1c7
100644
(file)
--- a/
lib/ID3FS/PathElement/File.pm
+++ b/
lib/ID3FS/PathElement/File.pm
@@
-12,7
+12,7
@@
sub new
$self->{db}=shift;
$self->{name}=shift;
$self->{db}=shift;
$self->{name}=shift;
- $self->{id}=$self->{db}->id("files", $self->{name});
+ $self->{id}=$self->{db}->
lookup_
id("files", $self->{name});
return(undef) unless(defined($self->{id}));
return $self;
}
return(undef) unless(defined($self->{id}));
return $self;
}
diff --git
a/lib/ID3FS/PathElement/Tag.pm
b/lib/ID3FS/PathElement/Tag.pm
index
3185955
..
ad68f06
100644
(file)
--- a/
lib/ID3FS/PathElement/Tag.pm
+++ b/
lib/ID3FS/PathElement/Tag.pm
@@
-13,7
+13,7
@@
sub new
$self->{db}=shift;
$self->{name}=shift;
$self->{parents_id}=shift;
$self->{db}=shift;
$self->{name}=shift;
$self->{parents_id}=shift;
- $self->{id}=$self->{db}->id("tags", $self->{name});
+ $self->{id}=$self->{db}->
lookup_
id("tags", $self->{name});
return(undef) unless(defined($self->{id}));
return($self);
}
return(undef) unless(defined($self->{id}));
return($self);
}
diff --git
a/lib/ID3FS/PathElement/Tagval.pm
b/lib/ID3FS/PathElement/Tagval.pm
index
255e2a0
..
3b2a77b
100644
(file)
--- a/
lib/ID3FS/PathElement/Tagval.pm
+++ b/
lib/ID3FS/PathElement/Tagval.pm
@@
-12,7
+12,7
@@
sub new
$self->{db}=shift;
$self->{name}=shift;
$self->{db}=shift;
$self->{name}=shift;
- $self->{id}=$self->{db}->id("tagvals", $self->{name});
+ $self->{id}=$self->{db}->
lookup_
id("tagvals", $self->{name});
return(undef) unless(defined($self->{id}));
return $self;
}
return(undef) unless(defined($self->{id}));
return $self;
}