mherger wrote:
> > When I request all albums from an artist, it takes arround 30 seconds
> to
> > display the list (With Ipeng HD, or web interface on PC).
>
> Would this happen with any artist or only a few? If the latter, could
> you please give me an example?
>
> --
>
> Michael
This appen with almost every artists.
I have made some tests and it seems to improve the response time by
adding directly the album list in the QobuzArtist sub
IN API.PM
sub getArtist {
my ($class, $cb, $artistId) = @_;
_get('artist/get', $cb, {
artist_id => $artistId
, extra => 'albums' # returns the album list
});
}
IN PLUGIN.PM
sub QobuzArtist {
my ($client, $cb, $params, $args) = @_;
Plugins::Qobuz::API->getArtist(sub {
my $artist = shift;
if ($artist->{status} && $artist->{status} =~ /error/i)
{
$cb->();
}
my $items = [{
name => cstring($client, 'ALBUMS'),
url => \&QobuzSearch,
image => 'html/images/artists.png',
passthrough => [{
q => $artist->{name},
type => 'albums',
artistId => $artist->{id},
}]
},{
name => cstring($client, 'SONGS'),
url => \&QobuzSearch,
image => 'html/images/playlists.png',
passthrough => [{
q => $artist->{name},
type => 'tracks',
artistId => $artist->{id},
}]
}];
if ($artist->{biography}) {
my $images = $artist->{image} || {};
push @$items, {
name => cstring($client,
'PLUGIN_QOBUZ_BIOGRAPHY'),
image => $images->{mega} ||
$images->{extralarge} || $images->{large} || $images->{medium} ||
$images->{small} || 'html/images/artists.png',
items => [{
name =>
$artist->{biography}->{summary} || $artist->{biography}->{content},
type => 'textarea',
}],
}
}
# Add Albums
my $albums = [];
for my $album ( @{$artist->{albums}->{items}} ) {
push @$items, _albumItem($client, $album);
}
# End Add Albums
$cb->( {
items => $items
} );
}, $args->{artistId});
}
I have also added a 'Artist search' button into the Qobuz menu :
IN PLUGIN.PM
sub handleFeed {
my ($client, $cb, $args) = @_;
my $params = $args->{params};
$cb->({
items => ( $prefs->get('username') &&
$prefs->get('password_md5_hash')
) ? [
{
name => cstring($client, 'SEARCH'),
image => 'html/images/search.png',
type => 'search',
url => \&QobuzSearch
}, {
name => 'Artist search',
image => 'html/images/search.png',
type => 'search',
url => \&QobuzSearch,
passthrough => [{
type => 'artists',
} ]
},
....
With these changes, the albums list is displayed within a couple of
seconds , and Qobuz is usable on the RPI.
------------------------------------------------------------------------
Cfo92130's Profile: http://forums.slimdevices.com/member.php?userid=45196
View this thread: http://forums.slimdevices.com/showthread.php?t=97146
_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins