@@ -109,11 +109,6 @@ const yargs = require("yargs/yargs")(process.argv.slice(2))
109
109
default : true ,
110
110
describe : "Use libfdk_aac encoder in ffmpeg command" ,
111
111
} )
112
- . option ( "withtags" , {
113
- alias : "w" ,
114
- type : "boolean" ,
115
- describe : "Parse audio tags" ,
116
- } )
117
112
. option ( "suffix" , {
118
113
type : "boolean" ,
119
114
describe : "add bitrate suffix to filename" ,
@@ -127,7 +122,7 @@ const yargs = require("yargs/yargs")(process.argv.slice(2))
127
122
alias : "q" ,
128
123
type : "string" ,
129
124
default : "0" ,
130
- describe : "audio quality, bitrate, eg. 0(auto)/ 128/192/256/320" ,
125
+ describe : "audio quality, bitrate, eg. 128/192/256/320" ,
131
126
} )
132
127
. option ( "jobs" , {
133
128
alias : "j" ,
@@ -445,17 +440,15 @@ async function cmdConvert(argv) {
445
440
return
446
441
}
447
442
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
459
452
}
460
453
461
454
files = await checkFiles ( files , argv )
@@ -526,10 +519,10 @@ function checkOneFile(file, argv) {
526
519
let quality
527
520
if ( QUALITY_LIST . includes ( argv . quality ) ) {
528
521
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 ) ) {
532
523
quality = "320k"
524
+ } else {
525
+ quality = file ?. bitrate > 256 ? "256k" : "192k"
533
526
}
534
527
file . quality = quality
535
528
return quality
0 commit comments