Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Player_Checker/script.user.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ==UserScript==
// @name Player Checker (by MixesDB)
// @author User:Martin@MixesDB (Subfader@GitHub)
// @version 2026.03.02.8
// @version 2026.03.02.9
// @description Change the look and behaviour of certain DJ culture related websites to help contributing to MixesDB, e.g. add copy-paste ready tracklists in wiki syntax.
// @homepageURL https://www.mixesdb.com/w/Help:MixesDB_userscripts
// @supportURL https://discord.com/channels/1258107262833262603/1261652394799005858
Expand All @@ -10,7 +10,7 @@
// @require https://cdn.rawgit.com/mixesdb/userscripts/refs/heads/main/includes/jquery-3.7.1.min.js
// @require https://cdn.rawgit.com/mixesdb/userscripts/refs/heads/main/includes/waitForKeyElements.js
// @require https://raw.githubusercontent.com/mixesdb/userscripts/refs/heads/main/includes/global.js?v-Player_Checker_9
// @require https://raw.githubusercontent.com/mixesdb/userscripts/refs/heads/main/includes/toolkit.js?v-Player_Checker_33
// @require https://raw.githubusercontent.com/mixesdb/userscripts/refs/heads/main/includes/toolkit.js?v-Player_Checker_34
// @require https://raw.githubusercontent.com/mixesdb/userscripts/refs/heads/main/SoundCloud/api_funcs.js?v-Player_Checker_1
// @include http*finn-johannsen.de*
// @include http*groove.de/*/*/*/*podcast*
Expand Down
15 changes: 10 additions & 5 deletions includes/toolkit.js
Original file line number Diff line number Diff line change
Expand Up @@ -923,6 +923,7 @@ function getToolkit_run( thisUrl, type, outputType="detail page", wrapper, inser
var urlThis_clean = remove_mdbVariant_fromUrlStr( urlThis ),
urlThis_variant = get_mdbVariant_fromUrlStr( urlThis ),
urlThis_variantType = get_mdbVariantType_fromUrlStr( urlThis ),
urlThis_variantType_original = urlThis_variantType,
linkVariant = '<a href="'+urlThis_variant+'" class="mdb-variantLink processed" data-varianttype="'+urlThis_variantType+'">'+urlThis_variant+'</a>';

logVar( "urlThis", urlThis );
Expand All @@ -940,12 +941,14 @@ function getToolkit_run( thisUrl, type, outputType="detail page", wrapper, inser
linkThis
.attr( "href", urlThis_clean )
.attr( "data-varianttype", urlThis_variantType )
.attr( "data-variantorigin", urlThis_variantType_original )
.addClass("processed")
.text( urlThis_clean )
.after( " = " + linkVariant );

linkThis
.add( linkThis.closest("li.solvedUrlVariants") )
.attr( "data-variantorigin", urlThis_variantType_original )
.attr( "data-mdbvariant", urlThis_variant );

// Remove unused variant link
Expand All @@ -956,11 +959,13 @@ function getToolkit_run( thisUrl, type, outputType="detail page", wrapper, inser
});
});

waitForKeyElements("#mdb-toolkit li.mdb-toolkit-playerUrls-item.unused.filled.solvedUrlVariants", function( jNode ) { // wait for unused
// unused duplicated solvedUrlVariants
log("Unused duplicates");
var variantUrl = $('a[data-varianttype="preferred"]', jNode).attr("href");
$('#mdb-toolkit li.mdb-toolkit-playerUrls-item.solvedUrlVariants.unused[data-mdbvariant="'+variantUrl+'"]').remove();
waitForKeyElements("#mdb-toolkit li.mdb-toolkit-playerUrls-item.unused.filled.solvedUrlVariants[data-variantorigin='not-preferred']", function( jNode ) {
// Remove the mirrored (not-preferred) duplicate and keep the preferred origin item.
var actualUrl = $("a.mdb-actualPlayerLink", jNode).attr("href");

if( actualUrl && $('#mdb-toolkit li.mdb-toolkit-playerUrls-item.solvedUrlVariants.unused[data-variantorigin="preferred"][data-mdbvariant="'+actualUrl+'"]').length > 0 ) {
jNode.remove();
}
});
}
});
Expand Down