* more restrictive 1x01 SxE pattern (episode part must be 2-digits)

* don't load args4j if we don't need to (little bit faster startup)
* fixed dnd of episode list (was disabled)
This commit is contained in:
Reinhard Pointner 2009-08-27 23:30:21 +00:00
parent cd1ea72c88
commit 64eb0ab911
6 changed files with 15 additions and 14 deletions

View File

@ -140,11 +140,13 @@ public class Main {
private static ArgumentBean initializeArgumentBean(String... args) { private static ArgumentBean initializeArgumentBean(String... args) {
ArgumentBean argumentBean = new ArgumentBean(); ArgumentBean argumentBean = new ArgumentBean();
try { if (args != null && args.length > 0) {
CmdLineParser parser = new CmdLineParser(argumentBean); try {
parser.parseArgument(args); CmdLineParser parser = new CmdLineParser(argumentBean);
} catch (Exception e) { parser.parseArgument(args);
Logger.getLogger(Main.class.getName()).log(Level.WARNING, e.getMessage(), e); } catch (Exception e) {
Logger.getLogger(Main.class.getName()).log(Level.WARNING, e.getMessage(), e);
}
} }
return argumentBean; return argumentBean;

View File

@ -24,7 +24,7 @@ public class SeasonEpisodeMatcher {
patterns[0] = new SeasonEpisodePattern("(?<!\\p{Alnum})[Ss](\\d{1,2})[^\\p{Alnum}]{0,3}[Ee](\\d{1,3})(?!\\p{Digit})"); patterns[0] = new SeasonEpisodePattern("(?<!\\p{Alnum})[Ss](\\d{1,2})[^\\p{Alnum}]{0,3}[Ee](\\d{1,3})(?!\\p{Digit})");
// match patterns like 1x01, 1.02, ..., 1x01a, 10x01, 10.02, ... // match patterns like 1x01, 1.02, ..., 1x01a, 10x01, 10.02, ...
patterns[1] = new SeasonEpisodePattern("(?<!\\p{Alnum})(\\d{1,2})[x.](\\d{1,3})(?!\\p{Digit})"); patterns[1] = new SeasonEpisodePattern("(?<!\\p{Alnum})(\\d{1,2})[x.](\\d{2,3})(?!\\p{Digit})");
// match patterns like 01, 102, 1003 (enclosed in separators) // match patterns like 01, 102, 1003 (enclosed in separators)
patterns[2] = new SeasonEpisodePattern("(?<=^|[._ ])([0-1]?\\d?)(\\d{2})(?=[._ ]|$)") { patterns[2] = new SeasonEpisodePattern("(?<=^|[._ ])([0-1]?\\d?)(\\d{2})(?=[._ ]|$)") {

View File

@ -290,9 +290,8 @@ public class EpisodeListPanel extends AbstractSearchPanel<EpisodeListProvider, E
public EpisodeListTab() { public EpisodeListTab() {
// initialize dnd and clipboard export handler for episode list // initialize dnd and clipboard export handler for episode list
EpisodeListExportHandler exportHandler = new EpisodeListExportHandler(this); setExportHandler(new EpisodeListExportHandler(this));
getTransferHandler().setExportHandler(exportHandler); getTransferHandler().setClipboardHandler(new EpisodeListExportHandler(this));
getTransferHandler().setClipboardHandler(exportHandler);
// allow removal of episode list entries // allow removal of episode list entries
getRemoveAction().setEnabled(true); getRemoveAction().setEnabled(true);

View File

@ -29,14 +29,14 @@ expr[d2]: media.durationString
expr[d3]: media.overallBitRateString expr[d3]: media.overallBitRateString
# media info expressions [video] # media info expressions [video]
expr[e1]: video.codec expr[e1]: video.codecID
expr[e2]: video.frameRate expr[e2]: video.frameRate
expr[e3]: video.displayAspectRatioString expr[e3]: video.displayAspectRatioString
expr[e4]: video.height expr[e4]: video.height
expr[e5]: video.interlacementString expr[e5]: video.scanType
# media info expressions [audio] # media info expressions [audio]
expr[f1]: audio.codec expr[f1]: audio.format
expr[f2]: audio.channels expr[f2]: audio.channels
expr[f3]: audio.bitRateString expr[f3]: audio.bitRateString
expr[f4]: audio.language expr[f4]: audio.language

View File

@ -137,7 +137,7 @@ public class TheTVDBClient implements EpisodeListProvider {
if (seasonNumber.equals("0")) { if (seasonNumber.equals("0")) {
String airsBefore = getTextContent("airsbefore_season", node); String airsBefore = getTextContent("airsbefore_season", node);
seasonNumber = airsBefore.isEmpty() ? null : airsBefore; seasonNumber = airsBefore == null || airsBefore.isEmpty() ? null : airsBefore;
episodeNumber = "Special"; episodeNumber = "Special";
} }

View File

@ -32,7 +32,7 @@ public class TheTVDBClientTest {
// test default language and query escaping (blanks) // test default language and query escaping (blanks)
List<SearchResult> results = thetvdb.search("babylon 5"); List<SearchResult> results = thetvdb.search("babylon 5");
assertEquals(2, results.size()); assertEquals(1, results.size());
TheTVDBSearchResult first = (TheTVDBSearchResult) results.get(0); TheTVDBSearchResult first = (TheTVDBSearchResult) results.get(0);