Skip to content

Commit

Permalink
fix(inline recs): Handle video recordings
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jesus2099 authored and kellnerd committed Jul 25, 2024
1 parent e267bee commit cd69dd9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mb_qol_inline_recording_tracks.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down

0 comments on commit cd69dd9

Please sign in to comment.