Add --skip-sync cli option to sort already-downloaded files without downloading new ones
This commit is contained in:
@@ -4,7 +4,7 @@ define('DD_File', 'dispatcher');
|
||||
|
||||
$options = array();
|
||||
if (isset($_SERVER['argv'])) {
|
||||
$options = getopt('c:', array('config:'));
|
||||
$options = getopt('c:', array('config:','skip-sync'));
|
||||
}
|
||||
|
||||
if (isset($options['config'])) {
|
||||
@@ -26,6 +26,10 @@ try {
|
||||
$main = DownloadDispatcher_Main::instance();
|
||||
DownloadDispatcher_LogEntry::setLocalProgname('download-dispatcher');
|
||||
|
||||
if (isset($options['skip-sync'])) {
|
||||
$main->config()->set('sync.skip', true, false);
|
||||
}
|
||||
|
||||
// Download Dispatcher entry point
|
||||
DownloadDispatcher_Processor::run();
|
||||
|
||||
|
||||
@@ -13,6 +13,8 @@ class DownloadDispatcher_Processor {
|
||||
$config = $main->config();
|
||||
$log = $main->log();
|
||||
|
||||
|
||||
if (! $config->get('sync.skip', false)) {
|
||||
// Find the list of available Sync plugins
|
||||
$sync_plugins = $config->get('sync');
|
||||
foreach ($sync_plugins as $plugin_name) {
|
||||
@@ -28,6 +30,7 @@ class DownloadDispatcher_Processor {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Find the list of available source plugins
|
||||
DownloadDispatcher_Source_PluginFactory::scan();
|
||||
|
||||
Reference in New Issue
Block a user