Added setting for displaying extra audio details
This commit is contained in:
parent
500d730cfa
commit
65ee451a24
|
@ -1,7 +1,7 @@
|
|||
// ==UserScript==
|
||||
// @name AnimeBytes Mediainfo Improvements
|
||||
// @author WeebDataHoarder
|
||||
// @version 1.21.8
|
||||
// @version 1.22.0
|
||||
// @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
|
||||
|
@ -94,6 +94,9 @@ function getEntryLine(tags, messages){
|
|||
codec.classList.add("entry_codec");
|
||||
codec.textContent = getLineTagEntry(tags.audioCodec, false);
|
||||
span.append(codec);
|
||||
if(settings.getSetting("showAudioDetails") && "audioBitrate" in tags){
|
||||
span.append(" " + tags.audioBitrate);
|
||||
}
|
||||
span.append(" " + Mediainfo.getAudioChannels(tags.audioChannels));
|
||||
entries.audio.push(span);
|
||||
}
|
||||
|
@ -672,7 +675,7 @@ function extractFromMediainfo(tags, mediainfo, warnings, fileName, fileList, sou
|
|||
warnings.audio.push(["warning", "BLOAT: Audio track #"+(index+1)+" is uncompressed PCM."]);
|
||||
}
|
||||
|
||||
if(!isRemuxOrRawSource && (audio.format === "FLAC" || audio.format.match(/^DTS/) !== null) && (ratio === null || (ratio > 10)) && settings.getSetting("warning_bloatg16bit")){
|
||||
if(!isRemuxOrRawSource && (audio.format === "FLAC" || audio.format.match(/^DTS/) !== null) && (ratio === null || (ratio > 10)) && settings.getSetting("warning_bloatg16bit") && "bit_depth" in audio){
|
||||
let bitDepth = parseInt(audio.bit_depth.replace(/[^0-9]/g, ""));
|
||||
if(bitDepth > 16){
|
||||
warnings.audio.push(["warning", "BLOAT: Audio track #"+(index+1)+" is "+audio.__audioCodec.name+" with bit depth greater than 16-bit, found "+bitDepth+"-bit."]);
|
||||
|
@ -690,6 +693,18 @@ function extractFromMediainfo(tags, mediainfo, warnings, fileName, fileList, sou
|
|||
if(audio !== null){
|
||||
tags.audioChannels = audio.channels;
|
||||
tags.audioCodec = Mediainfo.matchCodec(Mediainfo.audioCodecs, audio, sourceTags.audioCodec ? sourceTags.audioCodec : audio.__audioCodec);
|
||||
|
||||
if(tags.audioCodec.lossless){
|
||||
if("bit_depth" in audio){
|
||||
let bitDepth = parseInt(audio.bit_depth.replace(/[^0-9]/g, ""));
|
||||
tags.audioBitrate = bitDepth + "-bit";
|
||||
}
|
||||
}else{
|
||||
if("bit_rate" in audio){
|
||||
let bitRate = parseInt(audio.bit_rate.replace(/[^0-9]/g, ""));
|
||||
tags.audioBitrate = bitRate + "k";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if("text" in mediainfo){
|
||||
|
@ -1356,6 +1371,7 @@ settings.addSetting("enhanceTags", "Enhance Tags", "Entries will have their tags
|
|||
settings.addSetting("openFormats", "Label Open Formats", "Entries that are composed fully of known Open Formats/Codecs will be labeled as such.", "bool", true);
|
||||
settings.addSetting("showContainerVersions", "Show Container Versions", "Display container versions. Currently implemented for Matroska / WebM", "bool", false);
|
||||
settings.addSetting("showEncodingDetails", "Show Encoding Details", "Display encoding details such as encoder, mode, CRF, and bitrate", "bool", true);
|
||||
settings.addSetting("showAudioDetails", "Show Audio Details", "Display extra audio details such as bit-depth, bitrate.", "bool", false);
|
||||
settings.addSetting("regexpFilter", "RegExp Filter", "Any entry that matches one of these RegExp (without delimiters) will be filtered out. Can enter a different one per line. Empty to disable", "text", "");
|
||||
settings.addSetting("extraStyles", "CSS Styles", "Extra CSS styles to add to Torrent pages. Empty to disable. One group entry per line.", "text", "");
|
||||
settings.addSetting("script_deliciousCompatMode", "Enable Delicious Compatibility", "Enable workarounds to make output compatible with AnimeBytes Delicious user scripts Bundle", "bool", true);
|
||||
|
@ -1575,7 +1591,7 @@ if(
|
|||
parentTd.style["max-width"] = "80%";
|
||||
|
||||
document.querySelectorAll("table.torrent_table tr.edition_info > td").forEach((e) => {
|
||||
e.setAttribute("colspan", (e.getAttribute("colspan") + torrentTableColspan).toString());
|
||||
e.setAttribute("colspan", (parseInt(e.getAttribute("colspan")) + torrentTableColspan).toString());
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -1584,7 +1600,7 @@ if(
|
|||
let td = document.createElement("td");
|
||||
|
||||
let element = torrent.elements.data.querySelector("td");
|
||||
element.setAttribute("colspan", (element.getAttribute("colspan") + torrentTableColspan).toString());
|
||||
element.setAttribute("colspan", (parseInt(element.getAttribute("colspan")) + torrentTableColspan).toString());
|
||||
|
||||
parent.closest("td").insertAdjacentElement("beforebegin", td);
|
||||
parent.style["white-space"] = "nowrap";
|
||||
|
|
Loading…
Reference in a new issue