sogman I've got great news for you - in the discord this has been recommended for ages and SLR is redesigning their website for a while now...
I've made a userscript that does this feature on browsers, you need something like the tampermonkey extnsion, put this code in your UserScripts folder and walla! Alphabetical playlists 😃
You're welcome!!!
I got tired of waiting for SLR to do this stuff so I just did it myself! SLR probably have a nice redesign waiting, but they've said that for months and months, and look how old this topic is.......
// @name SexLikeReal.com Add, Remove, and Sort Playlist Alphabetically (Force Refresh) by ZackFair141
// @namespace http://tampermonkey.net/
// @version 1.7
// @description Adds a video to the topmost playlist, removes it after a delay, and sorts the playlist alphabetically with forced refresh.
// @author You
// @match *://*/*
// @grant none
// ==/UserScript==
(function () {
'use strict';
let sortedFlag = false; // Prevent redundant sorting
// Function to add and remove the video from the topmost playlist
function toggleTopPlaylist() {
const topPlaylistCheckbox = document.querySelector(
'.u-px--four.u-pt--four.u-pb--two.u-absolute.u-stretch.u-width--full.u-height--full .o-checkbox input[type="checkbox"]'
);
if (!topPlaylistCheckbox) {
console.error('Topmost playlist checkbox not found.');
return;
}
// Check the checkbox to simulate adding the video
topPlaylistCheckbox.checked = true;
topPlaylistCheckbox.dispatchEvent(new Event('change', { bubbles: true }));
console.log('Video added to the topmost playlist.');
// Uncheck the checkbox after a 1-second delay to simulate removal
setTimeout(() => {
topPlaylistCheckbox.checked = false;
topPlaylistCheckbox.dispatchEvent(new Event('change', { bubbles: true }));
console.log('Video removed from the topmost playlist.');
// Sort the playlist after adding and removing the video
setTimeout(() => {
console.log('Sorting playlist alphabetically...');
sortPlaylist();
}, 500); // Additional delay to ensure playlist updates
}, 1000); // 1-second delay
}
// Function to sort the playlist alphabetically
function sortPlaylist() {
const playlistContainer = document.querySelector(
'.u-px--four.u-pt--four.u-pb--two.u-absolute.u-stretch.u-width--full.u-height--full'
);
if (!playlistContainer) {
console.log('Playlist container not found.');
return;
}
const items = Array.from(
playlistContainer.querySelectorAll('.o-checkbox.o-checkbox--wh.u-transition--base.u-pb--four')
);
if (items.length === 0) {
console.log('No playlist items found.');
return;
}
// Sort items alphabetically by their text content
items.sort((a, b) => {
const textA = a.textContent.trim().toUpperCase();
const textB = b.textContent.trim().toUpperCase();
return textA.localeCompare(textB);
});
// Clear the container and re-add items in sorted order
playlistContainer.innerHTML = '';
items.forEach((item) => playlistContainer.appendChild(item));
console.log('Playlist sorted alphabetically!');
// Force re-rendering of the modal to refresh UI
refreshModal();
}
// Function to simulate a refresh of the playlist modal
function refreshModal() {
const playlistDialog = document.querySelector('#playlist');
if (playlistDialog) {
// Temporarily remove and re-add the dialog from the DOM
const parent = playlistDialog.parentElement;
parent.removeChild(playlistDialog);
setTimeout(() => {
parent.appendChild(playlistDialog);
console.log('Playlist modal refreshed!');
}, 100); // Wait 100ms before re-adding
}
}
// Add a click event listener to the button that opens the playlist
const button = document.querySelector(
'button.js-m-modal[data-modal-target="playlist"]'
);
if (button) {
button.addEventListener('click', () => {
console.log('Playlist button clicked. Adding, removing, and sorting...');
toggleTopPlaylist();
});
} else {
console.error('Playlist button not found.');
}
console.log('Script is running and listening for playlist button clicks...');
})();