From a436a0ad91e13491019675fd1fcc7d1462660967 Mon Sep 17 00:00:00 2001 From: Kamil Date: Tue, 26 Nov 2024 15:23:08 +0000 Subject: [PATCH] allow manual track relinking fixes #13 --- static/js/preview.js | 10 ++++++++++ templates/partials/_track_table.html | 5 +++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/static/js/preview.js b/static/js/preview.js index 4affc87..395be85 100644 --- a/static/js/preview.js +++ b/static/js/preview.js @@ -83,4 +83,14 @@ function playJellyfinTrack(button, jellyfinId) { }; }) .catch(error => console.error('Error fetching Jellyfin stream URL:', error)); +} + +function handleJellyfinClick(event, jellyfinId, trackTitle, spotifyId) { + if (event.ctrlKey) { + // CTRL key is pressed, open the search modal + openSearchModal(trackTitle, spotifyId); + } else { + // CTRL key is not pressed, play the track + playJellyfinTrack(event.target, jellyfinId); + } } \ No newline at end of file diff --git a/templates/partials/_track_table.html b/templates/partials/_track_table.html index 5d9baac..eec4663 100644 --- a/templates/partials/_track_table.html +++ b/templates/partials/_track_table.html @@ -47,13 +47,14 @@ {% endif %} + {% set title = track.title | replace("'","") %} + {% if track.jellyfin_id %} - {% elif track.downloaded %} - {% set title = track.title | replace("'","") %}