* allow more than 4 alias titles (e.g. in all languages) and see what happens
This commit is contained in:
parent
8659b40262
commit
3b3d4a40fd
|
@ -305,7 +305,7 @@ thetvdb_index = thetvdb_index.findResults{ [it[0] as Integer, it[1].replaceAll(/
|
|||
thetvdb_index = thetvdb_index.sort{ a, b -> a[0] <=> b[0] }
|
||||
|
||||
// join and sort
|
||||
def thetvdb_txt = thetvdb_index.groupBy{ it[0] }.findResults{ k, v -> ([k.pad(6)] + v*.getAt(1).unique{ it.toLowerCase() }).take(4).join('\t') }
|
||||
def thetvdb_txt = thetvdb_index.groupBy{ it[0] }.findResults{ k, v -> ([k.pad(6)] + v*.getAt(1).unique{ it.toLowerCase() }).join('\t') }
|
||||
|
||||
// sanity check
|
||||
if (thetvdb_txt.size() < 4000) { die('TheTVDB index sanity failed: ' + thetvdb_txt.size()) }
|
||||
|
|
|
@ -209,17 +209,18 @@ public enum EpisodeMetrics implements SimilarityMetric {
|
|||
protected Object[] fields(Object object) {
|
||||
if (object instanceof Episode) {
|
||||
Episode episode = (Episode) object;
|
||||
LinkedHashSet<String> set = new LinkedHashSet<String>(4);
|
||||
set.add(removeTrailingBrackets(episode.getSeriesName()));
|
||||
set.add(removeTrailingBrackets(episode.getTitle()));
|
||||
LinkedHashSet<String> keywords = new LinkedHashSet<String>(4);
|
||||
keywords.add(removeTrailingBrackets(episode.getSeriesName()));
|
||||
keywords.add(removeTrailingBrackets(episode.getTitle()));
|
||||
for (String it : episode.getSeries().getEffectiveNames()) {
|
||||
set.add(removeTrailingBrackets(it));
|
||||
keywords.add(removeTrailingBrackets(it));
|
||||
}
|
||||
|
||||
Iterator<String> itr = set.iterator();
|
||||
// create array with size 4
|
||||
Object[] f = new Object[4];
|
||||
Iterator<String> keywordItr = keywords.iterator();
|
||||
for (int i = 0; i < f.length; i++) {
|
||||
f[i] = itr.hasNext() ? itr.next() : null;
|
||||
f[i] = keywordItr.hasNext() ? keywordItr.next() : null;
|
||||
}
|
||||
return f;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue