added a tiny testing script for file name presets

This commit is contained in:
wukko 2023-10-15 00:03:55 +06:00
parent 0520a85572
commit 1d3eb2fdae
2 changed files with 72 additions and 1 deletions

View file

@ -12,7 +12,8 @@
"start": "node src/cobalt", "start": "node src/cobalt",
"setup": "node src/modules/setup", "setup": "node src/modules/setup",
"test": "node src/test/test", "test": "node src/test/test",
"build": "node src/modules/buildStatic" "build": "node src/modules/buildStatic",
"testFilenames": "node src/test/testFilenamePresets"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

View file

@ -0,0 +1,70 @@
import createFilename from "../modules/processing/createFilename.js";
let tests = [
{
f: {
service: 'youtube',
id: 'MMK3L4W70g4',
title: "Loossemble (루셈블) - 'Sensitive' MV",
author: 'Loossemble',
youtubeDubName: false,
qualityLabel: '2160p',
resolution: '3840x2160',
extension: 'webm',
youtubeFormat: 'vp9'
},
isAudioOnly: false,
isAudioMuted: false
},
{
f: {
service: 'youtube',
id: 'MMK3L4W70g4',
title: "Loossemble (루셈블) - 'Sensitive' MV",
author: 'Loossemble',
youtubeDubName: false,
qualityLabel: '2160p',
resolution: '3840x2160',
extension: 'webm',
youtubeFormat: 'vp9'
},
isAudioOnly: true,
isAudioMuted: false
},
{
f: {
service: 'youtube',
id: 'MMK3L4W70g4',
title: "Loossemble (루셈블) - 'Sensitive' MV",
author: 'Loossemble',
youtubeDubName: false,
qualityLabel: '2160p',
resolution: '3840x2160',
extension: 'webm',
youtubeFormat: 'vp9'
},
isAudioOnly: false,
isAudioMuted: true
},
{
f: {
service: 'vimeo',
id: 'MMK3L4W70g4',
title: "Loossemble (루셈블) - 'Sensitive' MV",
author: 'Loossemble',
qualityLabel: '2160p',
resolution: '3840x2160',
extension: 'mp4'
},
isAudioOnly: false,
isAudioMuted: true
}
]
for (let i = 0; i < tests.length; i++) {
console.log(`---${i}---`)
console.log(createFilename(tests[i].f, "classic", tests[i].isAudioOnly, tests[i].isAudioMuted))
console.log(createFilename(tests[i].f, "basic", tests[i].isAudioOnly, tests[i].isAudioMuted))
console.log(createFilename(tests[i].f, "pretty", tests[i].isAudioOnly, tests[i].isAudioMuted))
console.log(createFilename(tests[i].f, "nerdy", tests[i].isAudioOnly, tests[i].isAudioMuted))
}