Fixed issue where one-off playlist downlaods would only include the first video

pull/688/head
Isaac Abadi 3 years ago
parent c9359f172e
commit 768798c6b3

@ -198,7 +198,7 @@ async function registerFileDBManual(file_object) {
path_object = path.parse(file_object['path']);
file_object['path'] = path.format(path_object);
exports.insertRecordIntoTable('files', file_object, {path: file_object['path']})
await exports.insertRecordIntoTable('files', file_object, {path: file_object['path']})
return file_object;
}

@ -203,6 +203,7 @@ async function collectInfo(download_uid) {
options.customOutput = category['custom_output'];
options.noRelativePath = true;
args = await exports.generateArgs(url, type, options, download['user_uid']);
args = utils.filterArgs(args, ['--no-simulate']);
info = await exports.getVideoInfoByURL(url, args, download_uid);
}
@ -356,7 +357,7 @@ async function downloadQueuedFile(download_uid) {
if (file_objs.length > 1) {
// create playlist
const playlist_name = file_objs.map(file_obj => file_obj.title).join(', ');
container = await db_api.createPlaylist(playlist_name, file_objs.map(file_obj => file_obj.uid), type, download['user_uid']);
container = await db_api.createPlaylist(playlist_name, file_objs.map(file_obj => file_obj.uid), download['user_uid']);
} else if (file_objs.length === 1) {
container = file_objs[0];
} else {
@ -506,7 +507,10 @@ exports.generateArgs = async (url, type, options, user_uid = null, simulated = f
}
if (default_downloader === 'yt-dlp') {
downloadConfig.push('--no-clean-infojson');
downloadConfig = utils.filterArgs(downloadConfig, ['--print-json']);
// in yt-dlp -j --no-simulate is preferable
downloadConfig.push('--no-clean-info-json', '-j', '--no-simulate');
}
}

@ -407,7 +407,7 @@ async function generateArgsForSubscription(sub, user_uid, redownload = false, de
const default_downloader = utils.getCurrentDownloader() || config_api.getConfigItem('ytdl_default_downloader');
if (default_downloader === 'yt-dlp') {
downloadConfig.push('--no-clean-infojson');
downloadConfig.push('--no-clean-info-json');
}
downloadConfig = utils.filterArgs(downloadConfig, ['--write-comments']);

@ -306,7 +306,7 @@ export class MainComponent implements OnInit {
this.downloadingfile = false;
if (!this.autoplay && !this.downloadOnlyMode && !navigate_mode) {
// do nothing
this.reloadRecentVideos();
this.reloadRecentVideos(is_playlist);
} else {
// if download only mode, just download the file. no redirect
if (force_view === false && this.downloadOnlyMode && !this.iOS) {
@ -315,7 +315,7 @@ export class MainComponent implements OnInit {
} else {
this.downloadFileFromServer(container as DatabaseFile, type);
}
this.reloadRecentVideos();
this.reloadRecentVideos(is_playlist);
} else {
localStorage.setItem('player_navigator', this.router.url.split(';')[0]);
if (is_playlist) {
@ -780,8 +780,9 @@ export class MainComponent implements OnInit {
});
}
reloadRecentVideos(): void {
reloadRecentVideos(is_playlist = false): void {
this.postsService.files_changed.next(true);
if (is_playlist) this.postsService.playlists_changed.next(true);
}
getURLArray(url_str: string): Array<string> {

Loading…
Cancel
Save