App-pimpd
view release on metacpan or search on metacpan
lib/App/Pimpd/Collection/Search.pm view on Meta::CPAN
394041424344454647484950515253545556575859my
$artist
=
shift
;
# Not a regex
return
if
!
$artist
;
my
@tracks
=
$mpd
->collection->songs_by_artist_partial(
$artist
);
if
(!
@tracks
) {
return
;
}
# check if called from the interactive shell
my
$caller_sub
= (
caller
(1))[3];
if
(
$caller_sub
=~ m/App::Pimpd::Shell/) {
"$_\n"
for
map
{
sprintf
(
"%s [%s] %s"
,
$_
->artist,
$_
->album,
$_
->title);
}
@tracks
;
}
map
{
$_
=
$_
->file }
@tracks
;
return
(
wantarray
()) ?
@tracks
:
scalar
(
@tracks
);
lib/App/Pimpd/Collection/Search.pm view on Meta::CPAN
626364656667686970717273747576777879808182sub
search_db_title {
my
$title
=
shift
;
return
if
!
$title
;
my
@titles
=
$mpd
->collection->songs_with_title_partial(
$title
);
if
(!
@titles
) {
return
;
}
# check if called from the interactive shell
my
$caller_sub
= (
caller
(1))[3];
if
(
$caller_sub
=~ m/App::Pimpd::Shell/) {
"$_\n"
for
map
{
sprintf
(
"%s [%s] %s"
,
$_
->artist,
$_
->album,
$_
->title);
}
@titles
;
}
map
{
$_
=
$_
->file }
@titles
;
return
(
wantarray
()) ?
@titles
:
scalar
(
@titles
);
lib/App/Pimpd/Collection/Search.pm view on Meta::CPAN
858687888990919293949596979899100101102103104105sub
search_db_album {
my
$album
=
shift
;
return
if
!
$album
;
my
@albums
=
$mpd
->collection->songs_from_album_partial(
$album
);
if
(!
@albums
) {
return
;
}
# check if called from the interactive shell
my
$caller_sub
= (
caller
(1))[3];
if
(
$caller_sub
=~ m/App::Pimpd::Shell/) {
"$_\n"
for
map
{
sprintf
(
"%s [%s] %s"
,
$_
->artist,
$_
->album,
$_
->title);
}
@albums
;
}
map
{
$_
=
$_
->file }
@albums
;
return
(
wantarray
()) ?
@albums
:
scalar
(
@albums
);
( run in 0.231 second using v1.01-cache-2.11-cpan-55f5a4728d2 )