Skip to content

A self-hosted media server and file management system

chore: code smells

aminnausin1b02ce49d96e
diff --git a/resources/js/components/lazy/LazyImage.vue b/resources/js/components/lazy/LazyImage.vue
index 5a12ac29..9686e6ae 100644
--- a/resources/js/components/lazy/LazyImage.vue
+++ b/resources/js/components/lazy/LazyImage.vue
@@ -1,10 +1,10 @@
<script setup lang="ts">
+import { SvgSpinners90RingWithBg } from '@/components/cedar-ui/icons';
import { ref, useAttrs } from 'vue';
-import { SvgSpinners90RingWithBg } from '../cedar-ui/icons';
defineOptions({ inheritAttrs: false });
-const props = defineProps<{ src?: string }>();
+const props = defineProps<{ src?: string; alt?: string }>();
const attrs = useAttrs();
const isLoading = ref(true);
@@ -17,8 +17,9 @@ const isError = ref(false);
</div>
<img
v-bind="attrs"
- :src="src"
loading="lazy"
+ :alt="alt ?? 'image'"
+ :src="src"
:class="[{ 'scale-85 opacity-0': isLoading }, 'transition-all ease-in-out']"
@load="
isLoading = false;
diff --git a/resources/js/components/video/VideoPlayer.vue b/resources/js/components/video/VideoPlayer.vue
index a3d9d20b..457bead3 100755
--- a/resources/js/components/video/VideoPlayer.vue
+++ b/resources/js/components/video/VideoPlayer.vue
@@ -3,7 +3,7 @@ import type { ComputedRef, HTMLAttributes, Ref } from 'vue';
import type { FolderResource, VideoResource } from '@/types/resources';
import type { ContextMenuItem, PopoverItem } from '@/types/types';
-import { getScreenSize, handleStorageURL, isInputLikeElement, isMobileDevice, toFormattedDate, toFormattedDuration, formatBitrate } from '@/service/util';
+import { getScreenSize, handleStorageURL, isInputLikeElement, isMobileDevice, toFormattedDate, toFormattedDuration } from '@/service/util';
import { controlsHideTime, playbackDataBuffer, playerHealthBuffer, volumeDelta, playbackDelta, playbackMin, playbackMax } from '@/service/player/playerConstants';
import { computed, nextTick, onBeforeUnmount, onMounted, provide, ref, useTemplateRef, watch } from 'vue';
import { copyVideoFrame, saveVideoFrame } from '@/service/player/frameService';
@@ -13,7 +13,6 @@ import { useVideoPlayback } from '@/service/queries';
import { ToastController } from '@/components/cedar-ui/toast';
import { useContentStore } from '@/stores/ContentStore';
import { debounce, round } from 'lodash-es';
-import { ButtonCorner } from '@/components/cedar-ui/button';
import { useAuthStore } from '@/stores/AuthStore';
import { ContextMenu } from '@/components/cedar-ui/context-menu';
import { useAppStore } from '@/stores/AppStore';
@@ -180,7 +179,7 @@ const bufferHealth = computed(() => {
return toFormattedDuration(bufferTime.value, false) ?? '0s';
});
const videoButtonOffset = computed(() => {
- return 8 + (!isNormalView.value ? 8 : 0);
+ return 8 + (isNormalView.value ? 0 : 8);
});
const timeStrings = computed(() => {
const timeElapsedVerbose = toFormattedDuration((timeElapsed.value / 100) * timeDuration.value, false, 'verbose') ?? 'Unknown';