1361 |
# Get the extra details from teh files there. |
# Get the extra details from teh files there. |
1362 |
# |
# |
1363 |
# Only read the tags if we want them. |
# Only read the tags if we want them. |
1364 |
|
# |
1365 |
if ( $advanced_playlist ) |
if ( $advanced_playlist ) |
1366 |
{ |
{ |
1367 |
$tags = ""; |
$tags = ""; |
1368 |
$tags = getSongDisplay( $file ) . "\n"; |
$tags = getSongDisplay( $file ) . "\n"; |
1369 |
if ( not ( $tags =~ /^#/ ) ) |
if ( not ( $tags =~ /^#/ ) ) |
1370 |
{ |
{ |
1371 |
# Song doesnt contain tags ... |
# Song doesnt contain tags ... |
1372 |
$tags = "#" |
$tags = "#EXTINF:00:00,$file\n"; |
1373 |
} |
} |
1374 |
} |
} |
1375 |
|
|
1376 |
if ($file =~ /$ROOT(.*)/) |
if ($file =~ /$ROOT(.*)/) |
1377 |
{ |
{ |
1378 |
$file = $1; |
$file = $1; |
1379 |
} |
} |
1380 |
|
|
1381 |
if ( ! $recursive ) |
if ( ! $recursive ) |
1382 |
{ |
{ |
1383 |
$file = $dir . "/" . $file; |
$file = $dir . "/" . $file; |
1384 |
} |
} |
1385 |
|
|
1386 |
if ( $file =~ /(.*)\/\/(.*)/ ) |
if ( $file =~ /(.*)\/\/(.*)/ ) |
1387 |
{ |
{ |
1388 |
$file = $1 . "/" . $2; |
$file = $1 . "/" . $2; |
1389 |
} |
} |
1390 |
|
|
1391 |
|
# |
1392 |
|
# Escape the filename. |
1393 |
|
# |
1394 |
$file = "http://" . $host . urlEncode( $file ) . $quality; |
$file = "http://" . $host . urlEncode( $file ) . $quality; |
1395 |
|
|
1396 |
|
# |
1397 |
|
# Add to the playlist |
1398 |
$final .= $tags; |
$final .= $tags; |
1399 |
$final .= $file . "\n"; |
$final .= $file . "\n"; |
1400 |
} |
} |
2839 |
# |
# |
2840 |
# Setup the default configuration file which will be read |
# Setup the default configuration file which will be read |
2841 |
# in the absence of command line flags. |
# in the absence of command line flags. |
2842 |
# users ~/.gnump3drc over the system wide one. |
# |
2843 |
|
# A users personal file overrides the system wide one, this |
2844 |
|
# is assumed to be: ~/.gnump3drc |
2845 |
# |
# |
2846 |
if ( ( $ENV{"HOME"} ) && |
if ( ( $ENV{"HOME"} ) && |
2847 |
( -e $ENV{"HOME"} . "/.gnump3drc" ) ) |
( -e $ENV{"HOME"} . "/.gnump3drc" ) ) |
2848 |
{ |
{ |
2849 |
$CONFIG_FILE = $ENV{"HOME"} . "/.gnump3drc"; |
$CONFIG_FILE = $ENV{"HOME"} . "/.gnump3drc"; |
|
} |
|
|
elsif ( -e "/etc/gnump3d/gnump3d.conf" ) |
|
|
{ |
|
|
$CONFIG_FILE = "/etc/gnump3d/gnump3d.conf"; |
|
2850 |
} |
} |
2851 |
elsif ( -e "gnump3d.conf" ) |
elsif ( -e "gnump3d.conf" ) |
2852 |
{ |
{ |
2853 |
# This is mainly here for Windows users. |
# This is mainly here for Windows users. |
2854 |
$CONFIG_FILE = "gnump3d.conf"; |
$CONFIG_FILE = "gnump3d.conf"; |
2855 |
} |
} |
2856 |
|
elsif ( -e "/etc/gnump3d/gnump3d.conf" ) |
2857 |
|
{ |
2858 |
|
# None of the others are present, use the system wide one. |
2859 |
|
$CONFIG_FILE = "/etc/gnump3d/gnump3d.conf"; |
2860 |
|
} |
2861 |
|
|
2862 |
|
|
2863 |
GetOptions( |
GetOptions( |
2864 |
"background", \$BACKGROUND, |
"background", \$BACKGROUND, |
2865 |
"config=s", \$CONFIG_FILE, |
"config=s", \$CONFIG_FILE, |
2866 |
"debug", \$DEBUG, |
"debug", \$DEBUG, |
2867 |
"fast", \$FAST_START, |
"fast", \$FAST_START, |
2868 |
"help", \$SHOW_HELP, |
"help", \$SHOW_HELP, |
2869 |
"version", \$SHOW_VERSION, |
"version", \$SHOW_VERSION, |
2870 |
"quiet", \$QUIET, |
"quiet", \$QUIET, |
2871 |
"plugin=s", \$CMD_PLUGIN_DIR, |
"plugin=s", \$CMD_PLUGIN_DIR, |
2872 |
"plugin-dir=s", \$CMD_PLUGIN_DIR, |
"plugin-dir=s", \$CMD_PLUGIN_DIR, |
2873 |
"test", \$ENVIRONMENT, |
"test", \$ENVIRONMENT, |
2874 |
"theme-dir=s", \$CMD_THEME_DIR, |
"theme-dir=s", \$CMD_THEME_DIR, |
2875 |
"default-theme=s", \$default_theme, |
"default-theme=s", \$default_theme, |
2876 |
"dump-plugins", \$SHOW_PLUGINS, |
"dump-plugins", \$SHOW_PLUGINS, |
2877 |
"port=s", \$CMD_PORT, |
"port=s", \$CMD_PORT, |
2878 |
"root=s", \$CMD_ROOT, |
"root=s", \$CMD_ROOT, |
2879 |
"lang=s", \$CMD_LANG |
"lang=s", \$CMD_LANG |
2880 |
); |
); |
2881 |
|
|
2882 |
|
|
2883 |
# |
# |
2890 |
{ |
{ |
2891 |
# Running in the background implies running |
# Running in the background implies running |
2892 |
# quietly. |
# quietly. |
2893 |
$QUIET += 1; |
$QUIET = 1; |
2894 |
} |
} |
2895 |
if ( $SHOW_HELP ) |
if ( $SHOW_HELP ) |
2896 |
{ |
{ |
2906 |
} |
} |
2907 |
if ( $SHOW_PLUGINS ) |
if ( $SHOW_PLUGINS ) |
2908 |
{ |
{ |
2909 |
|
# |
2910 |
# Read in the configuration file. |
# Read in the configuration file. |
2911 |
&readConfigFile(); |
&readConfigFile(); |
2912 |
|
|
3083 |
if ( ! -d $theme_dir . "/" . $default_theme ) { |
if ( ! -d $theme_dir . "/" . $default_theme ) { |
3084 |
my $error = $literals->get( "DEFAULT_THEME_MISSING" ); |
my $error = $literals->get( "DEFAULT_THEME_MISSING" ); |
3085 |
print $error; |
print $error; |
3086 |
exit; |
exit; |
3087 |
} |
} |
3088 |
|
|
3089 |
# |
# |
3219 |
close( LOGGER ); |
close( LOGGER ); |
3220 |
} |
} |
3221 |
|
|
|
# |
|
|
# Unlock and close the logfile. |
|
3222 |
} |
} |
3223 |
|
|