[Slim-Checkins] r33717 - /7.7/trunk/server/Slim/Networking/SqueezeNetwork/Stats.pm

[email protected]
Newsgroups gmane.music.equipment.slimdevices.cvs
Message-ID <[email protected]>
Author: ayoung
Date: Thu Nov 17 05:38:09 2011
New Revision: 33717

URL: http://svn.slimdevices.com/slim?rev=33717&view=rev
Log:
Include local music service in reported statistics (without metadata).

Modified:
    7.7/trunk/server/Slim/Networking/SqueezeNetwork/Stats.pm

Modified: 7.7/trunk/server/Slim/Networking/SqueezeNetwork/Stats.pm
URL: http://svn.slimdevices.com/slim/7.7/trunk/server/Slim/Networking/SqueezeNetwork/Stats.pm?rev=33717&r1=33716&r2=33717&view=diff
==============================================================================
--- 7.7/trunk/server/Slim/Networking/SqueezeNetwork/Stats.pm (original)
+++ 7.7/trunk/server/Slim/Networking/SqueezeNetwork/Stats.pm Thu Nov 17 05:38:09 2011
@@ -84,9 +84,6 @@
 	
 	my $url = Slim::Player::Playlist::url($client);
 	
-	# Make sure the URL matches what we want to report
-	return unless $url =~ $REPORT_RE;
-	
 	my $track = Slim::Schema->objectForUrl( { url => $url } );
 	
 	my $secs = $track->secs || 0;
@@ -96,6 +93,19 @@
 	if ( !$secs && !defined $request->getParam('_p3') ) {
 		main::DEBUGLOG && $log->debug( 'Ignoring radio station newsong metadata notification' );
 		return;
+	}
+	
+	if (!Slim::Music::Info::isRemoteURL($url)) {
+		my $id = $track->id;
+		
+		if ($id > 0) {
+			# Make sure the URL matches what we want to report
+			$url = 'local://trackId=' . $id;
+		} else {
+			return;
+		}
+	} else {
+		return unless $url =~ $REPORT_RE;
 	}
 		
 	if ( $secs > 0 ) {
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.