Show checkmark for already downloaded currently playing videos (#35)

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-05-02 00:50:34 +05:30 committed by GitHub
parent 82a64ff4ba
commit 761030ca55
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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);