Fix audio bitrate reading, added PCM identification on old mediainfo
This commit is contained in:
parent
65ee451a24
commit
abe9e5d90f
|
@ -1,7 +1,7 @@
|
|||
// ==UserScript==
|
||||
// @name AnimeBytes Mediainfo Improvements
|
||||
// @author WeebDataHoarder
|
||||
// @version 1.22.0
|
||||
// @version 1.22.1
|
||||
// @downloadURL https://git.gammaspectra.live/WeebDataHoarder/userscripts/raw/branch/master/AnimeBytes/ab-mediainfo.user.js
|
||||
// @updateURL https://git.gammaspectra.live/WeebDataHoarder/userscripts/raw/branch/master/AnimeBytes/ab-mediainfo.user.js
|
||||
// @description AnimeBytes Mediainfo Improvements. Adds several listing and matching releases against mediainfo utilities. MIT license
|
||||
|
@ -17,7 +17,7 @@
|
|||
// @require deps/compat.js?1
|
||||
// @require deps/resources.js?1
|
||||
// @require deps/settings.js?1
|
||||
// @require deps/mediainfo.js?5
|
||||
// @require deps/mediainfo.js?6
|
||||
// @require deps/ab-class.js?1
|
||||
// @run-at document-end
|
||||
// ==/UserScript==
|
||||
|
@ -696,12 +696,12 @@ function extractFromMediainfo(tags, mediainfo, warnings, fileName, fileList, sou
|
|||
|
||||
if(tags.audioCodec.lossless){
|
||||
if("bit_depth" in audio){
|
||||
let bitDepth = parseInt(audio.bit_depth.replace(/[^0-9]/g, ""));
|
||||
let bitDepth = parseInt(audio.bit_depth.split("/")[0].replace(/[^0-9]/g, ""));
|
||||
tags.audioBitrate = bitDepth + "-bit";
|
||||
}
|
||||
}else{
|
||||
if("bit_rate" in audio){
|
||||
let bitRate = parseInt(audio.bit_rate.replace(/[^0-9]/g, ""));
|
||||
let bitRate = parseInt(audio.bit_rate.split("/")[0].replace(/[^0-9]/g, ""));
|
||||
tags.audioBitrate = bitRate + "k";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -210,6 +210,16 @@ class Mediainfo {
|
|||
open: true
|
||||
},
|
||||
|
||||
{
|
||||
name: "PCM",
|
||||
match: {
|
||||
format: /^PCM$/i
|
||||
},
|
||||
legacy: "PCM",
|
||||
lossless: true,
|
||||
open: true
|
||||
},
|
||||
|
||||
{
|
||||
name: "PCM",
|
||||
match: {
|
||||
|
|
Loading…
Reference in a new issue