mirror of
https://github.com/Tzahi12345/YoutubeDL-Material.git
synced 2026-04-23 01:43:18 +03:00
Added test for ID3 tagging
This commit is contained in:
@@ -39,6 +39,7 @@ const utils = require('../utils');
|
|||||||
const subscriptions_api = require('../subscriptions');
|
const subscriptions_api = require('../subscriptions');
|
||||||
const fs = require('fs-extra');
|
const fs = require('fs-extra');
|
||||||
const { uuid } = require('uuidv4');
|
const { uuid } = require('uuidv4');
|
||||||
|
const NodeID3 = require('node-id3');
|
||||||
|
|
||||||
db_api.initialize(db, users_db);
|
db_api.initialize(db, users_db);
|
||||||
|
|
||||||
@@ -399,6 +400,19 @@ describe('Downloader', function() {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('Tag file', async function() {
|
||||||
|
const audio_path = './test/sample.mp3';
|
||||||
|
const sample_json = fs.readJSONSync('./test/sample.info.json');
|
||||||
|
const tags = {
|
||||||
|
title: sample_json['title'],
|
||||||
|
artist: sample_json['artist'] ? sample_json['artist'] : sample_json['uploader'],
|
||||||
|
TRCK: '27'
|
||||||
|
}
|
||||||
|
NodeID3.write(tags, audio_path);
|
||||||
|
const written_tags = NodeID3.read(audio_path);
|
||||||
|
assert(written_tags['raw']['TRCK'] === '27');
|
||||||
|
});
|
||||||
|
|
||||||
it('Queue file', async function() {
|
it('Queue file', async function() {
|
||||||
this.timeout(300000);
|
this.timeout(300000);
|
||||||
const returned_download = await downloader_api.createDownload(url, 'video', options);
|
const returned_download = await downloader_api.createDownload(url, 'video', options);
|
||||||
|
|||||||
Reference in New Issue
Block a user