Bug 15949 - Adding >100 tracks from remote source (OMPL) makes blank entries in NP on SP and WebUI
: Adding >100 tracks from remote source (OMPL) makes blank entries in NP on SP ...
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Misc
: unspecified
: PC Other
: P2 normal (vote)
: 7.6.0
Assigned To: Alan Young
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2010-03-25 09:15 UTC by Wadzinski Tom
Modified: 2011-05-17 13:19 UTC (History)
4 users (show)

See Also:
Category: Bug


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wadzinski Tom 2010-03-25 09:15:13 UTC
I think I've found the source of the problem. In RemoteTrack:fetch(), shown below, a cache lookup occurs, and since the cache size is 100 items, a list over 100 items will produce null results. As a test, I increased the cache size to 500 and the problem went away.

Summary:
Using 7.5 r30391 (and have seen on earlier versions), when playing a playlist that is over 100 tracks from an opml stream, on the NP screen on SqueezePlay and WebUI, all of the items (expect the current playing item) appear as blank items in the np list


Suggested fixes: either a) have fetch() deal with the "cache missing the item" case, and reload the item, and/or b) increase the cache size from it's current 100.

To repro this, go to 7.5->Internet Radio->Staff Picks->Tom's Picks->Planktonic Stream Dreams->User Ratings and select play on "twadzinski", then go to the np list.

sub fetch {
	my ($class, $url, $playlist) = @_;
	
	my $self = $Cache{$url};
	my $id = $idIndex{$self->id} if $self; # refresh ID index cache
	
	if ($self && $playlist && !$self->isa('Slim::Schema::RemotePlaylist')) {
		main::DEBUGLOG && $log->is_debug && $log->debug("$url upcast to RemotePlaylist");
		bless $self, 'Slim::Schema::RemotePlaylist';
	}
	
	return $self;
}


# Keep a cache of up to 100 remote tracks at a time.
tie our %Cache, 'Tie::Cache::LRU', 100;
tie our %idIndex, 'Tie::Cache::LRU', 100;
Comment 1 Andy Grundman 2010-03-25 09:24:42 UTC
Assigning to Alan since that's his code.
Comment 2 SVN Bot 2010-08-24 00:17:48 UTC
 == Auto-comment from SVN commit #31254 to the slim repo by ayoung ==
 == http://svn.slimdevices.com/slim?view=revision&revision=31254 ==

Fixed bug 15949: Adding >100 tracks from remote source (OMPL) makes blank entries in NP on SP and WebUI 
Let RemoteTrack cache size grow to match maxPlaylistLength up to a limit of 500.

This is not an ideal solution but should cover most use-cases.
Comment 3 SVN Bot 2010-09-30 23:23:27 UTC
 == Auto-comment from SVN commit #31401 to the slim repo by ayoung ==
 == http://svn.slimdevices.com/slim?view=revision&revision=31401 ==

bug 15949: Adding >100 tracks from remote source (OMPL) makes blank entries in NP on SP and WebUI
Comment 4 Paul Chandler 2011-05-17 13:19:55 UTC
Fix verified on 7.6.32427   - Loaded that same list and the NP was fine on player and WebUI