Add play button to media rows when items are tagged

This commit is contained in:
Jarian Cottingham 2026-02-21 15:41:08 -06:00
parent fd635c0dbc
commit 6438deb3d0

View File

@ -238,6 +238,36 @@ function addTagToEpisode(filePath, tagType) {
// Add a data attribute to track that this file is tagged
item.setAttribute('data-tagged-' + tagType, 'true');
// Add play button to the end of the row
const playButton = document.createElement('button');
playButton.className = 'play-button';
playButton.innerHTML = '▶️';
playButton.title = 'Play file';
playButton.dataset.filePath = filePath;
// Style the play button
playButton.style.marginLeft = '10px';
playButton.style.padding = '5px 10px';
playButton.style.border = 'none';
playButton.style.borderRadius = '3px';
playButton.style.cursor = 'pointer';
playButton.style.backgroundColor = '#28a745';
playButton.style.color = 'white';
playButton.style.fontWeight = 'bold';
playButton.style.fontSize = '14px';
// Add click handler for play button
playButton.addEventListener('click', function(e) {
e.stopPropagation();
openVideoPreview(filePath);
});
// Add the play button to the file item
const fileTags = item.querySelector('.file-tags');
if (fileTags) {
fileTags.appendChild(playButton);
}
}
}
});
@ -272,6 +302,12 @@ function untagFile(filePath, tagType) {
// Remove the data attribute
item.removeAttribute('data-tagged-' + tagType);
// Remove play button if it exists
const playButton = item.querySelector('.play-button');
if (playButton) {
playButton.remove();
}
}
}
});