* added {s3d} binding for matching filename flags like 3D.SBS

This commit is contained in:
Reinhard Pointner 2015-11-30 08:51:42 +00:00
parent 02e2b9f4d1
commit 24a1e49e33
4 changed files with 29 additions and 3 deletions

View File

@ -486,6 +486,12 @@ public class MediaBindingBean {
tags.add(lowerTrail(upperInitial(normalizePunctuation(normalizeSpace(m, " ")))));
}
return new ArrayList<String>(tags);
}
@Define("s3d")
public String getStereoscopic3D() {
return releaseInfo.getStereoscopic3D(getFileName());
}
@Define("group")

View File

@ -49,13 +49,13 @@ public class ReleaseInfo {
}
public List<String> getVideoTags(String... input) {
Pattern videoTagPattern = getVideoTagPattern();
Pattern pattern = getVideoTagPattern();
List<String> tags = new ArrayList<String>();
for (String s : input) {
if (s == null)
continue;
Matcher m = videoTagPattern.matcher(s);
Matcher m = pattern.matcher(s);
while (m.find()) {
tags.add(m.group());
}
@ -63,6 +63,17 @@ public class ReleaseInfo {
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 {
// check file and folder for release group names
String[] groups = releaseGroupResource.get();
@ -267,6 +278,12 @@ public class ReleaseInfo {
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) {
// match patterns like [Action, Drama] or {ENG-XViD-MP3-DVDRiP} etc
String contentFilter = strict ? "[\\p{Space}\\p{Punct}&&[^\\[\\]]]" : "\\p{Alpha}";

View File

@ -4,6 +4,9 @@ pattern.video.source: CAMRip|CAM|PDVD|TS|TELESYNC|PDVD|PTVD|PPV|PPVRip|Screener|
# patterns for all video tags
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
pattern.subtitle.tags: forced|HI|SDH|Director.?s.Commentary

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,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