1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-12-24 00:38:52 -05:00

* 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 {
List<String> names = new ArrayList<String>();
for (SubtitleSearchResult it : MediaDetection.releaseInfo.getOpenSubtitlesIndex()) {
if (it.isMovie()) {
names.add(it.getNameWithYear());
} else if (it.isSeries()) {
names.add(it.getName());
}
names.addAll(it.getEffectiveNames());
}
return names;
};

View File

@ -1,5 +1,6 @@
package net.filebot.web;
import java.util.List;
import java.util.Locale;
public class SubtitleSearchResult extends Movie {
@ -49,4 +50,24 @@ public class SubtitleSearchResult extends Movie {
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
}
}
}