mirror of
https://github.com/mitb-archive/filebot
synced 2024-11-10 11:25:04 -05:00
* added {s3d} binding for matching filename flags like 3D.SBS
This commit is contained in:
parent
02e2b9f4d1
commit
24a1e49e33
@ -486,6 +486,12 @@ public class MediaBindingBean {
|
|||||||
tags.add(lowerTrail(upperInitial(normalizePunctuation(normalizeSpace(m, " ")))));
|
tags.add(lowerTrail(upperInitial(normalizePunctuation(normalizeSpace(m, " ")))));
|
||||||
}
|
}
|
||||||
return new ArrayList<String>(tags);
|
return new ArrayList<String>(tags);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Define("s3d")
|
||||||
|
public String getStereoscopic3D() {
|
||||||
|
return releaseInfo.getStereoscopic3D(getFileName());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Define("group")
|
@Define("group")
|
||||||
|
@ -49,13 +49,13 @@ public class ReleaseInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<String> getVideoTags(String... input) {
|
public List<String> getVideoTags(String... input) {
|
||||||
Pattern videoTagPattern = getVideoTagPattern();
|
Pattern pattern = getVideoTagPattern();
|
||||||
List<String> tags = new ArrayList<String>();
|
List<String> tags = new ArrayList<String>();
|
||||||
for (String s : input) {
|
for (String s : input) {
|
||||||
if (s == null)
|
if (s == null)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
Matcher m = videoTagPattern.matcher(s);
|
Matcher m = pattern.matcher(s);
|
||||||
while (m.find()) {
|
while (m.find()) {
|
||||||
tags.add(m.group());
|
tags.add(m.group());
|
||||||
}
|
}
|
||||||
@ -63,6 +63,17 @@ public class ReleaseInfo {
|
|||||||
return tags;
|
return tags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getStereoscopic3D(String... input) {
|
||||||
|
Pattern pattern = getStereoscopic3DPattern();
|
||||||
|
for (String s : input) {
|
||||||
|
Matcher m = pattern.matcher(s);
|
||||||
|
if (m.find()) {
|
||||||
|
return m.group();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
public String getReleaseGroup(String... strings) throws IOException {
|
public String getReleaseGroup(String... strings) throws IOException {
|
||||||
// check file and folder for release group names
|
// check file and folder for release group names
|
||||||
String[] groups = releaseGroupResource.get();
|
String[] groups = releaseGroupResource.get();
|
||||||
@ -267,6 +278,12 @@ public class ReleaseInfo {
|
|||||||
return compile("(?<!\\p{Alnum})(" + pattern + ")(?!\\p{Alnum})", CASE_INSENSITIVE);
|
return compile("(?<!\\p{Alnum})(" + pattern + ")(?!\\p{Alnum})", CASE_INSENSITIVE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Pattern getStereoscopic3DPattern() {
|
||||||
|
// pattern matching any 3D flags like 3D.HSBS
|
||||||
|
String pattern = getProperty("pattern.video.s3d");
|
||||||
|
return compile("(?<!\\p{Alnum})(" + pattern + ")(?!\\p{Alnum})", CASE_INSENSITIVE);
|
||||||
|
}
|
||||||
|
|
||||||
public Pattern getClutterBracketPattern(boolean strict) {
|
public Pattern getClutterBracketPattern(boolean strict) {
|
||||||
// match patterns like [Action, Drama] or {ENG-XViD-MP3-DVDRiP} etc
|
// match patterns like [Action, Drama] or {ENG-XViD-MP3-DVDRiP} etc
|
||||||
String contentFilter = strict ? "[\\p{Space}\\p{Punct}&&[^\\[\\]]]" : "\\p{Alpha}";
|
String contentFilter = strict ? "[\\p{Space}\\p{Punct}&&[^\\[\\]]]" : "\\p{Alpha}";
|
||||||
|
@ -4,6 +4,9 @@ pattern.video.source: CAMRip|CAM|PDVD|TS|TELESYNC|PDVD|PTVD|PPV|PPVRip|Screener|
|
|||||||
# patterns for all video tags
|
# patterns for all video tags
|
||||||
pattern.video.tags: extended|uncensored|remastered|unrated|uncut|director.?s.cut|theatrical.cut|ultimate.cut|final.cut|special.edition
|
pattern.video.tags: extended|uncensored|remastered|unrated|uncut|director.?s.cut|theatrical.cut|ultimate.cut|final.cut|special.edition
|
||||||
|
|
||||||
|
# patterns for stereoscopic 3D tags
|
||||||
|
pattern.video.s3d: 3D[^\\p{Alnum}]?(H|HALF|F|FULL)?[^\\p{Alnum}]?(SBS|TAB|OU)
|
||||||
|
|
||||||
# patterns for all subtitle tags
|
# patterns for all subtitle tags
|
||||||
pattern.subtitle.tags: forced|HI|SDH|Director.?s.Commentary
|
pattern.subtitle.tags: forced|HI|SDH|Director.?s.Commentary
|
||||||
|
|
||||||
|
@ -2,4 +2,4 @@
|
|||||||
parameter.exclude: ^StreamKind|Count$
|
parameter.exclude: ^StreamKind|Count$
|
||||||
|
|
||||||
# preview expressions (keys are tagged so they can be sorted alphabetically)
|
# 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,tags,group,original,fn,ext,mediaType,file,file.name,folder,folder.name,crc32,info,info.runtime,info.status,omdb.rating,omdb.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
|
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,tags,s3d,group,original,fn,ext,mediaType,file,file.name,folder,folder.name,crc32,info,info.runtime,info.status,omdb.rating,omdb.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