Skip to content

A self-hosted media server and file management system

Reorder indexing operations to try and fix the sql errors

aminnausin31c0385631bc
diff --git a/app/Jobs/IndexFiles.php b/app/Jobs/IndexFiles.php
index 845d05a8..b441b188 100644
--- a/app/Jobs/IndexFiles.php
+++ b/app/Jobs/IndexFiles.php
@@ -142,17 +142,17 @@ class IndexFiles implements ShouldQueue, ShouldBeUnique
}
}
- Storage::disk('public')->put('categories.json', json_encode($directories["data"], JSON_UNESCAPED_SLASHES));
- Storage::disk('public')->put('folders.json', json_encode($subDirectories["data"], JSON_UNESCAPED_SLASHES));
- Storage::disk('public')->put('videos.json', json_encode($files["data"], JSON_UNESCAPED_SLASHES));
+ Video::destroy($videoDeletions);
+ Folder::destroy($folderDeletions);
+ Category::destroy($categoryDeletions);
Category::insert($categoryTransactions);
Folder::insert($folderTransactions);
Video::insert($videoTransactions);
- Video::destroy($videoDeletions);
- Folder::destroy($folderDeletions);
- Category::destroy($categoryDeletions);
+ Storage::disk('public')->put('categories.json', json_encode($directories["data"], JSON_UNESCAPED_SLASHES));
+ Storage::disk('public')->put('folders.json', json_encode($subDirectories["data"], JSON_UNESCAPED_SLASHES));
+ Storage::disk('public')->put('videos.json', json_encode($files["data"], JSON_UNESCAPED_SLASHES));
$data = array("categories"=>$categories,"folders"=>$folders,"videos"=>$videos);