Hello,
I am new to gnump3d but I am having much fun setting it up. I encountered some functionality that is broken for Windows users so I would like to propose a patch. Please let me know what you think.
Under the web interface, if you click the "Statistics" tab and then click the link labeled "See what is currently playing" the functionality does not work at all (it always says nothing is currently playing). I patched the gnump3d perl script in two places and it seems to work. Below are the two changes.
Below I just added an isWindows check and put the path to delete the file whenever gnump3d is started. This makes sure any old files are cleaned up.
foreach my $file ( @staleFiles )
{
if (&isWindows( ))
{
unlink( "$NOW_PLAYING_PATH/$file" );
}
else
{
unlink( $file );
}
}
The other change is just to remove the isWindows check (listed below). This is the one I am worried about. Is there some reason that the below code will cause problems if run on windows. It works for me but I am just spot checking so I don't know if there are any other scenarios where this code could cause problems.
#
# Store the request in the "currently playing" directory.
#
if ( ( &isAudio( $testPath ) ) )
{
open( TMP, ">" . $NOW_PLAYING_PATH . "/" . $connected_address . ".txt" );
print TMP $testPath;
close( TMP );
$in_progress = $NOW_PLAYING_PATH . "/" . $connected_address . ".txt" ;
}
Let me know if these changes are acceptable and I will submit them. Otherwise let me know what else to do.
Thanks To All,
Art Beall