Bug 3442 - my $command = "$Bin/scanner.pl"; won't work on Windows
: my $command = "$Bin/scanner.pl"; won't work on Windows
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Database
: 6.5b1
: PC Windows XP
: P2 normal (vote)
: ---
Assigned To: Dan Sully
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-05-23 23:24 UTC by Michael Herger
Modified: 2008-09-15 14:39 UTC (History)
4 users (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Herger 2006-05-23 23:24:44 UTC
Music::Import::launchscan does not work on Windows:

my $command  = "$Bin/scanner.pl";

It needs an executable. We could simply add the "perl $Bin/scanner.pl" for Windows, but how is this handled in the "compiled" executable?
Comment 1 Dan Sully 2006-05-25 18:09:33 UTC
Oh yeah.. that's a good point. :)

Gotta remember that not everyone has ActiveState installed.

Comment 2 sbjaerum 2006-05-27 12:45:20 UTC
I am now at 7673. WinXP with ActiveState Perl.

I get the following error when slimserver tries to start a scan:
2006-05-27 21:30:56.2031 C:\slimLatest\trunk\server\slimserver.pl: no executable program located at C:/slimLatest/trunk/server/scanner.pl

If I change
my $command  = "$Bin/scanner.pl";
to
my $command  = "perl $Bin/scanner.pl";
as Michael suggests, I get the following error:
2006-05-27 21:33:23.4942 C:\slimLatest\trunk\server\slimserver.pl: cannot find absolute location of perl C:/slimLatest/trunk/server/scanner.pl
Comment 3 Nestor 2006-05-28 12:23:40 UTC
Im having the same issue while running 6.5b1 on WinXp and ActiveState 5.8.7, latest revision:

2006-05-27 11:10:28.8763 slimserver.pl: no executable program located at D:/soft
/Slimserver/server/scanner.pl
Comment 4 Philip Meyer 2006-05-29 09:36:26 UTC
I created a scanner.bat batch script to invoke "perl scanner.pl %1", and changed import.pm to execute scanner.bat.

I still get errors though:

2006-05-29 17:24:06.8224 Use of uninitialized value in hash element at P:/Music/SlimServer/trunk/server/Slim/Networking/Select.pm line 147.
2006-05-29 17:24:07.0575 Use of uninitialized value in hash element at P:/Music/SlimServer/trunk/server/Slim/Networking/Select.pm line 147.
$VAR1 = {
          'album' => 'track',
          'contributor' => 'album'
        };
$VAR1 = {};
2006-05-29 17:24:07.2277 find:
$VAR1 = {};
2006-05-29 17:24:07.2278 running resultset on: contributor
working on level: [Contributor]
Calling method: [browse]
2006-05-29 17:24:07.2625 Argument "level" isn't numeric in addition (+) at P:/Music/SlimServer/trunk/server/Slim/Web/Pages/Status.pm line 136.
2006-05-29 17:24:07.2627 Argument "level" isn't numeric in addition (+) at P:/Music/SlimServer/trunk/server/Slim/Web/Pages/Status.pm line 137.


And if I try to run scanner.pl manually:

DBD::mysql::st execute failed: Incorrect integer value: '' for column 'rating' a
t row 1 at P:\Music\SlimServer\trunk\server\CPAN/DBIx/Class/Storage/DBI.pm line
525.
2006-05-29 17:27:07.6215 Backtrace:

   frame 0: Slim::Schema::newTrack (P:/Music/SlimServer/trunk/server/Slim/Utils/
Scanner.pm line 211)
   frame 1: Slim::Utils::Scanner::scanDirectory (P:/Music/SlimServer/trunk/serve
r/Slim/Utils/Scanner.pm line 194)
   frame 2: Slim::Utils::Scanner::scanDirectory (P:/Music/SlimServer/trunk/serve
r/Slim/Music/MusicFolderScan.pm line 64)
   frame 3: Slim::Music::MusicFolderScan::startScan (P:/Music/SlimServer/trunk/s
erver/Slim/Music/Import.pm line 164)
   frame 4: Slim::Music::Import::runImporter (P:/Music/SlimServer/trunk/server/S
lim/Music/Import.pm line 77)
   frame 5: Slim::Music::Import::startScan (P:\Music\SlimServer\trunk\server\sca
nner.pl line 132)
   frame 6: main::main (P:\Music\SlimServer\trunk\server\scanner.pl line 229)

2006-05-29 17:27:07.6220 ERROR: newTrack: Couldn't create Track for file:///M:/M
usic/Alex%27s%20Music/Lenny%20Kravitz/Greatest%20Hits/04%20-%20Again.wma : DBIx:
:Class::ResultSet::create(): Error executing 'INSERT INTO tracks (audio, audio_s
ize, bitrate, channels, content_type, drm, filesize, lossless, rating, remote, s
amplerate, secs, tag, timestamp, title, titlesearch, titlesort, tracknum, url, v
br_scale, year) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
 ?, ?)' (`1', `3692980', `128016', `2', `wma', `0', `3692980', `0', `', `0', `44
100', `228.933', `1', `1134923388', `Again', `AGAIN', `AGAIN', `4', `file:///M:/
Music/Alex%27s%20Music/Lenny%20Kravitz/Greatest%20Hits/04%20-%20Again.wma', `0',
 `2000'): DBD::mysql::st execute failed: Incorrect integer value: '' for column
'rating' at row 1 at P:\Music\SlimServer\trunk\server\CPAN/DBIx/Class/Storage/DB
I.pm line 525.
Comment 5 Dan Sully 2006-06-06 14:52:26 UTC
So the original bug here has been fixed.

Phil - can you open a new bug with the rating issue, and attach that wma file to it?

Thanks.