mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-03 12:01:28 +03:00
Download manager is now functional
Added UI support for new downloads schema Implemented draft test for downloads Cleaned up unused code snippets
This commit is contained in:
@@ -40,7 +40,7 @@ const subscriptions_api = require('../subscriptions');
|
||||
const fs = require('fs-extra');
|
||||
const { uuid } = require('uuidv4');
|
||||
|
||||
db_api.initialize(db, users_db, logger);
|
||||
db_api.initialize(db, users_db);
|
||||
|
||||
|
||||
describe('Database', async function() {
|
||||
@@ -286,40 +286,43 @@ describe('Multi User', async function() {
|
||||
// assert(video_obj);
|
||||
// });
|
||||
// });
|
||||
|
||||
});
|
||||
|
||||
describe('Downloader', function() {
|
||||
const url = '';
|
||||
const options = {
|
||||
ui_uid: uuid(),
|
||||
user: 'admin'
|
||||
}
|
||||
describe('Downloader', function() {
|
||||
const downloader_api = require('../downloader');
|
||||
downloader_api.initialize(db_api);
|
||||
const url = 'https://www.youtube.com/watch?v=dQw4w9WgXcQ';
|
||||
const options = {
|
||||
ui_uid: uuid(),
|
||||
user: 'admin'
|
||||
}
|
||||
|
||||
const download = {
|
||||
url: url,
|
||||
options: options,
|
||||
type: 'video'
|
||||
}
|
||||
|
||||
beforeEach(async function() {
|
||||
await db_api.connectToDB();
|
||||
await db_api.removeAllRecords('download_queue');
|
||||
await db_api.insertRecordIntoTable('download_queue', download)
|
||||
});
|
||||
|
||||
it('Get file info', async function() {
|
||||
|
||||
});
|
||||
|
||||
it('Download file', async function() {
|
||||
|
||||
});
|
||||
|
||||
it('Queue file', async function() {
|
||||
|
||||
});
|
||||
|
||||
it('Pause file', async function() {
|
||||
|
||||
});
|
||||
beforeEach(async function() {
|
||||
await db_api.connectToDB();
|
||||
await db_api.removeAllRecords('download_queue');
|
||||
});
|
||||
});
|
||||
|
||||
it('Get file info', async function() {
|
||||
|
||||
});
|
||||
|
||||
it('Download file', async function() {
|
||||
this.timeout(300000);
|
||||
const returned_download = await downloader_api.createDownload(url, 'video', options);
|
||||
console.log(returned_download);
|
||||
await utils.wait(20000);
|
||||
|
||||
});
|
||||
|
||||
it('Queue file', async function() {
|
||||
this.timeout(300000);
|
||||
const returned_download = await downloader_api.createDownload(url, 'video', options);
|
||||
console.log(returned_download);
|
||||
await utils.wait(20000);
|
||||
});
|
||||
|
||||
it('Pause file', async function() {
|
||||
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user