@@ -109,11 +109,6 @@ const yargs = require("yargs/yargs")(process.argv.slice(2))
109109 default : true ,
110110 describe : "Use libfdk_aac encoder in ffmpeg command" ,
111111 } )
112- . option ( "withtags" , {
113- alias : "w" ,
114- type : "boolean" ,
115- describe : "Parse audio tags" ,
116- } )
117112 . option ( "suffix" , {
118113 type : "boolean" ,
119114 describe : "add bitrate suffix to filename" ,
@@ -127,7 +122,7 @@ const yargs = require("yargs/yargs")(process.argv.slice(2))
127122 alias : "q" ,
128123 type : "string" ,
129124 default : "0" ,
130- describe : "audio quality, bitrate, eg. 0(auto)/ 128/192/256/320" ,
125+ describe : "audio quality, bitrate, eg. 128/192/256/320" ,
131126 } )
132127 . option ( "jobs" , {
133128 alias : "j" ,
@@ -445,17 +440,15 @@ async function cmdConvert(argv) {
445440 return
446441 }
447442
448- if ( argv . withtags ) {
449- const taggedFiles = await parseTags ( files )
450- if ( taggedFiles . length == 0 || taggedFiles . length < fileCount ) {
451- log . warn (
452- "cmdConvert" ,
453- `${ fileCount - taggedFiles . length
454- } files have no cached tags finally`
455- )
456- } else {
457- files = taggedFiles
458- }
443+ const taggedFiles = await parseTags ( files )
444+ if ( taggedFiles . length < fileCount ) {
445+ log . warn (
446+ "cmdConvert" ,
447+ `${ fileCount - taggedFiles . length
448+ } files have no cached tags finally`
449+ )
450+ } else {
451+ files = taggedFiles
459452 }
460453
461454 files = await checkFiles ( files , argv )
@@ -526,10 +519,10 @@ function checkOneFile(file, argv) {
526519 let quality
527520 if ( QUALITY_LIST . includes ( argv . quality ) ) {
528521 quality = `${ argv . quality } k`
529- } else if ( ! file . lossless && file . bitrate <= 320 ) {
530- quality = file . bitrate > 256 ? "256k" : "192k"
531- } else {
522+ } else if ( file . lossless || file . bitrate > 320 || h . isLosslessAudio ( file . path ) ) {
532523 quality = "320k"
524+ } else {
525+ quality = file ?. bitrate > 256 ? "256k" : "192k"
533526 }
534527 file . quality = quality
535528 return quality
0 commit comments