Author: bklaas
Date: Wed Feb 27 14:22:25 2008
New Revision: 2064

URL: http://svn.slimdevices.com?rev=2064&root=Jive&view=rev
Log:
Bug: 7330
Description: manual merge up to trunk for checkins done on 7.0 branch.

Modified:
    trunk/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/DB.lua

Modified: trunk/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/DB.lua
URL: 
http://svn.slimdevices.com/trunk/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/DB.lua?rev=2064&root=Jive&r1=2063&r2=2064&view=diff
==============================================================================
--- trunk/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/DB.lua 
(original)
+++ trunk/squeezeplay/src/squeezeplay/share/applets/SlimBrowser/DB.lua Wed Feb 
27 14:22:25 2008
@@ -231,11 +231,20 @@
        if not self.store[0] then
                return 0, BLOCK_SIZE
        end
+       
+       local count = tonumber(self.last_chunk.count)
 
        -- load last chunk
-       local lastKey = math.modf(self.last_chunk.count / BLOCK_SIZE)
-       if not self.store[lastKey] then
-               return lastKey * BLOCK_SIZE, BLOCK_SIZE
+       local lastKey = 0
+       if count > BLOCK_SIZE then
+               lastKey = math.modf(count / BLOCK_SIZE)
+               if not self.store[lastKey] then
+                       if lastKey * BLOCK_SIZE != count then
+                               return lastKey * BLOCK_SIZE, BLOCK_SIZE
+                       else
+                               return lastKey * BLOCK_SIZE - 1, BLOCK_SIZE
+                       end
+               end
        end
 
        -- otherwise load in the direction of scrolling

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

Reply via email to