* OpenSubtitle Movie results are always displayed in Name (Year) format while TV Series results are displayed in plain Name format

This commit is contained in:
Reinhard Pointner 2015-05-16 16:48:39 +00:00
parent b271afbad2
commit ebac5709ee
2 changed files with 22 additions and 5 deletions

View File

@ -152,11 +152,7 @@ public class SubtitlePanel extends AbstractSearchPanel<SubtitleProvider, Subtitl
protected Collection<String> getHistory(SubtitleProvider engine) throws Exception { protected Collection<String> getHistory(SubtitleProvider engine) throws Exception {
List<String> names = new ArrayList<String>(); List<String> names = new ArrayList<String>();
for (SubtitleSearchResult it : MediaDetection.releaseInfo.getOpenSubtitlesIndex()) { for (SubtitleSearchResult it : MediaDetection.releaseInfo.getOpenSubtitlesIndex()) {
if (it.isMovie()) { names.addAll(it.getEffectiveNames());
names.add(it.getNameWithYear());
} else if (it.isSeries()) {
names.add(it.getName());
}
} }
return names; return names;
}; };

View File

@ -1,5 +1,6 @@
package net.filebot.web; package net.filebot.web;
import java.util.List;
import java.util.Locale; import java.util.Locale;
public class SubtitleSearchResult extends Movie { public class SubtitleSearchResult extends Movie {
@ -49,4 +50,24 @@ public class SubtitleSearchResult extends Movie {
return kind == Kind.Series; return kind == Kind.Series;
} }
@Override
public List<String> getEffectiveNames() {
switch (kind) {
case Series:
return super.getEffectiveNamesWithoutYear();
default:
return super.getEffectiveNames(); // with year
}
}
@Override
public String toString() {
switch (kind) {
case Series:
return super.getName(); // without year
default:
return super.toString(); // with year
}
}
} }