diff --git a/misc/update_scripts/nix_scripts/tmux/lib/testing/populate_anidb.php b/cli/data/populate_anidb.php similarity index 84% rename from misc/update_scripts/nix_scripts/tmux/lib/testing/populate_anidb.php rename to cli/data/populate_anidb.php index 26ddd0a42..236ae91f6 100644 --- a/misc/update_scripts/nix_scripts/tmux/lib/testing/populate_anidb.php +++ b/cli/data/populate_anidb.php @@ -2,14 +2,15 @@ /* This script is designed to gather all show data from anidb and add it to the anidb table for newznab, as part of this process we need the number of PI queries that can be executed max and whether or not we want debuging the first argument if unset will try to do the entire list (a good way to get banned), the second option can be blank or true for debugging. * IF you are using this script then then you also want to edit anidb.php in www/lib and locate "604800" and replace it with 1204400, this will make sure it never tries to connect to anidb as this will fail */ -require_once(dirname(__FILE__) . "/../../bin/config.php"); +require_once dirname(__FILE__) . '/../../www/config.php'; use newznab\db\Settings; +use newznab\db\populate\AniDB; $pdo = new Settings(); if ($argc > 1 && $argv[1] == true) { - (new \PopulateAniDB(['Settings' => $pdo, 'Echo' => true]))->populateTable('full'); + (new AniDB(['Settings' => $pdo, 'Echo' => true]))->populateTable('full'); } else { $pdo->log->doEcho(PHP_EOL . $pdo->log->error( "To execute this script you must provide a boolean argument." . PHP_EOL . diff --git a/misc/update_scripts/nix_scripts/tmux/lib/testing/predb_import_daily_batch.php b/cli/data/predb_import_daily_batch.php similarity index 97% rename from misc/update_scripts/nix_scripts/tmux/lib/testing/predb_import_daily_batch.php rename to cli/data/predb_import_daily_batch.php index d06921863..0c9ad84ae 100644 --- a/misc/update_scripts/nix_scripts/tmux/lib/testing/predb_import_daily_batch.php +++ b/cli/data/predb_import_daily_batch.php @@ -7,14 +7,14 @@ use newznab\db\Settings; use newznab\utility\Utility; -$config = dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR . +$config = dirname(dirname(__DIR__)) . DIRECTORY_SEPARATOR . 'www' . DIRECTORY_SEPARATOR . 'config.php'; if (!is_file($config)) { - exit('Place this script in the lib/testing folder of tmux.' . PHP_EOL); + exit('Place this script in the testing folder of tmux.' . PHP_EOL); } -require_once $config; +require_once dirname(__FILE__) . '/../../www/config.php'; unset($config); if (!Utility::isWin()) { @@ -36,7 +36,7 @@ if (!is_writable(NN_RES)) { exit('The (' . NN_RES . ') folder must be writable.' . PHP_EOL); } -$progress = rw_progress(settings_[]); +$progress = rw_progress(settings_array()); if (!isset($argv[1]) || !is_numeric($argv[1]) && $argv[1] != 'progress' || !isset($argv[2]) || !in_array($argv[2], ['local', 'remote']) || !isset($argv[3]) || diff --git a/misc/update_scripts/nix_scripts/tmux/lib/testing/DB/change_USP_provider.php b/misc/testing/DB/change_USP_provider.php similarity index 99% rename from misc/update_scripts/nix_scripts/tmux/lib/testing/DB/change_USP_provider.php rename to misc/testing/DB/change_USP_provider.php index 36bc2bca9..7d4d6982f 100644 --- a/misc/update_scripts/nix_scripts/tmux/lib/testing/DB/change_USP_provider.php +++ b/misc/testing/DB/change_USP_provider.php @@ -1,5 +1,5 @@ . */ -require_once(dirname(__FILE__) . "/../../../bin/config.php"); +require_once dirname(__FILE__) . '/../../../www/config.php'; use newznab\db\Settings; diff --git a/misc/update_scripts/nix_scripts/tmux/lib/testing/Dev/clean_nzbs.php b/misc/testing/Dev/clean_nzbs.php similarity index 98% rename from misc/update_scripts/nix_scripts/tmux/lib/testing/Dev/clean_nzbs.php rename to misc/testing/Dev/clean_nzbs.php index a7a1e0402..7b17e7143 100644 --- a/misc/update_scripts/nix_scripts/tmux/lib/testing/Dev/clean_nzbs.php +++ b/misc/testing/Dev/clean_nzbs.php @@ -1,5 +1,5 @@ get(); $title = "Long Arm, The - Franz Habl "; $obj = new AmazonProductAPI($site->amazonpubkey, $site->amazonprivkey, $site->amazonassociatetag); try { $amaz = $obj->searchProducts($title, AmazonProductAPI::BOOKS, "TITLE"); $item = []; $item["asin"] = (string) $amaz->Items->Item->ASIN; $item["url"] = (string) $amaz->Items->Item->DetailPageURL; $item["cover"] = (string) $amaz->Items->Item->LargeImage->URL; $item["author"] = (string) $amaz->Items->Item->ItemAttributes->Author; $item["dewey"] = (string) $amaz->Items->Item->ItemAttributes->DeweyDecimalNumber; $item["ean"] = (string) $amaz->Items->Item->ItemAttributes->EAN; $item["isbn"] = (string) $amaz->Items->Item->ItemAttributes->ISBN; $item["publisher"] = (string) $amaz->Items->Item->ItemAttributes->Publisher; $item["publishdate"] = (string) $amaz->Items->Item->ItemAttributes->PublicationDate; $item["pages"] = (string) $amaz->Items->Item->ItemAttributes->NumberOfPages; $item["title"] = (string) $amaz->Items->Item->ItemAttributes->Title; $item["review"] = ""; if (isset($amaz->Items->Item->EditorialReviews)) $item["review"] = trim(strip_tags((string) $amaz->Items->Item->EditorialReviews->EditorialReview->Content)); print_r($item); } catch(Exception $e) { echo "failed"; } \ No newline at end of file diff --git a/misc/testing/regexverify.php b/misc/testing/Tests/regexverify.php similarity index 95% rename from misc/testing/regexverify.php rename to misc/testing/Tests/regexverify.php index 211f96a39..f9cb21bb3 100644 --- a/misc/testing/regexverify.php +++ b/misc/testing/Tests/regexverify.php @@ -5,7 +5,7 @@ // // by l2g // -require_once dirname(__FILE__) . '/../../www/config.php'; +require_once dirname(__FILE__) . '/../../../www/config.php'; function handleError($errno, $errstr, $errfile, $errline, array $errcontext) diff --git a/misc/testing/test_blacklist.php b/misc/testing/Tests/test_blacklist.php similarity index 99% rename from misc/testing/test_blacklist.php rename to misc/testing/Tests/test_blacklist.php index ba9cef634..8ac18bdc1 100644 --- a/misc/testing/test_blacklist.php +++ b/misc/testing/Tests/test_blacklist.php @@ -8,7 +8,7 @@ // // by l2g // -require_once dirname(__FILE__) . '/../../www/config.php'; +require_once dirname(__FILE__) . '/../../../www/config.php'; use newznab\db\Settings; diff --git a/misc/testing/test_regex.php b/misc/testing/Tests/test_regex.php similarity index 95% rename from misc/testing/test_regex.php rename to misc/testing/Tests/test_regex.php index 841b873c2..48af227ec 100644 --- a/misc/testing/test_regex.php +++ b/misc/testing/Tests/test_regex.php @@ -5,7 +5,7 @@ // // by l2g // -require_once dirname(__FILE__) . '/../../www/config.php'; +require_once dirname(__FILE__) . '/../../../www/config.php'; use newznab\db\Settings; diff --git a/misc/testing/testnewamazon.php b/misc/testing/Tests/testnewamazon.php similarity index 92% rename from misc/testing/testnewamazon.php rename to misc/testing/Tests/testnewamazon.php index b649616dc..197f301b4 100644 --- a/misc/testing/testnewamazon.php +++ b/misc/testing/Tests/testnewamazon.php @@ -1,5 +1,5 @@ get(); $title = "Long Arm, The - Franz Habl "; $obj = new AmazonProductAPI($site->amazonpubkey, $site->amazonprivkey, $site->amazonassociatetag); try { $amaz = $obj->searchProducts($title, AmazonProductAPI::BOOKS, "TITLE"); $item = []; $item["asin"] = (string) $amaz->Items->Item->ASIN; $item["url"] = (string) $amaz->Items->Item->DetailPageURL; $item["cover"] = (string) $amaz->Items->Item->LargeImage->URL; $item["author"] = (string) $amaz->Items->Item->ItemAttributes->Author; $item["dewey"] = (string) $amaz->Items->Item->ItemAttributes->DeweyDecimalNumber; $item["ean"] = (string) $amaz->Items->Item->ItemAttributes->EAN; $item["isbn"] = (string) $amaz->Items->Item->ItemAttributes->ISBN; $item["publisher"] = (string) $amaz->Items->Item->ItemAttributes->Publisher; $item["publishdate"] = (string) $amaz->Items->Item->ItemAttributes->PublicationDate; $item["pages"] = (string) $amaz->Items->Item->ItemAttributes->NumberOfPages; $item["title"] = (string) $amaz->Items->Item->ItemAttributes->Title; $item["review"] = ""; if (isset($amaz->Items->Item->EditorialReviews)) $item["review"] = trim(strip_tags((string) $amaz->Items->Item->EditorialReviews->EditorialReview->Content)); print_r($item); } catch(Exception $e) { echo "failed"; } \ No newline at end of file diff --git a/misc/update_scripts/nix_scripts/tmux/lib/testing/recategorize.php b/misc/testing/recategorize.php similarity index 98% rename from misc/update_scripts/nix_scripts/tmux/lib/testing/recategorize.php rename to misc/testing/recategorize.php index d7cd563f0..2ce8da19b 100644 --- a/misc/update_scripts/nix_scripts/tmux/lib/testing/recategorize.php +++ b/misc/testing/recategorize.php @@ -1,5 +1,5 @@