mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-03 20:13:02 +00:00
rewrite highlight track to use track.uniq_hash instead of trackid
This commit is contained in:
+2
-2
@@ -62,9 +62,9 @@ function removeHighlight(route: RouteLocationNormalized) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
router.afterEach((to, from) => {
|
router.afterEach((to, from) => {
|
||||||
const hid = to.query.highlight as string;
|
const h_hash = to.query.highlight as string;
|
||||||
|
|
||||||
if (hid) removeHighlight(to);
|
if (h_hash) removeHighlight(to);
|
||||||
if (isSameRoute(to, from)) return;
|
if (isSameRoute(to, from)) return;
|
||||||
|
|
||||||
document.getElementById("acontent")?.scrollTo(0, 0);
|
document.getElementById("acontent")?.scrollTo(0, 0);
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
@updateQueue="updateQueue"
|
@updateQueue="updateQueue"
|
||||||
:isPlaying="queue.playing"
|
:isPlaying="queue.playing"
|
||||||
:isCurrent="queue.currentid == track.trackid"
|
:isCurrent="queue.currentid == track.trackid"
|
||||||
:isHighlighted="highlightid == track.trackid"
|
:isHighlighted="highlightid == track.uniq_hash"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -46,16 +46,16 @@ const route = useRoute();
|
|||||||
const routename = route.name as string;
|
const routename = route.name as string;
|
||||||
const highlightid = ref(route.query.highlight as string);
|
const highlightid = ref(route.query.highlight as string);
|
||||||
|
|
||||||
function highlightTrack(trackid: string) {
|
function highlightTrack(t_hash: string) {
|
||||||
focusElem(`track-${trackid}`, 400, "center");
|
focusElem(`track-${t_hash}`, 500, "center");
|
||||||
}
|
}
|
||||||
|
|
||||||
onBeforeRouteUpdate(async (to, from) => {
|
onBeforeRouteUpdate(async (to, from) => {
|
||||||
const hid = to.query.highlight as string;
|
const h_hash = to.query.highlight as string;
|
||||||
highlightid.value = hid as string;
|
highlightid.value = h_hash as string;
|
||||||
|
|
||||||
if (hid) {
|
if (h_hash) {
|
||||||
highlightTrack(hid as string);
|
highlightTrack(h_hash);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
highlighted: isHighlighted,
|
highlighted: isHighlighted,
|
||||||
},
|
},
|
||||||
]"
|
]"
|
||||||
v-bind:class="`track-${track.trackid}`"
|
v-bind:class="`track-${track.uniq_hash}`"
|
||||||
@dblclick="emitUpdate(track)"
|
@dblclick="emitUpdate(track)"
|
||||||
@contextmenu="showContextMenu"
|
@contextmenu="showContextMenu"
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ export default async (
|
|||||||
Router.push({
|
Router.push({
|
||||||
name: "FolderView",
|
name: "FolderView",
|
||||||
params: { path: track.folder },
|
params: { path: track.folder },
|
||||||
query: { highlight: track.trackid },
|
query: { highlight: track.uniq_hash },
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
icon: "folder",
|
icon: "folder",
|
||||||
|
|||||||
+2
-1
@@ -16,6 +16,7 @@ export interface Track {
|
|||||||
tracknumber?: number;
|
tracknumber?: number;
|
||||||
disknumber?: number;
|
disknumber?: number;
|
||||||
index?: number;
|
index?: number;
|
||||||
|
uniq_hash: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Folder {
|
export interface Folder {
|
||||||
@@ -64,7 +65,7 @@ export interface Playlist {
|
|||||||
count?: number;
|
count?: number;
|
||||||
lastUpdated?: string;
|
lastUpdated?: string;
|
||||||
thumb?: string;
|
thumb?: string;
|
||||||
duration?: number
|
duration?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Notif {
|
export interface Notif {
|
||||||
|
|||||||
Reference in New Issue
Block a user