mirror of
https://github.com/mitb-archive/filebot
synced 2024-12-23 16:28:51 -05:00
* new binding {age} meaning "days since airdate"
This commit is contained in:
parent
5a287ab4c4
commit
ffcf61472d
@ -23,6 +23,7 @@ import java.util.Scanner;
|
||||
import java.util.Set;
|
||||
import java.util.SortedSet;
|
||||
import java.util.TreeSet;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@ -146,12 +147,12 @@ public class MediaBindingBean {
|
||||
}
|
||||
|
||||
@Define("d")
|
||||
public Object getReleaseDate() {
|
||||
public SimpleDate getReleaseDate() {
|
||||
if (infoObject instanceof Episode) {
|
||||
return getEpisode().getAirdate();
|
||||
}
|
||||
if (infoObject instanceof Movie) {
|
||||
return getMetaInfo().getProperty("released");
|
||||
return (SimpleDate) getMetaInfo().getProperty("released");
|
||||
}
|
||||
if (infoObject instanceof AudioTrack) {
|
||||
return getMusic().getAlbumReleaseDate();
|
||||
@ -166,6 +167,11 @@ public class MediaBindingBean {
|
||||
return getEpisode().getAirdate();
|
||||
}
|
||||
|
||||
@Define("age")
|
||||
public Number getAgeInDays() {
|
||||
return TimeUnit.MILLISECONDS.toDays(getNow() - getReleaseDate().getTimeStamp());
|
||||
}
|
||||
|
||||
@Define("startdate")
|
||||
public SimpleDate startdate() {
|
||||
return getEpisode().getSeriesStartDate();
|
||||
|
@ -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,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,group,original,fn,ext,mediaType,file,file.name,folder,folder.name,crc32,info,info.runtime,info.status,imdb,imdb.rating,imdb.votes,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,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,group,original,fn,ext,mediaType,file,file.name,folder,folder.name,crc32,info,info.runtime,info.status,imdb,imdb.rating,imdb.votes,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
|
Loading…
Reference in New Issue
Block a user