Bug 10533 - need accessor to _pluginData not tied to sync groups
: need accessor to _pluginData not tied to sync groups
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Misc
: 7.3.1
: All All
: P1 enhancement (vote)
: 7.x
Assigned To: Andy Grundman
http://forums.slimdevices.com/showthr...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-01-03 20:39 UTC by Peter Watkins
Modified: 2009-07-31 10:33 UTC (History)
2 users (show)

See Also:
Category: ---


Attachments
patch providing clientPluginData() method (1.26 KB, patch)
2009-01-03 20:39 UTC, Peter Watkins
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Watkins 2009-01-03 20:39:51 UTC
Created attachment 4539 [details]
patch providing clientPluginData() method

The pluginData() method in Slim::Player::Client is intended to give 3rd party developers a way to stash runtime information in client objects, to help prevent memory leaks & make garbage collection easier than it would be with the old technique of class-scoped hash arrays using $client->id() as the key. 

But the pluginData() method is tied not to specific clients -- it's tied to sync groups (as of SVN change 12808). Some plugins need to associate information with specific players without regard to sync groups, and currently there is no way to do that with the recommended pluginData() technique -- so developers must continue to use class-scoped global hash arrays. 

This patch, which has NOT been tested much, provides a new method, clientPluginData(), whose usage is identical to pluginData() but which uses the client object specified by the caller, and pays no attention to sync groups (as pluginData() itself did prior to SVN change 12808) so existing code that uses plain pluginData() will continue to work.
Comment 1 Adrian Smith 2009-01-04 03:14:00 UTC
Andy?

I tend to favor migrating all the current usage to $client->master->pluginData as I think plugin authors will already be using pluginData eroneously for non streaming state.  But either way I suggest we put something into 7.3.2 so Peter's plugin can be migrated...

Comment 2 Andy Grundman 2009-01-05 10:54:41 UTC
Change 24510.

I went with Triode's suggestion.  $client->pluginData no longer calls master, and all existing uses of pluginData have been changed to $client->master->pluginData.
Comment 3 James Richardson 2009-01-16 09:41:37 UTC
Peter: does this address your request?
Comment 4 Peter Watkins 2009-01-17 16:11:47 UTC
Yes, this resolves my concerns very well, thank you!
Comment 5 James Richardson 2009-01-22 09:59:01 UTC
Fixed - Closed Message (SC)

This bug has been fixed in the 7.3.3 release version of SqueezeCenter!

Please download the new version from http://www.slimdevices.com/su_downloads.html if you haven't already.  

If you are still experiencing this problem, feel free to reopen the bug with your new comments and we'll have another look.
Comment 6 James Richardson 2009-01-22 13:54:50 UTC
Correction: SqueezeCenter version is 7.3.2
Comment 7 Chris Owens 2009-07-31 10:33:54 UTC
Reduce number of active targets for SC