Mnyb;669593 Wrote:
> I get the same error with trackstat installed .
>
> I'm trying to use Sugarcube (newb at that too )
>
I believe this is something else and it's not related to TrackStat.
This is caused by SugarCube using "'order_by' => \'RAND()'" in a number
of places.
This needs to be handled differently for SQLite and MySQL, so the
proper code would instead of:
Code:
--------------------
$diditwork = Slim::Schema->rs('Track')->search({'audio'=>1,'remote'=>0},{
'order_by' => \'RAND()'})->first;
--------------------
Look something like:
Code:
--------------------
my $randomFunc =
Slim::Utils::OSDetect->getOS()->sqlHelperClass()->randomFunction();
$diditwork = Slim::Schema->rs('Track')->search({'audio'=>1,'remote'=>0},{
'order_by' => \$randomFunc})->first;
--------------------
To make it work in both MySQL and SQLite.
The same thing needs to be handled in a number of places in SugarCube
code.
The current SugarCube 2.65 release which uses RAND() will only work
with MySQL database backend, which means 7.6 and later won't work
unless you have manually configured it to use MySQL. Not sure if there
is a newer corrected version available for donating SugarCube users.
--
erland
Erland Isaksson ('My homepage' (http://erland.isaksson.info))
(Developer of 'many plugins/applets (both free and commercial)'
(http://wiki.slimdevices.com/index.php/User:Erland).
If you like to encourage future presence on this forum and/or third
party plugin/applet development, 'consider purchasing some plugins'
(http://license.isaksson.info))
Interested in music discovery ? See 'Social Music Discovery (SMD)'
(http://forums.slimdevices.com/showthread.php?p=656713) project.
------------------------------------------------------------------------
erland's Profile: http://forums.slimdevices.com/member.php?userid=3124
View this thread: http://forums.slimdevices.com/showthread.php?t=91406
_______________________________________________
plugins mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/plugins