A self-hosted media server and file management system
Vue ffmpegfile-serverjellyfinlaravelmediamedia-playermedia-servermediabrowsermediaservermusicmusic-librarymusic-playermusicplayerself-hostedvuejs
chore: code smells
aminnausinca7a11dfd59e
diff --git a/app/Jobs/VerifyFiles.php b/app/Jobs/VerifyFiles.phpindex 957acd9c..123ef2aa 100755--- a/app/Jobs/VerifyFiles.php+++ b/app/Jobs/VerifyFiles.php@@ -601,67 +601,6 @@ class VerifyFiles extends ManagedSubTask {return Storage::disk('public')->url($path);}- private function checkAlbumArt($filePath, $coverArtPath, $recentlyUpdated = false) {- // If album art already exists and the file has not been updated since last scan date (cover art has not changed) then just return the existing image- if (Storage::disk('public')->exists($coverArtPath) && ! $recentlyUpdated) {- return $this->getPathUrl($coverArtPath);- }-- // If album art exists and the file was recently updated, overwrite the old image-- $coverGenerated = $this->extractAlbumArt($filePath, $coverArtPath);-- if (! $coverGenerated) {- return null;- }-- Storage::disk('public')->put($coverArtPath, $coverGenerated);-- return $this->getPathUrl($coverArtPath);- }-- private function extractAlbumArt($filePath, $outputPath): string|false {- $result = false;- $tempPath = sys_get_temp_dir() . '/' . basename($outputPath);-- try {- $command = [- 'ffmpeg',- '-i',- $filePath,- '-an',- '-vcodec',- 'copy',- $tempPath,- ];-- $process = new Process($command);- $process->run();-- if (! $process->isSuccessful()) {- $errorOutput = $process->getErrorOutput(); // Checks if error is caused by missing album art (never set so dont log)- if (str_contains($errorOutput, 'Output file does not contain any stream')) {- return false;- }-- throw new ProcessFailedException($process);- }-- if (file_exists($tempPath) && filesize($tempPath) > 0) {- $result = file_get_contents($tempPath);- }- } catch (\Throwable $th) {- dump($th->getMessage());- Log::error($th);- } finally {- if (file_exists($tempPath)) {- @unlink($tempPath);- }- }-- return $result;- }-protected function extractMimeType(string $filePath) {$finfo = new \finfo(FILEINFO_MIME_TYPE);$mimeType = $finfo->file($filePath);diff --git a/app/Jobs/VerifyFolders.php b/app/Jobs/VerifyFolders.phpindex 7b2f1717..e33f63c3 100644--- a/app/Jobs/VerifyFolders.php+++ b/app/Jobs/VerifyFolders.php@@ -177,17 +177,3 @@ class VerifyFolders extends ManagedSubTask {}}}--// $thumbnailPath = explode('/', $series->composite_id ?? 'unsorted/unsorted')[0] . '/' . basename($series->id);-// $thumbnailIsInternal = strpos($series->thumbnail_url, str_replace('http://', '', str_replace('https://', '', config('api.app_url'))));--// if (isset($series->thumbnail_url) && $thumbnailIsInternal && ! Storage::disk('public')->exists("thumbnails/$thumbnailPath.webp") && !$series->primaryPoster) {-// // This means the thumbnail is set with another internal image url (for example cover art from a song was used as a thumbnail for some folder)-// Log::warning(-// "Local thumbnail is set but does not exist for $series->composite_id at " . Storage::disk('public')->path("thumbnails/$thumbnailPath.webp"),-// [-// 'path' => Str::after(urldecode($series->thumbnail_url), '/storage/'),-// 'exists' => Storage::disk('public')->exists(Str::after(urldecode($series->thumbnail_url), '/storage/')),-// ]-// );-// }diff --git a/resources/js/components/cedar-ui/hover-card/HoverCard.vue b/resources/js/components/cedar-ui/hover-card/HoverCard.vueindex 79b08ace..015d25c5 100644--- a/resources/js/components/cedar-ui/hover-card/HoverCard.vue+++ b/resources/js/components/cedar-ui/hover-card/HoverCard.vue@@ -65,7 +65,6 @@ const updateTooltipPosition = (event: MouseEvent) => {const scrollY = props.scrollContainer === 'body' ? document.body.scrollTop : window.scrollY;const scrollX = props.scrollContainer === 'body' ? document.body.scrollLeft : window.scrollX;- // tooltipStyles.value = { left: `${rect.left + scrollX + props.paddingLeft}px`, top: `${rect.bottom + props.margin + scrollY}px` };const top = rect.bottom + props.margin + scrollY;const left = rect.left + scrollX + props.paddingLeft;