Skip to content

A self-hosted media server and file management system

History bug fix

aminnausin391e02fa37d8
diff --git a/resources/js/components/video/VideoPlayer.vue b/resources/js/components/video/VideoPlayer.vue
index a8b2bb96..31293f41 100644
--- a/resources/js/components/video/VideoPlayer.vue
+++ b/resources/js/components/video/VideoPlayer.vue
@@ -82,6 +82,7 @@ const heatMap = computed(() => {
});
const pastFirst = ref(false);
+const currentID = ref(-1);
const ContentStore = useContentStore();
const { stateVideo } = storeToRefs(ContentStore);
const { createRecord } = ContentStore;
@@ -96,8 +97,10 @@ const initVideoPlayer = () => {
}
const playVideo = () => {
+ if(currentID.value === stateVideo.value.id) return; // stop recording every time video seek
pastFirst.value = true;
- createRecord(stateVideo.value.id)
+ currentID.value = stateVideo.value.id;
+ createRecord(stateVideo.value.id);
}
watch(stateVideo, initVideoPlayer)
diff --git a/resources/js/stores/ContentStore.js b/resources/js/stores/ContentStore.js
index 49218761..6b10d4b1 100644
--- a/resources/js/stores/ContentStore.js
+++ b/resources/js/stores/ContentStore.js
@@ -152,7 +152,7 @@ export const useContentStore = defineStore('Content', () => {
playlistFilter();
}
- const playlistSort = (column = 'date', dir = 1) => {
+ const playlistSort = (column = 'name', dir = 1) => {
if(dir === 0 && sortQuery.value[column] === 0) dir = 1; // If never used, sort ascending
else if(dir === 0) dir = -sortQuery.value[column]; // if toggle, set negative order