]> git.ktnx.net Git - mpd-feeder.git/commitdiff
added --skip-db-update option
authorDamyan Ivanov <dmn@debian.org>
Thu, 11 Nov 2021 09:23:28 +0000 (09:23 +0000)
committerDamyan Ivanov <dmn@debian.org>
Thu, 11 Nov 2021 09:23:28 +0000 (09:23 +0000)
skips initial database update

bin/mpd-feeder

index c6792e8329cdaf4650b0d7e891d0dc2445c54b91..d2768c68fa11e3833083c1f81df7e9768192dcd2 100755 (executable)
@@ -21,6 +21,7 @@ class Options {
     has $verbose             :reader = 0;
     has $single              :reader = 0;
     has $one_shot            :reader = 0;
+    has $skip_db_update      :reader = 0;
     has $dump_config         :reader = 0;
 
     method verb($message) {
@@ -38,6 +39,7 @@ class Options {
             'dump-config!'              => \$dump_config,
             's|single!'                 => \$single,
             'one-shot!'                 => \$one_shot,
+            'skip-db-update!'           => \$skip_db_update,
             'tql|target-queue-length=n' => \$target_queue_length,
             'mpd-host=s'                => \$mpd_host,
             'mpd-port=s'                => \$mpd_port,
@@ -152,7 +154,7 @@ use constant DEFAULT_CONFIG_FILE => '/etc/mpd-feeder/mpd-feeder.conf';
             );
 
             $self->connect_db;
-            $self->update_db;
+            $self->update_db unless $self->opt->skip_db_update;
         }
     }