* don't clean up part identifier from title for single episodes

* remember manual input
This commit is contained in:
Reinhard Pointner 2012-04-10 01:19:34 +00:00
parent ec796fc478
commit 7ba5bb52d9
2 changed files with 16 additions and 4 deletions

View File

@ -105,6 +105,12 @@ public class MediaBindingBean {
@Define("t") @Define("t")
public String getTitle() { public String getTitle() {
// single episode format
if (getEpisodes().size() == 1) {
return getEpisode().getTitle();
}
// multi-episode format
Set<String> title = new LinkedHashSet<String>(); Set<String> title = new LinkedHashSet<String>();
for (Episode it : getEpisodes()) { for (Episode it : getEpisodes()) {
title.add(removeTrailingBrackets(it.getTitle())); title.add(removeTrailingBrackets(it.getTitle()));

View File

@ -185,6 +185,7 @@ class EpisodeListMatcher implements AutoCompleteMatcher {
// remember user decisions and only bother user once // remember user decisions and only bother user once
final Map<String, SearchResult> selectionMemory = new TreeMap<String, SearchResult>(CommonSequenceMatcher.getLenientCollator(Locale.ROOT)); final Map<String, SearchResult> selectionMemory = new TreeMap<String, SearchResult>(CommonSequenceMatcher.getLenientCollator(Locale.ROOT));
final Map<String, List<String>> inputMemory = new TreeMap<String, List<String>>(CommonSequenceMatcher.getLenientCollator(Locale.ROOT));
// detect series names and create episode list fetch tasks // detect series names and create episode list fetch tasks
for (Entry<Set<File>, Set<String>> sameSeriesGroup : mapSeriesNamesByFiles(mediaFiles, locale).entrySet()) { for (Entry<Set<File>, Set<String>> sameSeriesGroup : mapSeriesNamesByFiles(mediaFiles, locale).entrySet()) {
@ -204,7 +205,7 @@ class EpisodeListMatcher implements AutoCompleteMatcher {
@Override @Override
public List<Match<File, ?>> call() throws Exception { public List<Match<File, ?>> call() throws Exception {
return matchEpisodeSet(batchSet, queries, sortOrder, locale, autodetection, selectionMemory, parent); return matchEpisodeSet(batchSet, queries, sortOrder, locale, autodetection, selectionMemory, inputMemory, parent);
} }
}); });
} }
@ -255,7 +256,8 @@ class EpisodeListMatcher implements AutoCompleteMatcher {
} }
public List<Match<File, ?>> matchEpisodeSet(final List<File> files, Collection<String> queries, SortOrder sortOrder, Locale locale, boolean autodetection, Map<String, SearchResult> selectionMemory, Component parent) throws Exception { public List<Match<File, ?>> matchEpisodeSet(final List<File> files, Collection<String> queries, SortOrder sortOrder, Locale locale, boolean autodetection, Map<String, SearchResult> selectionMemory,
Map<String, List<String>> inputMemory, Component parent) throws Exception {
Set<Episode> episodes = emptySet(); Set<Episode> episodes = emptySet();
// detect series name and fetch episode list // detect series name and fetch episode list
@ -280,8 +282,12 @@ class EpisodeListMatcher implements AutoCompleteMatcher {
} }
List<String> input = emptyList(); List<String> input = emptyList();
synchronized (this) { synchronized (inputMemory) {
input = showMultiValueInputDialog("Enter series name:", suggestion, files.get(0).getParentFile().getName(), parent); input = inputMemory.get(suggestion);
if (input == null || suggestion == null || suggestion.isEmpty()) {
input = showMultiValueInputDialog("Enter series name:", suggestion, files.get(0).getParentFile().getName(), parent);
inputMemory.put(suggestion, input);
}
} }
if (input.size() > 0) { if (input.size() > 0) {