A self-hosted media server and file management system
Vue ffmpegfile-serverjellyfinlaravelmediamedia-playermedia-servermediabrowsermediaservermusicmusic-librarymusic-playermusicplayerself-hostedvuejs
sigh sorting arrows
aminnausindab671363e3b
diff --git a/resources/js/components/dashboard/DashboardActivity.vue b/resources/js/components/dashboard/DashboardActivity.vueindex 6104ba2a..a3a7a93e 100644--- a/resources/js/components/dashboard/DashboardActivity.vue+++ b/resources/js/components/dashboard/DashboardActivity.vue@@ -57,8 +57,8 @@ const handleSort = async (column = 'date', dir = 1) => {}let valueA = categoryA[column as keyof CategoryResource];let valueB = categoryB[column as keyof CategoryResource];- if (valueA && valueB && typeof valueA === 'number' && typeof valueB === 'number') return (valueB - valueA) * dir;- return `${valueB}`?.localeCompare(`${valueA}`) * dir;+ if (valueA && valueB && typeof valueA === 'number' && typeof valueB === 'number') return (valueA - valueB) * dir;+ return `${valueA}`?.localeCompare(`${valueB}`) * dir;});categories.value = tempList;return tempList;diff --git a/resources/js/components/dashboard/DashboardLibraries.vue b/resources/js/components/dashboard/DashboardLibraries.vueindex 224db8b8..2cf4de10 100644--- a/resources/js/components/dashboard/DashboardLibraries.vue+++ b/resources/js/components/dashboard/DashboardLibraries.vue@@ -80,8 +80,8 @@ const handleSort = async (column = 'date', dir = 1) => {}let valueA = categoryA[column as keyof CategoryResource];let valueB = categoryB[column as keyof CategoryResource];- if (valueA && valueB && typeof valueA === 'number' && typeof valueB === 'number') return (valueB - valueA) * dir;- return `${valueB}`?.localeCompare(`${valueA}`) * dir;+ if (valueA && valueB && typeof valueA === 'number' && typeof valueB === 'number') return (valueA - valueB) * dir;+ return `${valueA}`?.localeCompare(`${valueB}`) * dir;});categories.value = tempList;return tempList;diff --git a/resources/js/components/dashboard/DashboardTasks.vue b/resources/js/components/dashboard/DashboardTasks.vueindex a12faa9f..bec99cc7 100644--- a/resources/js/components/dashboard/DashboardTasks.vue+++ b/resources/js/components/dashboard/DashboardTasks.vue@@ -91,8 +91,8 @@ const handleSort = async (column = 'date', dir = 1) => {let valueA = taskA[column as keyof TaskResource];let valueB = taskB[column as keyof TaskResource];- if (valueA && valueB && typeof valueA === 'number' && typeof valueB === 'number') return (valueB - valueA) * dir;- return `${valueB}`?.localeCompare(`${valueA}`) * dir;+ if (valueA && valueB && typeof valueA === 'number' && typeof valueB === 'number') return (valueA - valueB) * dir;+ return `${valueA}`?.localeCompare(`${valueB}`) * dir;});tasks.value = tempList;return tempList;diff --git a/resources/js/components/dashboard/DashboardUsers.vue b/resources/js/components/dashboard/DashboardUsers.vueindex 1cbaf02c..6d14c16c 100644--- a/resources/js/components/dashboard/DashboardUsers.vue+++ b/resources/js/components/dashboard/DashboardUsers.vue@@ -65,8 +65,8 @@ const handleSort = async (column = 'date', dir = 1) => {}let valueA = userA[column as keyof UserResource];let valueB = userB[column as keyof UserResource];- if (valueA && valueB && typeof valueA === 'number' && typeof valueB === 'number') return (valueB - valueA) * dir;- return `${valueB}`?.localeCompare(`${valueA}`) * dir;+ if (valueA && valueB && typeof valueA === 'number' && typeof valueB === 'number') return (valueA - valueB) * dir;+ return `${valueA}`?.localeCompare(`${valueB}`) * dir;});users.value = tempList;return tempList;diff --git a/resources/js/components/table/TableBase.vue b/resources/js/components/table/TableBase.vueindex 2e9268a1..75065244 100755--- a/resources/js/components/table/TableBase.vue+++ b/resources/js/components/table/TableBase.vue@@ -32,16 +32,18 @@ const props = withDefaults(searchQuery?: any;selectedID?: any;tableStyles?: string;+ startAscending?: boolean;}>(),{useToolbar: true,usePagination: true,itemsPerPage: 12,selectedID: null,+ startAscending: true,},);const tableData = useTable(props);-const sortAscending = ref(true);+const sortAscending = ref(props.startAscending);const lastSortKey = ref('');const handleSortChange = (sortKey?: { title?: string; value?: string; disabled?: boolean }) => {@@ -86,12 +88,13 @@ watch(props.data, tableData.handlePageReset, { immediate: true });sortAscending = !sortAscending;handleSortChange();"- title="Sort Results"- aria-label="Sort Results"+ :title="`Sort Results`"+ :aria-label="`Sort Results`"><template #icon>- <PhSortAscendingLight v-if="sortAscending" width="24" height="24" />- <PhSortDescendingLight v-else width="24" height="24" />+ <!-- Arrow Pointing Down if ascending and then Up otherwise (arrow shows what to change to ?? idk descending points up actually)-->+ <PhSortDescendingLight v-if="sortAscending" width="24" height="24" />+ <PhSortAscendingLight v-else width="24" height="24" /></template></ButtonIcon></span>diff --git a/resources/js/stores/ContentStore.js b/resources/js/stores/ContentStore.jsindex 30f12807..8a19cc5e 100755--- a/resources/js/stores/ContentStore.js+++ b/resources/js/stores/ContentStore.js@@ -51,10 +51,10 @@ export const useContentStore = defineStore('Content', () => {return (dateB - dateA) * videoSort.value.dir;}let valueA = videoA[videoSort.value.column];- let valueB = videoB.relationships[videoSort.value.column];+ let valueB = videoB[videoSort.value.column];if (valueA && valueB && typeof valueA === 'number' && typeof valueB === 'number')- return (valueB - valueA) * videoSort.value.dir;- return `${valueB}`?.localeCompare(`${valueA}`) * videoSort.value.dir;+ return (valueA - valueB) * videoSort.value.dir;+ return `${valueA}`?.localeCompare(`${valueB}`) * videoSort.value.dir;});return sortedList;@@ -70,10 +70,11 @@ export const useContentStore = defineStore('Content', () => {let dateB = new Date(recordB?.attributes['created_at']);return (dateB - dateA) * dir;}- let valueA = recordA.relationships[column];- let valueB = recordB.relationships[column];- if (valueA && valueB && typeof valueA === 'number' && typeof valueB === 'number') return (valueB - valueA) * dir;- return `${valueB}`?.localeCompare(`${valueA}`) * dir;+ let valueA = column === 'folder_name' ? recordA.relationships?.folder?.name : recordA.relationships[column];+ let valueB = column === 'folder_name' ? recordB.relationships?.folder?.name : recordB.relationships[column];++ if (valueA && valueB && typeof valueA === 'number' && typeof valueB === 'number') return (valueA - valueB) * dir;+ return `${valueA}`?.localeCompare(`${valueB}`) * dir;});stateRecords.value = tempList;return tempList;diff --git a/resources/js/views/VideoView.vue b/resources/js/views/VideoView.vueindex 153c265c..fcbd9100 100755--- a/resources/js/views/VideoView.vue+++ b/resources/js/views/VideoView.vue@@ -133,6 +133,7 @@ watch(() => selectedSideBar.value, cycleSideBar, { immediate: false });:sortAction="handleSort":sortingOptions="sortingOptions":selectedID="stateVideo?.id"+ :startAscending="true"@search="handleSearch"/></section>