1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-11-02 08:25:02 -04:00

Added {channels} binding for values like 5.1

This commit is contained in:
Reinhard Pointner 2016-01-26 18:41:47 +00:00
parent 57de63d6ec
commit ca757a7f3f
2 changed files with 10 additions and 1 deletions

View File

@ -15,6 +15,7 @@ import static net.filebot.web.EpisodeFormat.*;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
@ -354,6 +355,14 @@ public class MediaBindingBean {
return SPACE.splitAsStream(channels).findFirst().get() + "ch";
}
@Define("channels")
public String getAudioChannelPositions() {
String[] channels = getMediaInfo(StreamKind.Audio, 0, "ChannelPositions/String2").split("/");
// e.g. 5.1
return stream(channels).map(BigDecimal::new).reduce(BigDecimal.ZERO, BigDecimal::add).toPlainString();
}
@Define("resolution")
public String getVideoResolution() {
List<Integer> dim = getDimension();

View File

@ -2,4 +2,4 @@
parameter.exclude: ^StreamKind|Count$
# preview expressions (keys are tagged so they can be sorted alphabetically)
expressions: n,y,s,e,es,sxe,s00e00,t,d,startdate,absolute,special,episode,series,primaryTitle,alias,movie,tmdbid,imdbid,az,music,artist,albumArtist,album,pi,pn,lang,actors,director,collection,genre,genres,certification,rating,vc,ac,cf,vf,hpi,af,resolution,dim,ws,sdhd,source,tags,s3d,group,original,fn,ext,mediaType,file,file.name,folder,folder.name,gigabytes,crc32,info,info.runtime,info.status,omdb.rating,omdb.votes,localize.German.title,age,duration,seconds,minutes,media,media.title,media.overallBitRateString,video,video.codecID,video.frameRate,video.displayAspectRatioString,video.scanType,audio,audio.bitRateString,audio.language,audios,audios.language,text,text.codecInfo,text.language,texts,texts.language
expressions: n,y,s,e,es,sxe,s00e00,t,d,startdate,absolute,special,episode,series,primaryTitle,alias,movie,tmdbid,imdbid,az,music,artist,albumArtist,album,pi,pn,lang,actors,director,collection,genre,genres,certification,rating,vc,ac,cf,vf,hpi,af,channels,resolution,dim,ws,sdhd,source,tags,s3d,group,original,fn,ext,mediaType,file,file.name,folder,folder.name,gigabytes,crc32,info,info.runtime,info.status,omdb.rating,omdb.votes,localize.German.title,age,duration,seconds,minutes,media,media.title,media.overallBitRateString,video,video.codecID,video.frameRate,video.displayAspectRatioString,video.scanType,audio,audio.bitRateString,audio.language,audios,audios.language,text,text.codecInfo,text.language,texts,texts.language