Author: bklaas
Date: Fri Jun 20 14:46:07 2008
New Revision: 2611

URL: http://svn.slimdevices.com?rev=2611&root=Jive&view=rev
Log:
Bug: 8479
Description: query the icon style's size to determine the size of the thumbnail 
artwork request

Modified:
    
7.1/trunk/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/SlimBrowserApplet.lua

Modified: 
7.1/trunk/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/SlimBrowserApplet.lua
URL: 
http://svn.slimdevices.com/7.1/trunk/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/SlimBrowserApplet.lua?rev=2611&root=Jive&r1=2610&r2=2611&view=diff
==============================================================================
--- 
7.1/trunk/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/SlimBrowserApplet.lua
 (original)
+++ 
7.1/trunk/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/SlimBrowserApplet.lua
 Fri Jun 20 14:46:07 2008
@@ -217,31 +217,37 @@
 -- updates a group widget with the artwork for item
 local function _artworkItem(item, group, menuAccel)
        local icon = group and group:getWidget("icon")
+       local iconSize
+       if icon then
+               iconSize = icon:getSize()
+       else
+               iconSize = THUMB_SIZE
+       end
 
        if item["icon-id"] then
-               if menuAccel and not 
_server:artworkThumbCached(item["icon-id"], THUMB_SIZE) then
+               if menuAccel and not 
_server:artworkThumbCached(item["icon-id"], iconSize) then
                        -- Don't load artwork while accelerated
                        _server:cancelArtwork(icon)
                else
                        -- Fetch an image from SlimServer
-                       _server:fetchArtworkThumb(item["icon-id"], icon, 
THUMB_SIZE)
+                       _server:fetchArtworkThumb(item["icon-id"], icon, 
iconSize)
                end
 
        elseif item["icon"] then
-               if menuAccel and not _server:artworkThumbCached(item["icon"], 
THUMB_SIZE) then
+               if menuAccel and not _server:artworkThumbCached(item["icon"], 
iconSize) then
                        -- Don't load artwork while accelerated
                        _server:cancelArtwork(icon)
                else
-                       -- Fetch a remote image URL, sized to 
THUMB_SIZExTHUMB_SIZE (artwork from a streamed source)
-                       _server:fetchArtworkURL(item["icon"], icon, THUMB_SIZE)
+                       -- Fetch a remote image URL, sized to iconSize x 
iconSize (artwork from a streamed source)
+                       _server:fetchArtworkURL(item["icon"], icon, iconSize)
                end
        elseif item["trackType"] == 'radio' and item["params"] and 
item["params"]["track_id"] then
-               if menuAccel and not 
_server:artworkThumbCached(item["params"]["track_id"], THUMB_SIZE) then
+               if menuAccel and not 
_server:artworkThumbCached(item["params"]["track_id"], iconSize) then
                        -- Don't load artwork while accelerated
                        _server:cancelArtwork(icon)
                        else
                        -- workaround: this needs to be png not jpg to allow 
for transparencies
-                       _server:fetchArtworkThumb(item["params"]["track_id"], 
icon, THUMB_SIZE, 'png')
+                       _server:fetchArtworkThumb(item["params"]["track_id"], 
icon, iconSize, 'png')
                end
        else
                _server:cancelArtwork(icon)
@@ -826,7 +832,7 @@
                                        if data.window['icon-id'] then
                                                -- Fetch an image from 
SlimServer
                                                titleIcon = Icon("icon")
-                                               
_server:fetchArtworkThumb(data.window["icon-id"], titleIcon, THUMB_SIZE)
+                                               
_server:fetchArtworkThumb(data.window["icon-id"], titleIcon, iconSize)
                                        -- only allow the existing icon to stay 
if titleStyle isn't being changed
                                        elseif not data.window.titleStyle and 
titleWidget:getWidget('icon') then
                                                titleIcon = 
titleWidget:getWidget('icon')

_______________________________________________
Jive-checkins mailing list
[email protected]
http://lists.slimdevices.com/cgi-bin/mailman/listinfo/jive-checkins

Reply via email to