* improved series detection for certain cases

This commit is contained in:
Reinhard Pointner 2012-07-04 10:20:52 +00:00
parent 5145d906dd
commit 811f945daf
4 changed files with 32 additions and 18 deletions

View File

@ -214,14 +214,20 @@ public class MediaDetection {
} }
// check foldernames first // check foldernames first
List<String> matches = matchSeriesByName(folders); List<String> matches = matchSeriesByName(folders, 0);
// check all filenames if necessary // check all filenames if necessary
if (matches.isEmpty()) { if (matches.isEmpty()) {
matches = matchSeriesByName(filenames); matches = matchSeriesByName(filenames, 0);
} }
// use lenient sub sequence matching only as fallback
if (matches.size() > 0) {
names.addAll(matches); names.addAll(matches);
} else {
names.addAll(matchSeriesByName(folders, 3));
names.addAll(matchSeriesByName(filenames, 3));
}
} catch (Exception e) { } catch (Exception e) {
Logger.getLogger(MediaDetection.class.getClass().getName()).log(Level.WARNING, "Failed to match folder structure: " + e.getMessage(), e); Logger.getLogger(MediaDetection.class.getClass().getName()).log(Level.WARNING, "Failed to match folder structure: " + e.getMessage(), e);
} }
@ -244,8 +250,8 @@ public class MediaDetection {
} }
public static List<String> matchSeriesByName(Collection<String> names) throws Exception { public static List<String> matchSeriesByName(Collection<String> names, int maxStartIndex) throws Exception {
HighPerformanceMatcher nameMatcher = new HighPerformanceMatcher(0); HighPerformanceMatcher nameMatcher = new HighPerformanceMatcher(maxStartIndex);
List<String> matches = new ArrayList<String>(); List<String> matches = new ArrayList<String>();
String[] seriesIndex = releaseInfo.getSeriesList(); String[] seriesIndex = releaseInfo.getSeriesList();
@ -602,8 +608,8 @@ public class MediaDetection {
private static final Map<String, CollationKey[]> transformCache = synchronizedMap(new WeakHashMap<String, CollationKey[]>(65536)); private static final Map<String, CollationKey[]> transformCache = synchronizedMap(new WeakHashMap<String, CollationKey[]>(65536));
public HighPerformanceMatcher(int commonWordSequenceMaxStartIndex) { public HighPerformanceMatcher(int maxStartIndex) {
super(collator, commonWordSequenceMaxStartIndex); super(collator, maxStartIndex);
} }

View File

@ -146,7 +146,10 @@ public class ReleaseInfo {
for (Pattern it : stopwords) { for (Pattern it : stopwords) {
Matcher matcher = it.matcher(item); Matcher matcher = it.matcher(item);
if (matcher.find()) { if (matcher.find()) {
item = item.substring(0, matcher.start()); // use substring before the matched stopword String substring = item.substring(0, matcher.start()); // use substring before the matched stopword
if (normalizePunctuation(substring).length() >= 3) {
item = substring; // make sure that the substring has enough data
}
} }
} }
return item; return item;

View File

@ -14,6 +14,7 @@
[1-9].?of.?[1-9] [1-9].?of.?[1-9]
^(TV.)?(Show|Serie)[s]? ^(TV.)?(Show|Serie)[s]?
^[0-9]{1,2}[.] ^[0-9]{1,2}[.]
^[lp][^\p{Alnum}]
^AUDIO_TS$ ^AUDIO_TS$
^BDMV$ ^BDMV$
^Cover ^Cover
@ -21,7 +22,6 @@
^Film[s]? ^Film[s]?
^HVDVD_TS$ ^HVDVD_TS$
^Info ^Info
^l[^\p{Alnum}]
^Movie[s]? ^Movie[s]?
^New$ ^New$
^Other$ ^Other$
@ -34,6 +34,7 @@
^VIDEO_TS$ ^VIDEO_TS$
A.Release.Lounge A.Release.Lounge
Anime[s]? Anime[s]?
BBC
By.Cool.Release By.Cool.Release
CD[0]?[1-3] CD[0]?[1-3]
CN CN
@ -121,6 +122,7 @@ unrated
unrated.edition unrated.edition
UsaBit.com UsaBit.com
Video[s]? Video[s]?
www.speed.cd
www.torentz.3xforum.ro www.torentz.3xforum.ro
www.Torrenting.com www.Torrenting.com
www[.] www[.]

View File

@ -89,16 +89,16 @@ BTSD
BTT BTT
BugZ BugZ
BULLDOZER BULLDOZER
Bunny BUNNY
BWB BWB
C4TV C4TV
CAMELOT CAMELOT
CBGB CBGB
CDD CDD
CDDHD CDDHD
Chakra CHAKRA
chaostheory chaostheory
Chara CHARA
charliebartlett charliebartlett
CHD CHD
CHDBits CHDBits
@ -114,6 +114,7 @@ CiNEFiLE
CiNEFOX CiNEFOX
CLASSiC CLASSiC
CLDD CLDD
CLUE
cntc cntc
COALiTiON COALiTiON
Cocksure Cocksure
@ -139,7 +140,6 @@ danger2u
danirl danirl
DARM DARM
DASH DASH
DATA
DAW DAW
DCA DCA
DDC DDC
@ -178,7 +178,7 @@ DNR
DON DON
DoNE DoNE
DOT DOT
doubt DOUBT
DOWN DOWN
DRHD DRHD
DUPLI DUPLI
@ -235,7 +235,7 @@ FilmHD
FiNaLe FiNaLe
fjall fjall
FLAiTE FLAiTE
Flaket FLAKET
fLAMEhd fLAMEhd
FLAWL3SS FLAWL3SS
Flomp-Rumbel Flomp-Rumbel
@ -251,7 +251,7 @@ FQM
FRAGMENT FRAGMENT
FraMeSToR FraMeSToR
FRIGGHD FRIGGHD
Frost FROST
FSiHD FSiHD
Ft4U Ft4U
FTVDT FTVDT
@ -259,7 +259,7 @@ FTW-FM
FTW-HD FTW-HD
fty fty
FUCT FUCT
Funner FUNNER
FXG FXG
FxM FxM
G3N3 G3N3
@ -268,7 +268,6 @@ Gazdi
GB GB
GECKOS GECKOS
GEHENNA GEHENNA
george.c
GFW GFW
GFY GFY
GiNJi GiNJi
@ -557,7 +556,9 @@ RTA
RUBY RUBY
RuDE RuDE
RUDOS RUDOS
RUNNER
RUSTLE RUSTLE
RWD
Ryugan Ryugan
S26 S26
SAiMORNY SAiMORNY
@ -660,6 +661,7 @@ TRUEFRENCH
tRuEHD tRuEHD
TsH TsH
tsn tsn
TURKiSO
TUSAHD TUSAHD
TVA TVA
TW TW
@ -700,6 +702,7 @@ w4f
WAF WAF
WANKAZ WANKAZ
WASTE WASTE
WAT
WAVEY WAVEY
WHATELSE WHATELSE
WHiiZz WHiiZz