mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 01:08:56 +00:00
Revert constants removal changes
This commit is contained in:
@@ -94,7 +94,7 @@ class Books
|
||||
$this->asstag = Settings::settingValue('APIs..amazonassociatetag');
|
||||
$this->bookqty = Settings::settingValue('..maxbooksprocessed') !== '' ? (int) Settings::settingValue('..maxbooksprocessed') : 300;
|
||||
$this->sleeptime = Settings::settingValue('..amazonsleep') !== '' ? (int) Settings::settingValue('..amazonsleep') : 1000;
|
||||
$this->imgSavePath = resource_path().'/covers/'.'book/';
|
||||
$this->imgSavePath = NN_COVERS.'book'.DS;
|
||||
$result = Settings::settingValue('..book_reqids');
|
||||
$this->bookreqids = $result ?? Category::BOOKS_EBOOK;
|
||||
$this->renamed = (int) Settings::settingValue('..lookupbooks') === 2 ? 'AND isrenamed = 1' : '';
|
||||
|
||||
@@ -106,7 +106,7 @@ class Console
|
||||
$this->asstag = Settings::settingValue('APIs..amazonassociatetag');
|
||||
$this->gameqty = (Settings::settingValue('..maxgamesprocessed') !== '') ? (int) Settings::settingValue('..maxgamesprocessed') : 150;
|
||||
$this->sleeptime = (Settings::settingValue('..amazonsleep') !== '') ? (int) Settings::settingValue('..amazonsleep') : 1000;
|
||||
$this->imgSavePath = resource_path().'/covers/'.'console/';
|
||||
$this->imgSavePath = NN_COVERS.'console'.DS;
|
||||
$this->renamed = (int) Settings::settingValue('..lookupgames') === 2;
|
||||
|
||||
$this->failCache = [];
|
||||
|
||||
@@ -128,7 +128,7 @@ class Games
|
||||
|
||||
$this->publicKey = config('nntmux_api.giantbomb_api_key');
|
||||
$this->gameQty = Settings::settingValue('..maxgamesprocessed') !== '' ? (int) Settings::settingValue('..maxgamesprocessed') : 150;
|
||||
$this->imgSavePath = resource_path().'/covers/'.'games/';
|
||||
$this->imgSavePath = NN_COVERS.'games'.DS;
|
||||
$this->renamed = (int) Settings::settingValue('..lookupgames') === 2 ? 'AND isrenamed = 1' : '';
|
||||
$this->matchPercentage = 60;
|
||||
$this->maxHitRequest = false;
|
||||
|
||||
@@ -196,7 +196,7 @@ class Movie
|
||||
$this->showPasswords = (new Releases())->showPasswords();
|
||||
|
||||
$this->echooutput = ($options['Echo'] && config('nntmux.echocli'));
|
||||
$this->imgSavePath = resource_path().'/covers/'.'movies/';
|
||||
$this->imgSavePath = NN_COVERS.'movies/';
|
||||
$this->service = '';
|
||||
}
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ class Music
|
||||
$this->asstag = Settings::settingValue('APIs..amazonassociatetag');
|
||||
$this->musicqty = Settings::settingValue('..maxmusicprocessed') !== '' ? (int) Settings::settingValue('..maxmusicprocessed') : 150;
|
||||
$this->sleeptime = Settings::settingValue('..amazonsleep') !== '' ? (int) Settings::settingValue('..amazonsleep') : 1000;
|
||||
$this->imgSavePath = resource_path().'/covers/'.'music/';
|
||||
$this->imgSavePath = NN_COVERS.'music'.DS;
|
||||
$this->renamed = (int) Settings::settingValue('..lookupmusic') === 2 ? 'AND isrenamed = 1' : '';
|
||||
|
||||
$this->failCache = [];
|
||||
|
||||
+1
-1
@@ -263,7 +263,7 @@ class NZB
|
||||
$nzbPath = '';
|
||||
|
||||
for ($i = 0; $i < $levelsToSplit && $i < 32; $i++) {
|
||||
$nzbPath .= $releaseGuid[$i].'/';
|
||||
$nzbPath .= $releaseGuid[$i].DS;
|
||||
}
|
||||
|
||||
$nzbPath = $this->siteNzbPath.$nzbPath;
|
||||
|
||||
@@ -76,8 +76,8 @@ class NZBExport
|
||||
$path = $params[0];
|
||||
|
||||
// Check if the path ends with dir separator.
|
||||
if (substr($path, -1) !== '/') {
|
||||
$path .= '/';
|
||||
if (substr($path, -1) !== DS) {
|
||||
$path .= DS;
|
||||
}
|
||||
|
||||
// Check if it's a directory.
|
||||
@@ -145,7 +145,7 @@ class NZBExport
|
||||
}
|
||||
|
||||
// Create a path to store the new NZB files.
|
||||
$currentPath = $path.$this->safeFilename($group['name']).'/';
|
||||
$currentPath = $path.$this->safeFilename($group['name']).DS;
|
||||
if (! File::isDirectory($currentPath) && ! File::makeDirectory($currentPath) && ! File::isDirectory($currentPath)) {
|
||||
throw new \RuntimeException(sprintf('Directory "%s" was not created', $currentPath));
|
||||
}
|
||||
|
||||
+1
-1
@@ -75,7 +75,7 @@ class Nfo
|
||||
|
||||
$this->tmpPath = (string) Settings::settingValue('..tmpunrarpath');
|
||||
if (! preg_match('/[\/\\\\]$/', $this->tmpPath)) {
|
||||
$this->tmpPath .= '/';
|
||||
$this->tmpPath .= DS;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -63,11 +63,11 @@ class ReleaseImage
|
||||
public function __construct()
|
||||
{
|
||||
$this->colorCli = new ColorCLI();
|
||||
$this->audSavePath = resource_path().'/covers/'.'audiosample/';
|
||||
$this->imgSavePath = resource_path().'/covers/'.'preview/';
|
||||
$this->jpgSavePath = resource_path().'/covers/'.'sample/';
|
||||
$this->movieImgSavePath = resource_path().'/covers/'.'movies/';
|
||||
$this->vidSavePath = resource_path().'/covers/'.'video/';
|
||||
$this->audSavePath = NN_COVERS.'audiosample'.DS;
|
||||
$this->imgSavePath = NN_COVERS.'preview'.DS;
|
||||
$this->jpgSavePath = NN_COVERS.'sample'.DS;
|
||||
$this->movieImgSavePath = NN_COVERS.'movies'.DS;
|
||||
$this->vidSavePath = NN_COVERS.'video'.DS;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -264,7 +264,7 @@ class Tmux
|
||||
*/
|
||||
public function writelog($pane): ?string
|
||||
{
|
||||
$path = storage_path().'/logs/';
|
||||
$path = NN_LOGS;
|
||||
$getdate = gmdate('Ymd');
|
||||
$logs = Settings::settingValue('site.tmux.write_logs') ?? 0;
|
||||
if ($logs === 1) {
|
||||
|
||||
+2
-2
@@ -88,8 +88,8 @@ class XXX
|
||||
$this->movieQty = Settings::settingValue('..maxxxxprocessed') !== '' ? (int) Settings::settingValue('..maxxxxprocessed') : 100;
|
||||
$this->showPasswords = (new Releases())->showPasswords();
|
||||
$this->echoOutput = ($options['Echo'] && config('nntmux.echocli'));
|
||||
$this->imgSavePath = resource_path().'/covers/'.'xxx/';
|
||||
$this->cookie = resource_path().'/tmp/xxx.cookie';
|
||||
$this->imgSavePath = NN_COVERS.'xxx'.DS;
|
||||
$this->cookie = NN_TMP.'xxx.cookie';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -212,16 +212,15 @@ SQL_EXPORT;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param null $settings
|
||||
* @param null $settings
|
||||
* @param array $options
|
||||
*
|
||||
* @return mixed|null
|
||||
* @throws \Illuminate\Contracts\Filesystem\FileNotFoundException
|
||||
*/
|
||||
public function progress($settings = null, array $options = [])
|
||||
{
|
||||
$defaults = [
|
||||
'path' => base_path().'/'.'cli/data/predb_progress.txt',
|
||||
'path' => NN_ROOT.'cli'.DS.'data'.DS.'predb_progress.txt',
|
||||
'read' => true,
|
||||
];
|
||||
$options += $defaults;
|
||||
|
||||
@@ -74,7 +74,7 @@ class AniDB
|
||||
$anidbupdint = Settings::settingValue('APIs.AniDB.max_update_frequency');
|
||||
$lastupdated = Settings::settingValue('APIs.AniDB.last_full_update');
|
||||
|
||||
$this->imgSavePath = resource_path().'/covers/'.'anime/';
|
||||
$this->imgSavePath = NN_COVERS.'anime'.DS;
|
||||
$this->apiKey = config('nntmux_api.anidb_api_key');
|
||||
|
||||
$this->updateInterval = $anidbupdint ?? '7';
|
||||
|
||||
@@ -463,7 +463,7 @@ class ProcessAdditional
|
||||
);
|
||||
}
|
||||
|
||||
$this->_showCLIReleaseID = (PHP_BINARY.' '.__DIR__.'/ProcessAdditional.php ReleaseID: ');
|
||||
$this->_showCLIReleaseID = (PHP_BINARY.' '.__DIR__.DS.'ProcessAdditional.php ReleaseID: ');
|
||||
|
||||
// Maximum amount of releases to fetch per run.
|
||||
$this->_queryLimit =
|
||||
@@ -512,7 +512,7 @@ class ProcessAdditional
|
||||
$this->_processAudioInfo = $this->_processMediaInfo;
|
||||
$this->_processPasswords = ! empty(Settings::settingValue('..checkpasswordedrar')) && ! empty(Settings::settingValue('apps..unrarpath'));
|
||||
|
||||
$this->_audioSavePath = resource_path().'/covers/'.'audiosample/';
|
||||
$this->_audioSavePath = NN_COVERS.'audiosample'.DS;
|
||||
|
||||
$this->_audioFileRegex = '\.(AAC|AIFF|APE|AC3|ASF|DTS|FLAC|MKA|MKS|MP2|MP3|RA|OGG|OGM|W64|WAV|WMA)';
|
||||
$this->_ignoreBookRegex = '/\b(epub|lit|mobi|pdf|sipdf|html)\b.*\.rar(?!.{20,})/i';
|
||||
@@ -573,7 +573,7 @@ class ProcessAdditional
|
||||
|
||||
// Check if it ends with a dir separator.
|
||||
if (! preg_match('/[\/\\\\]$/', $this->_mainTmpPath)) {
|
||||
$this->_mainTmpPath .= '/';
|
||||
$this->_mainTmpPath .= DS;
|
||||
}
|
||||
|
||||
// If we are doing per group, use the groupID has a inner path, so other scripts don't delete the files we are working on.
|
||||
@@ -782,7 +782,7 @@ class ProcessAdditional
|
||||
protected function _createTempFolder(): bool
|
||||
{
|
||||
// Per release defaults.
|
||||
$this->tmpPath = $this->_mainTmpPath.$this->_release->guid.'/';
|
||||
$this->tmpPath = $this->_mainTmpPath.$this->_release->guid.DS;
|
||||
if (! File::isDirectory($this->tmpPath)) {
|
||||
if (! File::makeDirectory($this->tmpPath, 0777, true, false) && ! File::isDirectory($this->tmpPath)) {
|
||||
$this->_echo('Unable to create directory: '.$this->tmpPath, 'warning');
|
||||
|
||||
@@ -76,7 +76,7 @@ abstract class TV extends Videos
|
||||
$this->colorCli = new ColorCLI();
|
||||
$this->catWhere = 'categories_id BETWEEN '.Category::TV_ROOT.' AND '.Category::TV_OTHER.' AND categories_id != '.Category::TV_ANIME;
|
||||
$this->tvqty = Settings::settingValue('..maxrageprocessed') !== '' ? (int) Settings::settingValue('..maxrageprocessed') : 75;
|
||||
$this->imgSavePath = resource_path().'/covers/'.'tvshows/';
|
||||
$this->imgSavePath = NN_COVERS.'tvshows'.DS;
|
||||
$this->siteColumns = ['tvdb', 'trakt', 'tvrage', 'tvmaze', 'imdb', 'tmdb'];
|
||||
}
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@ class Git extends GitRepository
|
||||
$defaults = [
|
||||
'create' => false,
|
||||
'initialise' => false,
|
||||
'filepath' => base_path().'/',
|
||||
'filepath' => NN_ROOT,
|
||||
];
|
||||
$options += $defaults;
|
||||
|
||||
|
||||
@@ -31,10 +31,10 @@ class Utility
|
||||
public static function canExecuteRead($path)
|
||||
{
|
||||
$paths = explode('#/#', $path);
|
||||
$fullPath = '/';
|
||||
$fullPath = DS;
|
||||
foreach ($paths as $singlePath) {
|
||||
if ($singlePath !== '') {
|
||||
$fullPath .= $singlePath.'/';
|
||||
$fullPath .= $singlePath.DS;
|
||||
if (! is_readable($fullPath) || ! is_executable($fullPath)) {
|
||||
return "The '$fullPath' directory must be readable and executable by all .".PHP_EOL;
|
||||
}
|
||||
@@ -244,6 +244,26 @@ class Utility
|
||||
return $string === '' ? false : $string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $path
|
||||
*/
|
||||
public static function setCoversConstant($path): void
|
||||
{
|
||||
if (! \defined('NN_COVERS')) {
|
||||
switch (true) {
|
||||
case $path[0] === '/' || $path[1] === ':' || $path[0] === '\\':
|
||||
\define('NN_COVERS', Str::finish($path, '/'));
|
||||
break;
|
||||
case $path !== '' && $path[0] !== '/' && $path[1] !== ':' && $path[0] !== '\\':
|
||||
\define('NN_COVERS', realpath(NN_ROOT.Str::finish($path, '/')));
|
||||
break;
|
||||
case empty($path): // Default to resources location.
|
||||
default:
|
||||
\define('NN_COVERS', NN_RES.'covers/');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an array to be used with stream_context_create() to verify openssl certificates
|
||||
* when connecting to a tls or ssl connection when using stream functions (fopen/file_get_contents/etc).
|
||||
@@ -337,7 +357,7 @@ class Utility
|
||||
)
|
||||
) {
|
||||
$fileSpec = sprintf($fileSpecTemplate, $options['type'], $options['id'], $options['suffix']);
|
||||
$fileSpec = file_exists(resource_path().'/covers/'.$fileSpec) ? $fileSpec :
|
||||
$fileSpec = file_exists(NN_COVERS.$fileSpec) ? $fileSpec :
|
||||
sprintf($fileSpecTemplate, $options['type'], 'no', $options['suffix']);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
2020-03-22 DariusIII
|
||||
* Chg: Remove option to set covers path in database, it is hardcoded now to resources/covers/
|
||||
2020-03-01 DariusIII
|
||||
* Chg: Move all third party api keys from database to .env file
|
||||
2020-02-27 DariusIII
|
||||
|
||||
@@ -48,7 +48,7 @@ class InstallNntmux extends Command
|
||||
$error = false;
|
||||
|
||||
if ($this->confirm('Are you sure you want to install NNTmux? This will wipe your database!!')) {
|
||||
if (file_exists(base_path().'/'.'_install/install.lock')) {
|
||||
if (file_exists(NN_ROOT.'_install/install.lock')) {
|
||||
if ($this->confirm('Do you want to remove install.lock file so you can continue with install?')) {
|
||||
$this->info('Removing install.lock file so we can continue with install process');
|
||||
$remove = new Process('rm _install/install.lock');
|
||||
|
||||
@@ -177,7 +177,7 @@ class NntmuxResetDb extends Command
|
||||
|
||||
$this->info('Deleting all images, previews and samples that still remain.');
|
||||
|
||||
$files = File::allFiles(resource_path().'/covers/');
|
||||
$files = File::allFiles(NN_COVERS);
|
||||
foreach ($files as $file) {
|
||||
if (basename($file) !== '.gitignore' && basename($file) !== 'no-cover.jpg' && basename($file) !== 'no-backdrop.jpg') {
|
||||
File::delete($file);
|
||||
|
||||
@@ -62,7 +62,7 @@ class Git
|
||||
'dev',
|
||||
],
|
||||
],
|
||||
'filepath' => base_path().'/',
|
||||
'filepath' => NN_ROOT,
|
||||
];
|
||||
|
||||
$config += $defaults;
|
||||
|
||||
@@ -57,7 +57,7 @@ class GameController extends BasePageController
|
||||
|
||||
switch ($action) {
|
||||
case 'submit':
|
||||
$coverLoc = resource_path().'/covers/'.'games/'.$id.'.jpg';
|
||||
$coverLoc = NN_COVERS.'games/'.$id.'.jpg';
|
||||
|
||||
if ($_FILES['cover']['size'] > 0) {
|
||||
$tmpName = $_FILES['cover']['tmp_name'];
|
||||
|
||||
@@ -43,8 +43,8 @@ class NzbController extends BasePageController
|
||||
|
||||
// Get the path the user set in the browser if he put one.
|
||||
$path = ($request->has('folder') ? $request->input('folder') : '');
|
||||
if (substr($path, \strlen($path) - 1) !== '/') {
|
||||
$path .= '/';
|
||||
if (substr($path, \strlen($path) - 1) !== DS) {
|
||||
$path .= DS;
|
||||
}
|
||||
|
||||
// Get the files from the user specified path.
|
||||
|
||||
@@ -137,7 +137,7 @@ class SiteController extends BasePageController
|
||||
$this->smarty->assign('lookup_reqids_ids', [0, 1, 2]);
|
||||
$this->smarty->assign('lookup_reqids_names', ['Disabled', 'Lookup Request IDs', 'Lookup Request IDs Threaded']);
|
||||
|
||||
$this->smarty->assign('coversPath', resource_path().'/covers/');
|
||||
$this->smarty->assign('coversPath', NN_COVERS);
|
||||
|
||||
// return a list of audiobooks, mags, ebooks, technical and foreign books
|
||||
$result = Category::query()->whereIn('id', [Category::MUSIC_AUDIOBOOK, Category::BOOKS_MAGAZINES, Category::BOOKS_TECHNICAL, Category::BOOKS_FOREIGN])->get(['id', 'title']);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
require_once dirname(__DIR__).DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR.'autoload.php';
|
||||
require __DIR__.DIRECTORY_SEPARATOR.'app.php';
|
||||
require_once 'constants.php';
|
||||
require_once dirname(__DIR__).DIRECTORY_SEPARATOR.'app/Extensions/util/PhpYenc.php';
|
||||
|
||||
use Dotenv\Dotenv;
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
// YOU SHOULD NOT EDIT ANYTHING IN THIS FILE!
|
||||
|
||||
define('NN_MINIMUM_PHP_VERSION', '7.2.0');
|
||||
define('NN_MINIMUM_MYSQL_VERSION', '5.7');
|
||||
define('NN_MINIMUM_MARIA_VERSION', '10.2');
|
||||
|
||||
define('DS', DIRECTORY_SEPARATOR);
|
||||
|
||||
// These are file path constants
|
||||
define('NN_ROOT', base_path().'/');
|
||||
|
||||
// Used to refer to the main lib class files.
|
||||
define('NN_LIB', NN_ROOT.'Blacklight/');
|
||||
|
||||
// Used to refer to the /misc class files.
|
||||
define('NN_MISC', NN_ROOT.'misc/');
|
||||
|
||||
// /misc/update/
|
||||
define('NN_UPDATE', NN_MISC.'update/');
|
||||
|
||||
// /misc/update/tmux/
|
||||
define('NN_TMUX', NN_UPDATE.'tmux/');
|
||||
|
||||
// /misc/update/multiprocessing/
|
||||
define('NN_MULTIPROCESSING', NN_UPDATE.'multiprocessing/');
|
||||
|
||||
// Refers to the web root for the Smarty lib
|
||||
define('NN_WWW', public_path().'/');
|
||||
|
||||
// Used to refer to the resources folder
|
||||
define('NN_RES', resource_path().'/');
|
||||
|
||||
// Used to refer to the covers folder
|
||||
define('NN_COVERS', NN_RES.'covers/');
|
||||
|
||||
// Used to refer to the tmp folder
|
||||
define('NN_TMP', NN_RES.'tmp/');
|
||||
|
||||
// Path where log files are stored.
|
||||
define('NN_LOGS', storage_path().'/logs/');
|
||||
|
||||
define('NN_VERSIONS', NN_ROOT.'build/nntmux.xml');
|
||||
@@ -24,12 +24,12 @@ use Blacklight\ColorCLI;
|
||||
use Blacklight\db\PreDb;
|
||||
use Illuminate\Support\Facades\File;
|
||||
|
||||
if (! File::isReadable(resource_path().'/')) {
|
||||
exit('The '.resource_path().'/'.' folder must be readable.'.PHP_EOL);
|
||||
if (! File::isReadable(NN_RES)) {
|
||||
exit('The '.NN_RES.' folder must be readable.'.PHP_EOL);
|
||||
}
|
||||
|
||||
if (! File::isWritable(resource_path().'/')) {
|
||||
exit('The ('.resource_path().'/'.') folder must be writable.'.PHP_EOL);
|
||||
if (! File::isWritable(NN_RES)) {
|
||||
exit('The ('.NN_RES.') folder must be writable.'.PHP_EOL);
|
||||
}
|
||||
|
||||
if (! isset($argv[1]) || (! is_numeric($argv[1]) && $argv[1] !== 'progress') || ! isset($argv[2]) ||
|
||||
@@ -122,10 +122,10 @@ foreach ($data as $dir => $files) {
|
||||
}
|
||||
|
||||
// Store the dump.
|
||||
$dumpFile = resource_path().'/'.$match[2].'_predb_dump.csv';
|
||||
$dumpFile = NN_RES.$match[2].'_predb_dump.csv';
|
||||
$fetched = File::put($dumpFile, $dump);
|
||||
if (! $fetched) {
|
||||
echo "Error storing dump file {$match[2]} in (".resource_path().'/'.').'.
|
||||
echo "Error storing dump file {$match[2]} in (".NN_RES.').'.
|
||||
PHP_EOL;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -14,8 +14,14 @@ class RemoveTextHash extends Migration
|
||||
public function up()
|
||||
{
|
||||
Schema::table('release_comments', function (Blueprint $table) {
|
||||
$table->dropUnique('ix_release_comments_hash_releases_id');
|
||||
$table->dropColumn('text_hash');
|
||||
$sm = Schema::getConnection()->getDoctrineSchemaManager();
|
||||
$indexesFound = $sm->listTableIndexes('release_comments');
|
||||
|
||||
if (array_key_exists('ix_release_comments_hash_releases_id', $indexesFound)) {
|
||||
$table->dropUnique("ix_release_comments_hash_releases_id");
|
||||
}
|
||||
|
||||
$table->dropIfExists('text_hash');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ use Blacklight\ReleaseImage;
|
||||
use Blacklight\Releases;
|
||||
use Blacklight\utility\Utility;
|
||||
|
||||
$dir = resource_path().'/'.'movednzbs/';
|
||||
$dir = NN_RES.'movednzbs/';
|
||||
$colorCli = new ColorCLI();
|
||||
|
||||
if (! isset($argv[1]) || ! in_array($argv[1], ['true', 'move'])) {
|
||||
|
||||
@@ -5,14 +5,23 @@
|
||||
// --------------------------------------------------------------
|
||||
require_once dirname(__DIR__, 3).DIRECTORY_SEPARATOR.'bootstrap/autoload.php';
|
||||
|
||||
use App\Models\Settings;
|
||||
use Blacklight\ColorCLI;
|
||||
use Blacklight\Movie;
|
||||
use Blacklight\utility\Utility;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
$movie = new Movie(['Echo' => true]);
|
||||
$colorCli = new ColorCLI();
|
||||
|
||||
$path2cover = resource_path().'/covers/movies/';
|
||||
$row = Settings::settingValue('site.main.coverspath');
|
||||
if ($row !== null) {
|
||||
Utility::setCoversConstant($row);
|
||||
} else {
|
||||
die('Unable to determine covers path!'.PHP_EOL);
|
||||
}
|
||||
|
||||
$path2cover = NN_COVERS.'movies'.DS;
|
||||
|
||||
if (isset($argv[1]) && ($argv[1] === 'true' || $argv[1] === 'check')) {
|
||||
$couldbe = $argv[1] === 'true' ? $couldbe = 'had ' : 'could have ';
|
||||
|
||||
@@ -5,17 +5,26 @@
|
||||
// --------------------------------------------------------------
|
||||
require_once dirname(__DIR__, 3).DIRECTORY_SEPARATOR.'bootstrap/autoload.php';
|
||||
|
||||
use App\Models\Settings;
|
||||
use Blacklight\ColorCLI;
|
||||
use Blacklight\ConsoleTools;
|
||||
use Blacklight\NZB;
|
||||
use Blacklight\ReleaseImage;
|
||||
use Blacklight\Releases;
|
||||
use Blacklight\utility\Utility;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
$pdo = DB::connection()->getPdo();
|
||||
$colorCli = new ColorCLI();
|
||||
|
||||
$path2preview = resource_path().'/covers/preview/';
|
||||
$row = Settings::settingValue('site.main.coverspath');
|
||||
if ($row !== null) {
|
||||
Utility::setCoversConstant($row);
|
||||
} else {
|
||||
die("Unable to determine covers path!\n");
|
||||
}
|
||||
|
||||
$path2preview = NN_COVERS.'preview'.DS;
|
||||
|
||||
if (isset($argv[1]) && ($argv[1] === 'true' || $argv[1] === 'check')) {
|
||||
$releases = new Releases();
|
||||
|
||||
@@ -27,7 +27,7 @@ if ($total > 0) {
|
||||
if ($gameData === false) {
|
||||
$colorCli->primary($gameInfo['release'].' not found');
|
||||
} else {
|
||||
if (file_exists(resource_path().'/covers/'.'games/'.$gameData.'.jpg')) {
|
||||
if (file_exists(NN_COVERS.'games'.DS.$gameData.'.jpg')) {
|
||||
$pdo->exec(sprintf('UPDATE gamesinfo SET cover = 1 WHERE id = %d', $arr['id']));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ use Blacklight\ReleaseImage;
|
||||
$pdo = DB::connection()->getPdo();
|
||||
$colorCli = new ColorCLI();
|
||||
|
||||
$path2cover = resource_path().'/covers/'.'samples/';
|
||||
$path2cover = NN_COVERS.'samples'.DS;
|
||||
|
||||
if (isset($argv[1]) && ($argv[1] === 'true' || $argv[1] === 'check')) {
|
||||
$releaseImage = new ReleaseImage();
|
||||
|
||||
@@ -14,7 +14,7 @@ if ($argc === 1 || $argv[1] !== 'true') {
|
||||
exit();
|
||||
}
|
||||
|
||||
$path2covers = resource_path().'/covers/'.'book/';
|
||||
$path2covers = NN_COVERS.'book'.DS;
|
||||
|
||||
$itr = File::allFiles($path2covers);
|
||||
foreach ($itr as $filePath) {
|
||||
|
||||
@@ -14,7 +14,7 @@ if ($argc === 1 || $argv[1] !== 'true') {
|
||||
exit();
|
||||
}
|
||||
|
||||
$path2covers = resource_path().'/covers/'.'console/';
|
||||
$path2covers = NN_COVERS.'console'.DS;
|
||||
|
||||
$itr = File::allFiles($path2covers);
|
||||
foreach ($itr as $filePath) {
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
require_once dirname(__DIR__, 3).DIRECTORY_SEPARATOR.'bootstrap/autoload.php';
|
||||
|
||||
use App\Models\GamesInfo;
|
||||
use App\Models\Settings;
|
||||
use Blacklight\ColorCLI;
|
||||
use Blacklight\utility\Utility;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\File;
|
||||
|
||||
@@ -17,7 +19,13 @@ if ($argc === 1 || $argv[1] !== 'true') {
|
||||
|
||||
$pdo = DB::connection()->getPdo();
|
||||
|
||||
$path2covers = resource_path().'/covers/games/';
|
||||
$row = Settings::settingValue('site.main.coverspath');
|
||||
if ($row !== null) {
|
||||
Utility::setCoversConstant($row);
|
||||
} else {
|
||||
die("Unable to set Covers' constant!\n");
|
||||
}
|
||||
$path2covers = NN_COVERS.'games'.DS;
|
||||
|
||||
$itr = File::allFiles($path2covers);
|
||||
foreach ($itr as $filePath) {
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
require_once dirname(__DIR__, 3).DIRECTORY_SEPARATOR.'bootstrap/autoload.php';
|
||||
|
||||
use App\Models\MovieInfo;
|
||||
use App\Models\Settings;
|
||||
use Blacklight\ColorCLI;
|
||||
use Blacklight\utility\Utility;
|
||||
use Illuminate\Support\Facades\File;
|
||||
|
||||
$covers = $updated = $deleted = 0;
|
||||
@@ -14,7 +16,13 @@ if ($argc === 1 || $argv[1] !== 'true') {
|
||||
exit();
|
||||
}
|
||||
|
||||
$path2covers = resource_path().'/covers/movies/';
|
||||
$row = Settings::settingValue('site.main.coverspath');
|
||||
if ($row !== null) {
|
||||
Utility::setCoversConstant($row);
|
||||
} else {
|
||||
die("Unable to set Covers' constant!\n");
|
||||
}
|
||||
$path2covers = NN_COVERS.'movies'.DS;
|
||||
|
||||
$itr = File::allFiles($path2covers);
|
||||
foreach ($itr as $filePath) {
|
||||
|
||||
@@ -14,7 +14,7 @@ if ($argc === 1 || $argv[1] !== 'true') {
|
||||
exit();
|
||||
}
|
||||
|
||||
$path2covers = resource_path().'/covers/'.'music/';
|
||||
$path2covers = NN_COVERS.'music'.DS;
|
||||
|
||||
$itr = File::allFiles($path2covers);
|
||||
foreach ($itr as $filePath) {
|
||||
|
||||
@@ -14,7 +14,7 @@ if ($argc === 1 || $argv[1] !== 'true') {
|
||||
exit();
|
||||
}
|
||||
|
||||
$path2covers = resource_path().'/covers/'.'xxx/';
|
||||
$path2covers = NN_COVERS.'xxx'.DS;
|
||||
|
||||
$itr = File::allFiles($path2covers);
|
||||
foreach ($itr as $filePath) {
|
||||
|
||||
@@ -18,8 +18,8 @@ if (count($argv) !== 6) {
|
||||
'arg4 : Group ID for the group or false | number/false'.$n.
|
||||
'arg5 : Gzip the NZB files (recommended, faster/takes less space) | true/false'.$n.$n.
|
||||
'Examples: '.$n.
|
||||
$_SERVER['_'].' '.$argv[0].' '.base_path().'/exportFolder/ 01/01/2012 01/01/2014 false true'.$n.
|
||||
$_SERVER['_'].' '.$argv[0].' '.base_path().'/'.'exportFolder/ false 01/01/2014 12 false'.$n
|
||||
$_SERVER['_'].' '.$argv[0].' '.NN_ROOT.'exportFolder'.DS.' 01/01/2012 01/01/2014 false true'.$n.
|
||||
$_SERVER['_'].' '.$argv[0].' '.NN_ROOT.'exportFolder'.DS.' false 01/01/2014 12 false'.$n
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ if (count($argv) !== 6) {
|
||||
'arg3 : Delete NZB when unsuccessfully imported.(not recommended) | true/false'.$n.
|
||||
'arg4 : Use NZB file name as release name.(not recommended) | true/false'.$n.
|
||||
'arg5 : Import this many NZB files. (RECOMMENDED 100,000) | a number'.$n.$n.
|
||||
'ie: '.$_SERVER['_'].' '.__FILE__.' '.base_path().'/nzbToImport/ true false false 1000'.$n
|
||||
'ie: '.$_SERVER['_'].' '.__FILE__.' '.NN_ROOT.'nzbToImport'.DS.' true false false 1000'.$n
|
||||
);
|
||||
}
|
||||
|
||||
@@ -44,8 +44,8 @@ if ($argv[5] < 0) {
|
||||
|
||||
$path = $argv[1];
|
||||
// Check if path ends with dir separator.
|
||||
if (substr($path, -1) !== '/') {
|
||||
$path .= '/';
|
||||
if (substr($path, -1) !== DS) {
|
||||
$path .= DS;
|
||||
}
|
||||
|
||||
$files = new \RegexIterator(
|
||||
|
||||
@@ -26,9 +26,9 @@ try {
|
||||
echo $e;
|
||||
}
|
||||
|
||||
$runVar['paths']['misc'] = base_path().'/misc/';
|
||||
$runVar['paths']['cli'] = base_path().'/cli/';
|
||||
$runVar['paths']['scraper'] = base_path().'/misc/IRCScraper/scrape.php';
|
||||
$runVar['paths']['misc'] = NN_MISC;
|
||||
$runVar['paths']['cli'] = NN_ROOT.'cli/';
|
||||
$runVar['paths']['scraper'] = NN_MISC.'IRCScraper'.DS.'scrape.php';
|
||||
|
||||
$db_name = config('nntmux.db_name');
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ use App\Models\Settings;
|
||||
use Blacklight\ColorCLI;
|
||||
use Blacklight\utility\Utility;
|
||||
|
||||
$DIR = base_path().'/misc/update/tmux/';
|
||||
$DIR = NN_TMUX;
|
||||
$import = Settings::settingValue('site.tmux.import') ?? 0;
|
||||
$tmux_session = Settings::settingValue('site.tmux.tmux_session') ?? 0;
|
||||
$seq = Settings::settingValue('site.tmux.sequential') ?? 0;
|
||||
@@ -33,7 +33,7 @@ Collection::query()->where('dateadded', '<', now()->subHours($delaytimet))->upda
|
||||
|
||||
function writelog($pane)
|
||||
{
|
||||
$path = resource_path().'/'.'logs';
|
||||
$path = NN_RES.'logs';
|
||||
$getdate = gmdate('Ymd');
|
||||
$logs = Settings::settingValue('site.tmux.write_logs');
|
||||
if ((int) $logs === 1) {
|
||||
|
||||
@@ -61,6 +61,14 @@
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width: 180px;"><label for="coverspath">Cover's path:</label></td>
|
||||
<td>
|
||||
<input id="coverspath" class="long" name="coverspath" type="text" value="{$site->coverspath}"/>
|
||||
<div class="hint">The absolute path to the place covers will be stored.</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><label for="style">Theme</label>:</td>
|
||||
<td>
|
||||
|
||||
@@ -21,7 +21,7 @@ class InstallTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
public function testFullInstall()
|
||||
{
|
||||
passthru('php '.base_path().'/'.'artisan migrate:fresh --seed');
|
||||
passthru('php '.NN_ROOT.'artisan migrate:fresh --seed');
|
||||
|
||||
$message = 'NNTmux installation completed successfully';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user