Replace anidb with anilist

This commit is contained in:
DariusIII
2025-12-05 13:21:26 +01:00
parent 928b413808
commit 7471218bb0
17 changed files with 1384 additions and 143 deletions
+11
View File
@@ -37,6 +37,17 @@ class CoverController extends Controller
} else {
$filePath = storage_path("covers/{$type}/{$filename}");
}
} elseif ($type === 'anime') {
// For anime, try the requested filename first, then fall back to old format (without -cover)
$filePath = storage_path("covers/{$type}/{$filename}");
// If file doesn't exist and filename ends with -cover.jpg, try old format
if (!file_exists($filePath) && preg_match('/^(\d+)-cover\.jpg$/', $filename, $matches)) {
$oldFormatPath = storage_path("covers/{$type}/{$matches[1]}.jpg");
if (file_exists($oldFormatPath)) {
$filePath = $oldFormatPath;
}
}
} else {
$filePath = storage_path("covers/{$type}/{$filename}");
}