Skip to content

A self-hosted media server and file management system

fix: image download fails with 0 redirects

aminnausindf1da77cea71
diff --git a/app/Http/Controllers/Api/V1/MetadataController.php b/app/Http/Controllers/Api/V1/MetadataController.php
index 1ae4d96a..865a7a76 100644
--- a/app/Http/Controllers/Api/V1/MetadataController.php
+++ b/app/Http/Controllers/Api/V1/MetadataController.php
@@ -136,7 +136,7 @@ class MetadataController extends Controller {
$q->select(Subtitle::getVisibleFields());
},
'videoTags.tag',
- 'storyboard'
+ 'storyboard',
]);
$video->setRelation('metadata', $metadata);
diff --git a/app/Services/Images/ImageService.php b/app/Services/Images/ImageService.php
index d663df19..bde5ac19 100644
--- a/app/Services/Images/ImageService.php
+++ b/app/Services/Images/ImageService.php
@@ -165,7 +165,7 @@ class ImageService {
[$relativeOutputPath, $absoluteOutputPath] = $this->resolvePath($owner, $imageType, $fmt, null, true);
- $response = Http::timeout(10)->connectTimeout(5)->retry(1, 250)->withOptions(['allow_redirects' => false])->accept('image/*')->get($url);
+ $response = Http::timeout(10)->connectTimeout(5)->retry(1, 250)->maxRedirects(3)->accept('image/*')->get($url);
if (! $response->successful()) {
throw new InvalidImageDataException('Failed to download image');
@@ -316,7 +316,7 @@ class ImageService {
Log::info("Images soft deleted by {$username} on " . class_basename($owner) . " {$uuid}", [
'owner_id' => $owner->getKey(),
'deleted_by' => $data->user->id,
- 'images' => $affected->map(fn ($i) => [
+ 'images' => $affected->map(fn($i) => [
'id' => $i->id,
'path' => $i->path,
'type' => $i->image_type,
diff --git a/resources/js/components/cards/data/ImageCard.vue b/resources/js/components/cards/data/ImageCard.vue
index abdd718b..c6fb43ab 100644
--- a/resources/js/components/cards/data/ImageCard.vue
+++ b/resources/js/components/cards/data/ImageCard.vue
@@ -64,7 +64,7 @@ const emit = defineEmits({
<template>
<div
:class="
- cn('relative flex w-full flex-wrap items-center justify-between rounded-lg text-xs shadow-sm transition sm:text-sm', 'data-card ring-2 ring-transparent', {
+ cn('relative flex w-full flex-col items-start rounded-lg text-xs shadow-sm transition sm:text-sm', 'data-card ring-2 ring-transparent', {
'pointer-events-none! opacity-50': isDisabled,
'ring-primary-active/60': isPrimary,
})
@@ -85,9 +85,9 @@ const emit = defineEmits({
</div>
<!-- Overlay -->
- <div :class="cn('duration-input absolute inset-0 z-3 flex items-start justify-between gap-1 p-2 transition-[translate,margin]')">
+ <div :class="cn('duration-input pointer-events-none absolute inset-0 z-3 flex items-start justify-between gap-1 p-2 transition-[translate,margin]')">
<VideoControlWrapper :class="cn('w-fit opacity-0 transition-opacity duration-100', { 'opacity-100': isPrimary })">
- <p :class="cn('px-1 text-white text-shadow-lg')">Primary</p>
+ <p :class="cn('pointer-events-auto px-1 text-white text-shadow-lg')">Primary</p>
</VideoControlWrapper>
<div class="text-foreground-i dark:text-foreground-0 pointer-events-auto ms-auto flex gap-1" v-if="data.type !== 'preview'">
<ButtonIcon v-if="isPendingDelete" class="overlay-button hover:ring-1" :type="'button'" title="Undo delete" :variant="'ghost'" @click="$emit('restore')">
@@ -140,9 +140,8 @@ const emit = defineEmits({
</div>
</div>
</div>
- <div class="text-foreground-1 flex w-full flex-col items-start justify-between gap-x-4 gap-y-2 p-3 dark:text-inherit">
+ <div class="text-foreground-1 flex h-full w-full flex-1 flex-col items-start gap-x-4 gap-y-2 p-3 dark:text-inherit">
<p class="w-full truncate" :title="filename">{{ filename }}</p>
- {{ data.source }}
<span class="-ms-0.5 flex w-full flex-wrap gap-1 overflow-clip [overflow-clip-margin:4px]">
<MediaTag
v-for="(tag, index) in tags"