Disable caching by default, remove --caching argument
[app-musicexpo.git] / lib / App / MusicExpo.pm
index 475ef80f971dba4595ef3975a2637f997e9d531d..42526fa749045cc5c48326874770c78427e7ca38 100644 (file)
@@ -19,15 +19,13 @@ use Storable qw/thaw freeze/;
 my $default_template;
 
 our $prefix='/music/';
-our $cache='cache.db';
-our $caching=1;
+our $cache='';
 our $template='';
 
 GetOptions (
   "template=s" => \$template,
   "prefix=s" => \$prefix,
   "cache=s" => \$cache,
-  "caching!" => \$caching,
 );
 
 
@@ -76,9 +74,9 @@ sub normalizer{
 }
 
 sub run {
-  tie my %cache, 'DB_File', $cache, O_RDWR|O_CREAT, 0644 if $caching;
-  memoize 'flacinfo', NORMALIZER => \&normalizer, LIST_CACHE => 'MERGE', SCALAR_CACHE => [HASH => \%cache] if $caching;
-  memoize 'mp3info' , NORMALIZER => \&normalizer, LIST_CACHE => 'MERGE', SCALAR_CACHE => [HASH => \%cache] if $caching;
+  tie my %cache, 'DB_File', $cache, O_RDWR|O_CREAT, 0644 unless $cache eq '';
+  memoize 'flacinfo', NORMALIZER => \&normalizer, LIST_CACHE => 'MERGE', SCALAR_CACHE => [HASH => \%cache] unless $cache eq '';
+  memoize 'mp3info' , NORMALIZER => \&normalizer, LIST_CACHE => 'MERGE', SCALAR_CACHE => [HASH => \%cache] unless $cache eq '';
 
   my @files;
   for my $file (@ARGV) {
@@ -147,11 +145,7 @@ Prefix for download links. Defaults to '/music/'.
 
 =item B<--cache> I<filename>
 
-Path to the cache file. Created if it does not exist. Defaults to 'cache.db'
-
-=item B<--caching>, B<--no-caching>
-
-Enables or disables caching. Defaults to B<--caching>
+Path to the cache file. Created if it does not exist. If '' (empty), disables caching. Is empty by default.
 
 =back
 
This page took 0.010581 seconds and 4 git commands to generate.