Skip to content

Commit

Permalink
fix(inline recs): Order by medium and track indexes
Browse files Browse the repository at this point in the history
Display total tracks in tooltip
Cosmetic fixes
  • Loading branch information
jesus2099 committed Jun 10, 2024
1 parent 613209f commit 707b4d6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions mb_qol_inline_recording_tracks.user.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ==UserScript==
// @name MB: QoL: Inline all recording's tracks on releases
// @version 2024.5.3
// @version 2024.5.8
// @description Display all tracks and releases on which a recording appears from the release page.
// @author ROpdebee
// @license MIT; https://opensource.org/licenses/MIT
Expand Down Expand Up @@ -61,19 +61,19 @@ async function loadRecordingInfo(rids) {
return perRecId;
}

function getTrackIndex(track, mediumPosition) {
return `<a href="/track/${track.id}">#${mediumPosition}.${track.number}</a>`;
function getTrackIndex(track, mediumPosition, mediumTrackCount) {
return `<a href="/track/${track.id}" title="track ${track.number} of ${mediumTrackCount}">#${mediumPosition}.${track.number}</a>`;
}

function getTrackIndices(media) {
return media.flatMap((medium) =>
medium.track.map((track) => getTrackIndex(track, medium.position)))
medium.track.map((track) => getTrackIndex(track, medium.position, medium['track-count'])))
.join(', ');
}

function getReleaseName(release) {
let releaseComment = release.disambiguation || "";
return `<!-- order by: ${release.date || "????"} ${release.title} ${releaseComment} --><a href="/release/${release.id}" ` + (release.date ? `title="${release.date}"` : '') + `>${release.title}</a>` + (releaseComment ? ` <span class="comment">(${releaseComment})</span>` : '');
let releaseComment = release.disambiguation || '';
return `<!-- order by: [${release.date || ''}] ${release.title} ${releaseComment} ${release.media[0].position}.${release.media[0].track[0].number} --><a href="/release/${release.id}" ` + (release.date ? `title="released on ${release.date}"` : '') + `>${release.title}</a>` + (releaseComment ? ` <span class="comment">(${releaseComment})</span>` : '');
}

function formatRow(release) {
Expand Down

0 comments on commit 707b4d6

Please sign in to comment.