erland;629264 Wrote:
> Put this somewhere at the top of the file together with all the other
> rows that starts with "use":
> >
Code:
--------------------
> >
> use File::Spec::Functions qw(:ALL);
>
--------------------
> >
>
> And then replace:
> >
Code:
--------------------
> >
> my $path ||= Slim::Utils::OSDetect::dirsFor('prefs');
> $path = $path . '\plugin\sugarcube.db';
>
--------------------
> >
> With:
> >
Code:
--------------------
> >
> my $path ||= Slim::Utils::OSDetect::dirsFor('prefs');
> $path = catfile($path,'plugin','sugarcube.db');
>
--------------------
> >
Hi erland, many thanks for your reply.
Your code change creates the correct file (sugarcube.db) in the correct
location but then SugarCube can't find the file when it tries to
read/write the database. There are a number of subroutines which
read/write to the db and they all contain those two lines of code. I
replaced all occurrences with your code but for some reason for the
read/write subroutines the path changes.
The following error from the SbS log indicates the problem...
[11-05-04 19:03:32.1194] Plugins::SugarCube::Plugin::buildMIPReq (1259)
Sent URL;
http://localhost:10002/api/mix?song%3d%2Fshare%2FAudio%2FMusic%2FKate%20Rusby%2FWho%20Knows%20Where%20the%20Time%20Goes%2F01%20Kate%20Rusby%20-%20Who%20Knows%20Where%20the%20Time%20Goes.flac&style=150&variety=2
[11-05-04 19:03:32.1304] Slim::Utils::Misc::msg (1212) Warning:
[19:03:32.1302] DBI
connect('/opt/ssods4/var/home/SqueezeboxServer/Prefs/plugin/sugarcube.db/plugin/sugarcube.db','',...)
failed: unable to open database file at
/opt/ssods4/var/home/SqueezeboxServer/Cache/InstalledPlugins/Plugins/SugarCube/breakout.pm
line 318
[11-05-04 19:03:32.1307] Slim::Control::Request::notify (2088) Error:
Failed notify: SugarCube Database Not Ready.. Please Wait 5 secs and
retry
The calling line (318) is as follows...
my $dbh = DBI->connect( "dbi:SQLite:$path" ) or die "SugarCube Database
Not Ready.. Please Wait 5 secs and retry\n";
The path should be:
/opt/ssods4/var/home/SqueezeboxServer/Prefs/plugin/sugarcube.db
........but shows as:
/opt/ssods4/var/home/SqueezeboxServer/Prefs/plugin/sugarcube.db/plugin/sugarcube.db
Sorry to be such a numpty - I only have basic understanding of all
this! Can you suggest how to correct this code so that the database can
be read/written to?
Bob
P.S. Does all that make sense?
--
bobertuk
1 x Touch - SC 7.6.0 - SSOTS v4.91
1 x Radio
1 x Boom
Lavry DA-10 DAC
QNAP TS-509 3.3.6 build 1110T
Starfish Pre-amp : Based on NAIM
Heavily modified NAIM NAP 250 Power-amp
Behringer DEQ2496
Linn Isobarik DMS
------------------------------------------------------------------------
bobertuk's Profile: http://forums.slimdevices.com/member.php?userid=30376
View this thread: http://forums.slimdevices.com/showthread.php?t=87490
_______________________________________________
unix mailing list
[email protected]
http://lists.slimdevices.com/mailman/listinfo/unix