Skip to content

Commit

Permalink
fixing indexing bug (#100)
Browse files Browse the repository at this point in the history
Co-authored-by: Mick Nassar <[email protected]>
  • Loading branch information
mnasty and Mick Nassar authored Apr 9, 2024
1 parent 99a72c5 commit 7eb8c48
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion modules/QueryManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class QueryManager {
}
downloadVideo.audioQuality = (downloadVideo.audioQuality != null) ? downloadVideo.audioQuality : "best";
let progressBar = new ProgressBar(this, downloadVideo);
downloadVideo.setQuery(new DownloadQuery(downloadVideo.url, downloadVideo, this.environment, progressBar));
downloadVideo.setQuery(new DownloadQuery(downloadVideo.url, downloadVideo, this.environment, progressBar, this.playlistMetadata));
downloadVideo.query.connect().then(() => {
//Backup done call, sometimes it does not trigger automatically from within the downloadQuery.
if(downloadVideo.error) return;
Expand Down
8 changes: 2 additions & 6 deletions modules/Utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class Utils {
for(const entry of query.entries) {
let url;
if (entry.url == null) url = entry.webpage_url;
else url = (entry.ie_key != null && entry.ie_key === "Youtube") ? "https://youtube.com/watch?v=" + entry.url : entry.url;
else url = entry.url;
if(url != null && url.length > 0) {
let playlist = "?";
if(query.title != null) {
Expand All @@ -206,11 +206,7 @@ class Utils {
if(metadata == null) return null;
for(const video of metadata) {
if(video.video_url === video_url) {
if(playlist_url == null) {
return video;
} else if(playlist_url === video.playlist_url) {
return video;
}
return video;
}
}
return null;
Expand Down

0 comments on commit 7eb8c48

Please sign in to comment.