From cd69dd9d3a2335297e9a146e9b84a524f2025e46 Mon Sep 17 00:00:00 2001 From: jesus2099 Date: Sat, 20 Jul 2024 17:38:48 +0200 Subject: [PATCH] fix(inline recs): Handle video recordings Remove `:first-child`, not needed and blocking video recordings detection The selector is already strict enough to not catch recordings from `div.ars` (I guess it was the reason for those) Example where video data track was not handled before this commit: https://musicbrainz.org/release/d9e494dd-9386-48e4-8c52-9764dd8b8a0f There was not problem with non-video data tracks: https://musicbrainz.org/release/b63ca2ff-782e-45fc-bfb9-b74dc6aefe00 --- mb_qol_inline_recording_tracks.user.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mb_qol_inline_recording_tracks.user.js b/mb_qol_inline_recording_tracks.user.js index 29953531..b2af12ad 100644 --- a/mb_qol_inline_recording_tracks.user.js +++ b/mb_qol_inline_recording_tracks.user.js @@ -94,7 +94,7 @@ function insertRows(recordingTd, recordingInfo) { } function loadAndInsert() { - let recAnchors = document.querySelectorAll('table.medium td > a[href^="/recording/"]:first-child, table.medium td > span:first-child > a[href^="/recording/"]:first-child, table.medium td > span:first-child > span:first-child > a[href^="/recording/"]:first-child'); + let recAnchors = document.querySelectorAll('table.medium td > a[href^="/recording/"], table.medium td > span > a[href^="/recording/"], table.medium td > span > span > a[href^="/recording/"]'); let todo = [...recAnchors] .map((a) => [a.closest('td'), a.href.split('/recording/')[1]]) .filter(([td]) => !td.querySelector('div.ars.ROpdebee_inline_tracks'));