Skip to content

A self-hosted media server and file management system

Accept defeat and live with ugly console logs

aminnausin4680b241d7e2
diff --git a/app/Http/Controllers/DirectoryController.php b/app/Http/Controllers/DirectoryController.php
index 3ba20cd9..693ad007 100644
--- a/app/Http/Controllers/DirectoryController.php
+++ b/app/Http/Controllers/DirectoryController.php
@@ -166,7 +166,7 @@ class DirectoryController extends Controller
foreach($chunks as $chunk){
$jobs[] = new VerifyFiles($chunk);
- break;
+ // break;
}
Bus::batch($jobs)->dispatch();
diff --git a/app/Jobs/VerifyFiles.php b/app/Jobs/VerifyFiles.php
index 706812de..6b96c876 100644
--- a/app/Jobs/VerifyFiles.php
+++ b/app/Jobs/VerifyFiles.php
@@ -39,22 +39,9 @@ class VerifyFiles implements ShouldQueue
dump('Video Data Lost');
return;
}
-
-
- try {
- $ffprobe = FFMpegFFProbe::create();
- // $duration = ceil($ffprobe
- // ->format('C:\NAS-6\projects\mediaServer\storage\app\public\media\yakuza\Ishin\Like a Dragon_ Ishin! 2023-12-16 2-47-02 PM.mp4') // extracts file informations
- // ->get('duration'));
- // $changes['duration'] = $duration;
- $change = $ffprobe->format('C:\NAS-6\projects\mediaServer\storage\app\public\media\anime\frieren\S1E01.mp4')->get('duration');
- dump($change);
- } catch (\Throwable $th) {
- dump($th->getMessage());
- }
- return;
$transactions = array();
+ $error = false;
foreach ($this->videos as $video) {
try {
$stored = array();
@@ -100,13 +87,14 @@ class VerifyFiles implements ShouldQueue
} catch (\Throwable $th) {
//throw $th;
dump('Error cannot verify file metadata ' . $th->getMessage() . ' Cancelling ' . count($transactions) . ' updates');
- return;
+ $error = true;
+ break;
}
}
- if(count($transactions) == 0) return;
+ if(count($transactions) == 0 || $error) return;
Video::upsert($transactions, 'id', ['title','duration','season','episode','view_count']);
- dump('Updated ' . count($transactions) . ' videos from id ' . ($transactions[0]->id ?? 'null') . ' to ' . ($transactions[count($transactions) - 1]->id ?? 'null'));
+ dump('Updated ' . count($transactions) . ' videos from id ' . ($transactions[0]->id ?? '[null]') . ' to ' . ($transactions[count($transactions) - 1]->id ?? '[null]'));
}
}