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) => {
|
||||
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;
|
||||
|
||||
document.getElementById("acontent")?.scrollTo(0, 0);
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
@updateQueue="updateQueue"
|
||||
:isPlaying="queue.playing"
|
||||
:isCurrent="queue.currentid == track.trackid"
|
||||
:isHighlighted="highlightid == track.trackid"
|
||||
:isHighlighted="highlightid == track.uniq_hash"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -46,16 +46,16 @@ const route = useRoute();
|
||||
const routename = route.name as string;
|
||||
const highlightid = ref(route.query.highlight as string);
|
||||
|
||||
function highlightTrack(trackid: string) {
|
||||
focusElem(`track-${trackid}`, 400, "center");
|
||||
function highlightTrack(t_hash: string) {
|
||||
focusElem(`track-${t_hash}`, 500, "center");
|
||||
}
|
||||
|
||||
onBeforeRouteUpdate(async (to, from) => {
|
||||
const hid = to.query.highlight as string;
|
||||
highlightid.value = hid as string;
|
||||
const h_hash = to.query.highlight as string;
|
||||
highlightid.value = h_hash as string;
|
||||
|
||||
if (hid) {
|
||||
highlightTrack(hid as string);
|
||||
if (h_hash) {
|
||||
highlightTrack(h_hash);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
highlighted: isHighlighted,
|
||||
},
|
||||
]"
|
||||
v-bind:class="`track-${track.trackid}`"
|
||||
v-bind:class="`track-${track.uniq_hash}`"
|
||||
@dblclick="emitUpdate(track)"
|
||||
@contextmenu="showContextMenu"
|
||||
>
|
||||
|
||||
@@ -90,7 +90,7 @@ export default async (
|
||||
Router.push({
|
||||
name: "FolderView",
|
||||
params: { path: track.folder },
|
||||
query: { highlight: track.trackid },
|
||||
query: { highlight: track.uniq_hash },
|
||||
});
|
||||
},
|
||||
icon: "folder",
|
||||
|
||||
+2
-1
@@ -16,6 +16,7 @@ export interface Track {
|
||||
tracknumber?: number;
|
||||
disknumber?: number;
|
||||
index?: number;
|
||||
uniq_hash: string;
|
||||
}
|
||||
|
||||
export interface Folder {
|
||||
@@ -64,7 +65,7 @@ export interface Playlist {
|
||||
count?: number;
|
||||
lastUpdated?: string;
|
||||
thumb?: string;
|
||||
duration?: number
|
||||
duration?: number;
|
||||
}
|
||||
|
||||
export interface Notif {
|
||||
|
||||
Reference in New Issue
Block a user