Skip to content

A self-hosted media server and file management system

fix pagination index start from 1 and optimise video playback

aminnausined40b384712e
diff --git a/resources/js/components/VideoTable.vue b/resources/js/components/VideoTable.vue
index b7ee27d1..22010a6a 100644
--- a/resources/js/components/VideoTable.vue
+++ b/resources/js/components/VideoTable.vue
@@ -15,8 +15,9 @@ const { playlistFind } = ContentStore;
const currentPage = ref(1);
const itemsPerPage = ref(10);
const filteredPage = computed(() => {
- const minIndex = itemsPerPage.value * (currentPage.value - 1) + 1;
+ const minIndex = itemsPerPage.value * (currentPage.value - 1);
const maxIndex = Math.min(itemsPerPage.value * (currentPage.value), stateFilteredPlaylist.value.length);
+
return stateFilteredPlaylist.value.slice(minIndex, maxIndex);
});
diff --git a/resources/js/stores/ContentStore.js b/resources/js/stores/ContentStore.js
index d1b05703..597e3f7e 100644
--- a/resources/js/stores/ContentStore.js
+++ b/resources/js/stores/ContentStore.js
@@ -131,8 +131,8 @@ export const useContentStore = defineStore('Content', () => {
}
function playlistFind(id){
+ if(stateVideo.value.id === id) return;
stateVideo.value = statePlaylist.value.find((video) => {
- console.log('found id ' + (video?.id ?? 'null'));
return video.id === id
});
}
@@ -155,8 +155,8 @@ export const useContentStore = defineStore('Content', () => {
const playlistFilter = (query) => {
let tempList = query ? statePlaylist.value.filter((video) => {{
try {
- let strRepresentation = [video.attributes.name, video.attributes.date].join(' ');
- return strRepresentation.includes(query)
+ let strRepresentation = [video.attributes.name, video.attributes.date].join(' ').toLowerCase();
+ return strRepresentation.includes(query.toLowerCase())
} catch (error) {
console.log(error);
return false