Show checkmark for already downloaded currently playing videos

Looks like this was regressed from v0.2.1 to v0.2.2 in this commit sha:
f8d69f5883

Already downloaded video currently playing in YouTube were still
showing the download icon instead of checkmark icon in TA.

This commit should fix this.
This commit is contained in:
Ritiek Malhotra 2024-04-07 12:44:11 +05:30
parent 82a64ff4ba
commit 8abcd698fa
No known key found for this signature in database
1 changed files with 7 additions and 5 deletions

View File

@ -437,11 +437,13 @@ function checkVideoExists(taButton) {
console.error(e);
}
if (!taButton.parentElement) return;
let videoId = getVideoId(taButton.parentElement);
taButton.setAttribute('data-id', videoId);
taButton.setAttribute('data-type', 'video');
taButton.title = `TA download video: ${taButton.parentElement.innerText} [${videoId}]`;
let videoId = taButton.dataset.id;
if (taButton.parentElement) {
videoId = getVideoId(taButton.parentElement);
taButton.setAttribute('data-id', videoId);
taButton.setAttribute('data-type', 'video');
taButton.title = `TA download video: ${taButton.parentElement.innerText} [${videoId}]`;
}
let message = { type: 'videoExists', videoId };
let sending = sendMessage(message);