Skip to content

Commit

Permalink
Merge pull request #1678 from PyRowMan/fix-installation
Browse files Browse the repository at this point in the history
Update config and paths for tmp unzip and unrar handling
  • Loading branch information
DariusIII authored Dec 26, 2024
2 parents 29d758f + 19687cf commit eac586e
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions app/Console/Commands/InstallNntmux.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use Illuminate\Console\Command;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Process;
use Illuminate\Support\Str;

class InstallNntmux extends Command
{
Expand Down Expand Up @@ -87,11 +86,10 @@ private function updatePaths()
{
$covers_path = config('nntmux_settings.covers_path');
$nzb_path = config('nntmux_settings.path_to_nzbs');
$tmp_path = config('nntmux.tmp_path');
$unrar_path = config('nntmux_settings.unrar_path');
$zip_path = config('nntmux_settings.tmp_unzip_path');
$unrar_path = config('nntmux.tmp_unrar_path');

$nzbPathCheck = File::isWritable($nzb_path);
if (! $nzbPathCheck) {
if (! File::isWritable($nzb_path)) {
$this->warn($nzb_path.' is not writable. Please fix folder permissions');

return false;
Expand All @@ -104,33 +102,26 @@ private function updatePaths()
}
$this->info('Folder '.$unrar_path.' successfully created');
}
$unrarPathCheck = is_writable($unrar_path);
if ($unrarPathCheck === false) {

if (! is_writable($unrar_path)) {
$this->warn($unrar_path.' is not writable. Please fix folder permissions');

return false;
}

$coversPathCheck = File::isWritable($covers_path);
if (! $coversPathCheck) {
if (! File::isWritable($covers_path)) {
$this->warn($covers_path.' is not writable. Please fix folder permissions');

return false;
}

$tmpPathCheck = File::isWritable($tmp_path);
if (! $tmpPathCheck) {
$this->warn($tmp_path.' is not writable. Please fix folder permissions');
if (! File::isWritable($zip_path)) {
$this->warn($zip_path.' is not writable. Please fix folder permissions');

return false;
}

return [
'nzb_path' => Str::finish($nzb_path, '/'),
'covers_path' => Str::finish($covers_path, '/'),
'unrar_path' => Str::finish($unrar_path, '/'),
'tmp_path' => Str::finish($tmp_path, '/'),
];
return true;
}

private function addAdminUser(): bool
Expand Down

0 comments on commit eac586e

Please sign in to comment.