Skip to content

A self-hosted media server and file management system

video search and sort additional columns

aminnausineb2be587cc57
diff --git a/resources/js/components/cards/VideoCard.vue b/resources/js/components/cards/VideoCard.vue
index 04c41d17..d56c005a 100755
--- a/resources/js/components/cards/VideoCard.vue
+++ b/resources/js/components/cards/VideoCard.vue
@@ -46,30 +46,30 @@ watch(props, handlePropsUpdate, { immediate: true, deep: true });
<!-- <span class="text-ellipsis text-wrap line-clamp-1 text-sm sm:text-base text-neutral-500 dark:text-neutral-400">{{
metaData?.fields?.description
}}</span> -->
- <ProiconsComment class="my-auto ms-4 group-hover:opacity-20 opacity-100 transition-opacity duration-300" />
+ <ProiconsComment class="my-auto ms-4 group-hover:opacity-20 opacity-100 transition-opacity duration-300" title="Description" />
</h3>
</template>
<template #content>
{{ metaData?.fields?.description }}
</template>
</HoverCard>
- <h3 v-else class="w-full line-clamp-1 flex gap-8 items-end min-w-fit max-w-[30%]" title="title">
+ <h3 v-else class="w-full line-clamp-1 flex gap-8 items-end min-w-fit max-w-[30%]" title="Title">
{{ metaData?.fields?.title }}
<!-- <span class="text-ellipsis text-wrap line-clamp-1 text-sm sm:text-base text-neutral-500 dark:text-neutral-400">{{
metaData?.fields?.description
}}</span> -->
</h3>
- <h4 class="text-ellipsis text-wrap line-clamp-1 text-neutral-500 dark:text-neutral-400 text-sm">
+ <h4 class="text-ellipsis text-wrap line-clamp-1 text-neutral-500 dark:text-neutral-400 text-sm" title="Duration">
{{ metaData?.fields?.duration }}
</h4>
</section>
<section class="flex justify-between gap-4 w-full items-start text-sm sm:w-auto text-neutral-500 dark:text-neutral-400">
<span class="flex gap-2 items-center w-full flex-1">
- <h4 class="text-nowrap text-start truncate">
+ <h4 class="text-nowrap text-start truncate" title="View Count">
{{ metaData?.fields?.views }}
</h4>
- <span class="hidden sm:flex flex-wrap gap-1 max-h-5 h-full sm:max-h-[24px] px-2 flex-1">
+ <span class="hidden sm:flex flex-wrap gap-1 max-h-5 h-full sm:max-h-[24px] px-2 flex-1" title="Tags">
<ChipTag
v-for="(tag, index) in props.data?.video_tags"
v-bind:key="index"
@@ -79,7 +79,7 @@ watch(props, handlePropsUpdate, { immediate: true, deep: true });
</span>
</span>
- <h4 class="text-end truncate">
+ <h4 class="text-end truncate" title="Date Uploaded">
{{ toFormattedDate(new Date(props.data?.date + ' GMT')) }}
</h4>
</section>
diff --git a/resources/js/stores/ContentStore.js b/resources/js/stores/ContentStore.js
index e0ef78f4..35964310 100755
--- a/resources/js/stores/ContentStore.js
+++ b/resources/js/stores/ContentStore.js
@@ -33,7 +33,18 @@ export const useContentStore = defineStore('Content', () => {
? list.filter((video) => {
{
try {
- let strRepresentation = [video.name, video.date].join(' ').toLowerCase();
+ let strRepresentation = [
+ video.name,
+ video.title,
+ video.date,
+ video.description,
+ video.episode ?? '',
+ video.season ?? '',
+ video.views,
+ video.video_tags.reduce((tags, tag) => `${tags} ${tag?.name ?? ''}`, ''),
+ ]
+ .join(' ')
+ .toLowerCase();
// console.log(strRepresentation);
return strRepresentation.includes(searchQuery.value.toLowerCase());
@@ -46,15 +57,14 @@ export const useContentStore = defineStore('Content', () => {
: list;
let sortedList = searchedList.sort((videoA, videoB) => {
- if (videoSort.value.column === 'date') {
+ if (videoSort.value.column === 'date' || videoSort.value.column === 'date_released') {
let dateA = new Date(videoA[videoSort.value.column]);
let dateB = new Date(videoB[videoSort.value.column]);
return (dateB - dateA) * videoSort.value.dir;
}
let valueA = videoA[videoSort.value.column];
let valueB = videoB[videoSort.value.column];
- if (valueA && valueB && typeof valueA === 'number' && typeof valueB === 'number')
- return (valueA - valueB) * videoSort.value.dir;
+ if (valueA && valueB && typeof valueA === 'number' && typeof valueB === 'number') return (valueA - valueB) * videoSort.value.dir;
return `${valueA}`?.localeCompare(`${valueB}`) * videoSort.value.dir;
});
diff --git a/resources/js/views/VideoView.vue b/resources/js/views/VideoView.vue
index 0bee725b..3f643d75 100755
--- a/resources/js/views/VideoView.vue
+++ b/resources/js/views/VideoView.vue
@@ -75,19 +75,19 @@ const sortingOptions = ref([
disabled: false,
},
{
- title: 'Date released',
+ title: 'Date Released',
value: 'date_released',
- disabled: true,
+ disabled: false,
},
{
title: 'Episode',
value: 'episode',
- disabled: true,
+ disabled: false,
},
{
title: 'Season',
value: 'season',
- disabled: true,
+ disabled: false,
},
]);