mherger wrote:
> $client->playingSong()->currentTrack()->id()
>
> I haven't tested this. If it doesn't work, I suggest you investigate
> what you get for the playingSong(), then the currentTrack() etc.
> [color=blue]
Thanks. I figured it out eventually. The track object was actually
provided, just needed -my $track = shift- in the end.
I have one issue/bug I would like to fix - and which I think is caused
by how I use *Slim::Menu::BrowseLibrary*.
I'm trying to create an -artist- (Top Rated by Artist) and a -genre-
(Top Rated by Genre) -menu- for my virtual library FAVS (of top rated
tracks). The virtual library has exactly the number of tracks it should
have. So no problem there.
However, on the second level down (= in the -artists menu-:
artists->*albums* and in the -genre menu-: genres->*artists*) I have
quite a number of albums (in the case of the Top Rated by Genre menu
that would be artists) that shouldn't be there and which have no
tracks/are empty (which is correct because they are not top rated and
are not even part of the virtual library FAVS). But they shouldn't show
up in the first place.
I've tried to recreate the genre menu (Top Rated by Genre) with Custom
Browse to see if my music files or my LMS settings are causing this. But
CustomBrowse -somehow- gets it right and shows only entries that should
be there.
So that has me thinking the way I call -Slim::Menu::BrowseLibrary- in
the code below is wrong or missing something that filters out all those
empty dummy artists/albums that don't belong there.
Do you have any idea how I could tweak my use of
Slim::Menu::BrowseLibrary to get rid of the empty artist/album entries
on the second menu level?
Code:
--------------------
Slim::Menu::BrowseLibrary->registerNode({
type => 'link',
name => 'MENUGROUP',
id => 'custommenus',
feed => sub {
my ($client, $cb, $args, $pt) = @_;
my @items = ();
# Top Rated Artists Menu
$pt = { library_id => Slim::Music::VirtualLibraries->getRealId('FAVS')
};
push @items,{
type => 'link',
name => string('TOP_RATED_ARTISTS'),
url => \&Slim::Menu::BrowseLibrary::_artists,
icon => 'html/images/artists.png',
jiveIcon => 'html/images/artists.png',
id =>
string('myMusicArtists_TOP_RATED_TracksByArtist'),
condition => \&Slim::Menu::BrowseLibrary::isEnabledNode,
weight => 210,
cache => 1,
passthrough => [{
library_id => $pt->{'library_id'},
searchTags => [
'library_id:'.$pt->{'library_id'}
],
}],
};
# Top Rated Genres Menu
$pt = { library_id => Slim::Music::VirtualLibraries->getRealId('FAVS')
};
push @items,{
type => 'link',
name => string('TOP_RATED_GENRES'),
url => \&Slim::Menu::BrowseLibrary::_genres,
icon => 'html/images/genres.png',
jiveIcon => 'html/images/genres.png',
id =>
string('myMusicGenres_TOP_RATED_TracksByGenres'),
condition => \&Slim::Menu::BrowseLibrary::isEnabledNode,
weight => 211,
cache => 1,
passthrough => [{
library_id => $pt->{'library_id'},
searchTags => [
'library_id:'.$pt->{'library_id'}
],
}],
};
$cb->({
items => \@items,
});
},
(...)
--------------------
------------------------------------------------------------------------
afriend's Profile: http://forums.slimdevices.com/member.php?userid=39306
View this thread: http://forums.slimdevices.com/showthread.php?t=109334
_______________________________________________
discuss mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/discuss