YT: do not try to get info again for current download

This commit is contained in:
Rafał Dzięgiel
2021-04-08 11:05:20 +02:00
parent cca3077936
commit ec6157763b

View File

@@ -893,9 +893,14 @@ class ClapperWidget extends Gtk.Grid
if(!this.player.ytClient)
this.player.ytClient = new YouTube.YouTubeClient();
const { ytClient } = this.player;
/* Speed up things by prefetching new video info before drop */
if(!this.player.ytClient.compareLastVideoId(videoId))
this.player.ytClient.getVideoInfoPromise(videoId).catch(debug);
if(
!ytClient.compareLastVideoId(videoId)
&& ytClient.downloadingVideoId !== videoId
)
ytClient.getVideoInfoPromise(videoId).catch(debug);
}
_onDataDrop(dropTarget, value, x, y)