Author: mherger
Date: Thu Nov 3 09:32:35 2011
New Revision: 33649
URL: http://svn.slimdevices.com/slim?rev=33649&view=rev
Log:
Bug: n/a
Description: we need to push RemoteTrack objects on the playlist, not only their URLs
Modified:
7.7/trunk/server/Slim/Plugin/MOG/ProtocolHandler.pm
Modified: 7.7/trunk/server/Slim/Plugin/MOG/ProtocolHandler.pm
URL: http://svn.slimdevices.com/slim/7.7/trunk/server/Slim/Plugin/MOG/ProtocolHandler.pm?rev=33649&r1=33648&r2=33649&view=diff
==============================================================================
--- 7.7/trunk/server/Slim/Plugin/MOG/ProtocolHandler.pm (original)
+++ 7.7/trunk/server/Slim/Plugin/MOG/ProtocolHandler.pm Thu Nov 3 09:32:35 2011
@@ -187,7 +187,7 @@
$log->debug( 'getRadioTracks ok: ' . Data::Dump::dump($info) );
}
- my @urls;
+ my @tracks;
foreach my $track ( @$info ) {
next unless ref $track eq 'HASH';
@@ -211,10 +211,21 @@
$cache->set( 'mog_meta_' . $trackId, $meta, 86400 );
my $url = 'mog://' . $http->params->{radioId} . '-' . $trackId . '.mp3';
- push @urls, $url;
- }
-
- $client->execute([ 'playlist', 'addtracks', 'listRef', \@urls ]);
+
+ push @tracks, Slim::Schema->updateOrCreate( {
+ 'url' => $url,
+ 'attributes' => {
+ title => $meta->{title},
+ album => $meta->{album},
+ cover => $meta->{cover},
+ duration => $meta->{duration},
+ year => $meta->{year},
+ CT => 'mp3',
+ },
+ } );
+ }
+
+ $client->execute([ 'playlist', 'addtracks', 'listRef', \@tracks ]);
$client->execute([ 'play' ]);
# Update the playlist time so the web will refresh, etc
@@ -527,8 +538,6 @@
my ($trackId, $radioId) = getIds($url);
if ( $radioId ) {
- main::DEBUGLOG && $log->debug( "Need to queue up new MOG Radio tracks... $radioId" );
-
my $pos = Slim::Player::Source::playingSongIndex($client);
# remove played/skipped tracks from queue
@@ -539,6 +548,7 @@
my $length = Slim::Player::Playlist::count($client);
if ($length < MIN_RADIO_QUEUE) {
+ main::DEBUGLOG && $log->debug( "Need to queue up new MOG Radio tracks... $radioId" );
_getRadioTracks($client, $radioId);
}
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.