+ REQUIRE min JRE 7 and update all libs

This commit is contained in:
Reinhard Pointner 2014-03-18 20:16:39 +00:00
parent 9feb10f844
commit cf8b3d835f
37 changed files with 64 additions and 53 deletions

View File

@ -68,7 +68,7 @@
<zipfileset src="${dir.dist}/filebot.jar" /> <zipfileset src="${dir.dist}/filebot.jar" />
<!-- include libs --> <!-- include libs -->
<zipfileset src="${dir.lib}/xercesImpl.jar"> <zipfileset src="${dir.lib}/xercesMinimal.jar">
<include name="org/apache/**" /> <include name="org/apache/**" />
<include name="org/w3c/dom/html/**" /> <include name="org/w3c/dom/html/**" />
</zipfileset> </zipfileset>
@ -97,7 +97,11 @@
<include name="ca/odell/glazedlists/**" /> <include name="ca/odell/glazedlists/**" />
</zipfileset> </zipfileset>
<zipfileset src="${dir.lib}/miglayout.jar"> <zipfileset src="${dir.lib}/miglayout-core.jar">
<include name="net/miginfocom/**" />
</zipfileset>
<zipfileset src="${dir.lib}/miglayout-swing.jar">
<include name="net/miginfocom/**" /> <include name="net/miginfocom/**" />
</zipfileset> </zipfileset>
@ -125,11 +129,11 @@
<include name="build-info.properties" /> <include name="build-info.properties" />
</zipfileset> </zipfileset>
<zipfileset src="${dir.lib}/slf4j.jar"> <zipfileset src="${dir.lib}/slf4j-api.jar">
<include name="org/slf4j/**" /> <include name="org/slf4j/**" />
</zipfileset> </zipfileset>
<zipfileset src="${dir.lib}/slf4j-jdk.jar"> <zipfileset src="${dir.lib}/slf4j-jdk14.jar">
<include name="org/slf4j/**" /> <include name="org/slf4j/**" />
</zipfileset> </zipfileset>
@ -142,7 +146,7 @@
<include name="com/sun/jna/**" /> <include name="com/sun/jna/**" />
</zipfileset> </zipfileset>
<zipfileset src="${dir.lib}/platform.jar"> <zipfileset src="${dir.lib}/jna-platform.jar">
<include name="com/sun/jna/platform/win32/**" /> <include name="com/sun/jna/platform/win32/**" />
</zipfileset> </zipfileset>
@ -217,7 +221,7 @@
<copy tofile="${dir.dist}/appbundle/FileBot.jar" file="${path.fatjar}" /> <copy tofile="${dir.dist}/appbundle/FileBot.jar" file="${path.fatjar}" />
<!-- build app bundle folder and add native libs --> <!-- build app bundle folder and add native libs -->
<jarbundler dir="${dir.dist}" name="${title}" version="${version}" build="${svn.revision}" icon="${dir.installer}/appbundle/icon.icns" bundleid="net.sourceforge.filebot" jar="${dir.dist}/appbundle/FileBot.jar" stubfile="${dir.installer}/appbundle/JavaApplicationStub" workingdirectory="$JAVAROOT" mainclass="net.sourceforge.filebot.Main" jvmversion="1.6+"> <jarbundler dir="${dir.dist}" name="${title}" version="${version}" build="${svn.revision}" icon="${dir.installer}/appbundle/icon.icns" bundleid="net.sourceforge.filebot" jar="${dir.dist}/appbundle/FileBot.jar" stubfile="${dir.installer}/appbundle/JavaApplicationStub" workingdirectory="$JAVAROOT" mainclass="net.sourceforge.filebot.Main" jvmversion="1.7+">
<javaproperty name="application.deployment" value="app" /> <javaproperty name="application.deployment" value="app" />
<javaproperty name="unixfs" value="false" /> <javaproperty name="unixfs" value="false" />
<javaproperty name="useExtendedFileAttributes" value="true" /> <javaproperty name="useExtendedFileAttributes" value="true" />
@ -460,7 +464,7 @@
<mkdir dir="${dir.build}" /> <mkdir dir="${dir.build}" />
<!-- compile --> <!-- compile -->
<javac srcdir="${dir.source}:${dir.test}" destdir="${dir.build}" target="1.6" source="1.6" encoding="utf-8" debug="true" debuglevel="lines,vars,source" includeAntRuntime="false"> <javac srcdir="${dir.source}:${dir.test}" destdir="${dir.build}" target="1.7" source="1.7" encoding="utf-8" debug="true" debuglevel="lines,vars,source" includeAntRuntime="false">
<classpath> <classpath>
<fileset dir="${dir.lib}" includes="*.jar" /> <fileset dir="${dir.lib}" includes="*.jar" />
<pathelement location="${dir.lib}/build/junit.jar" /> <pathelement location="${dir.lib}/build/junit.jar" />

View File

@ -43,12 +43,13 @@
<jar href="commons-io.jar" download="eager" /> <jar href="commons-io.jar" download="eager" />
<jar href="args4j.jar" download="eager" /> <jar href="args4j.jar" download="eager" />
<jar href="jna.jar" download="eager" /> <jar href="jna.jar" download="eager" />
<jar href="miglayout.jar" download="eager" /> <jar href="miglayout-core.jar" download="eager" />
<jar href="miglayout-swing.jar" download="eager" />
<jar href="glazedlists.jar" download="eager" /> <jar href="glazedlists.jar" download="eager" />
<jar href="ehcache.jar" download="eager" /> <jar href="ehcache.jar" download="eager" />
<jar href="simmetrics.jar" download="eager" /> <jar href="simmetrics.jar" download="eager" />
<jar href="slf4j.jar" download="eager" /> <jar href="slf4j-api.jar" download="eager" />
<jar href="slf4j-jdk.jar" download="eager" /> <jar href="slf4j-jdk14.jar" download="eager" />
<jar href="jgat-custom.jar" download="eager" /> <jar href="jgat-custom.jar" download="eager" />
<jar href="xmlrpc.jar" download="eager" /> <jar href="xmlrpc.jar" download="eager" />
<jar href="xz.jar" download="eager" /> <jar href="xz.jar" download="eager" />
@ -58,7 +59,7 @@
<jar href="jacksum.jar" download="lazy" /> <jar href="jacksum.jar" download="lazy" />
<jar href="jsoup.jar" download="lazy" /> <jar href="jsoup.jar" download="lazy" />
<jar href="nekohtml.jar" download="lazy" part="scraper" /> <jar href="nekohtml.jar" download="lazy" part="scraper" />
<jar href="xercesImpl.jar" download="lazy" part="scraper" /> <jar href="xercesMinimal.jar" download="lazy" part="scraper" />
<jar href="mediainfo.jar" download="lazy" part="native" /> <jar href="mediainfo.jar" download="lazy" part="native" />
<jar href="sevenzipjbinding.jar" download="lazy" part="native" /> <jar href="sevenzipjbinding.jar" download="lazy" part="native" />
<jar href="rsyntaxtextarea.jar" download="eager" /> <jar href="rsyntaxtextarea.jar" download="eager" />

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
lib/miglayout-swing.jar Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
lib/slf4j-api.jar Normal file

Binary file not shown.

Binary file not shown.

BIN
lib/slf4j-jdk14.jar Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
lib/xercesMinimal.jar Normal file

Binary file not shown.

Binary file not shown.

View File

@ -45,11 +45,19 @@ public class MetaAttributes {
} }
public void setObject(Object object) { public void setObject(Object object) {
metaAttributeView.put(METADATA_KEY, JsonWriter.toJson(object)); try {
metaAttributeView.put(METADATA_KEY, JsonWriter.objectToJson(object));
} catch (IOException e) {
throw new IllegalStateException(e);
}
} }
public Object getObject() { public Object getObject() {
return JsonReader.toJava(metaAttributeView.get(METADATA_KEY)); try {
return JsonReader.jsonToJava(metaAttributeView.get(METADATA_KEY));
} catch (IOException e) {
return null;
}
} }
public void clear() { public void clear() {

View File

@ -19,6 +19,7 @@ import java.awt.event.WindowEvent;
import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener; import java.beans.PropertyChangeListener;
import java.io.File; import java.io.File;
import java.io.IOException;
import java.net.URI; import java.net.URI;
import java.text.Format; import java.text.Format;
import java.util.Collections; import java.util.Collections;
@ -420,7 +421,7 @@ public class FormatDialog extends JDialog {
try { try {
// restore sample from user preferences // restore sample from user preferences
String sample = mode.persistentSample().getValue(); String sample = mode.persistentSample().getValue();
info = JsonReader.toJava(sample); info = JsonReader.jsonToJava(sample);
if (info == null) { if (info == null) {
throw new NullPointerException(); throw new NullPointerException();
} }
@ -429,7 +430,7 @@ public class FormatDialog extends JDialog {
// restore sample from application properties // restore sample from application properties
ResourceBundle bundle = ResourceBundle.getBundle(getClass().getName()); ResourceBundle bundle = ResourceBundle.getBundle(getClass().getName());
String sample = bundle.getString(mode.key() + ".sample"); String sample = bundle.getString(mode.key() + ".sample");
info = JsonReader.toJava(sample); info = JsonReader.jsonToJava(sample);
} catch (Exception illegalSample) { } catch (Exception illegalSample) {
throw new RuntimeException(illegalSample); // won't happen throw new RuntimeException(illegalSample); // won't happen
} }
@ -639,9 +640,13 @@ public class FormatDialog extends JDialog {
// change sample // change sample
sample = new MediaBindingBean(info, file, Collections.singletonMap(file, info)); sample = new MediaBindingBean(info, file, Collections.singletonMap(file, info));
// remember // remember sample
mode.persistentSample().setValue(info == null ? "" : JsonWriter.toJson(info)); try {
persistentSampleFile.setValue(file == null ? "" : sample.getMediaFile().getAbsolutePath()); mode.persistentSample().setValue(info == null ? "" : JsonWriter.objectToJson(info));
persistentSampleFile.setValue(file == null ? "" : sample.getMediaFile().getAbsolutePath());
} catch (IOException e) {
Logger.getLogger(FormatDialog.class.getName()).log(Level.WARNING, e.getMessage(), e);
}
// reevaluate everything // reevaluate everything
fireSampleChanged(); fireSampleChanged();

View File

@ -49,7 +49,7 @@ public class ExpressionFormatTest {
assertEquals("second", new TestScriptFormat("{value.after(/[^a-z]/)}").format("first|second")); assertEquals("second", new TestScriptFormat("{value.after(/[^a-z]/)}").format("first|second"));
// replace trailing braces // replace trailing braces
assertEquals("The IT Crowd", new TestScriptFormat("{value.replaceTrailingBraces()}").format("The IT Crowd (UK)")); assertEquals("The IT Crowd", new TestScriptFormat("{value.replaceTrailingBrackets()}").format("The IT Crowd (UK)"));
// replace part // replace part
assertEquals("Today Is the Day, Part 1", new TestScriptFormat("{value.replacePart(', Part $1')}").format("Today Is the Day (1)")); assertEquals("Today Is the Day, Part 1", new TestScriptFormat("{value.replacePart(', Part $1')}").format("Today Is the Day (1)"));
@ -101,7 +101,7 @@ public class ExpressionFormatTest {
format.format(new SimpleBindings()); format.format(new SimpleBindings());
// check message // check message
assertEquals("BindingError: \"xyz\": undefined", format.caughtScriptException().getMessage()); assertEquals("BindingException: \"xyz\": undefined", format.caughtScriptException().getMessage());
} }
@ -111,7 +111,7 @@ public class ExpressionFormatTest {
format.format("test"); format.format("test");
// check message // check message
assertEquals("BindingError: \"xyz\": undefined", format.caughtScriptException().getMessage()); assertEquals("BindingException: \"xyz\": undefined", format.caughtScriptException().getMessage());
} }

View File

@ -1,7 +1,5 @@
package net.sourceforge.filebot.similarity; package net.sourceforge.filebot.similarity;
import static net.sourceforge.filebot.similarity.EpisodeMetrics.*; import static net.sourceforge.filebot.similarity.EpisodeMetrics.*;
import static org.junit.Assert.*; import static org.junit.Assert.*;
@ -11,59 +9,55 @@ import java.util.List;
import net.sourceforge.filebot.web.Date; import net.sourceforge.filebot.web.Date;
import net.sourceforge.filebot.web.Episode; import net.sourceforge.filebot.web.Episode;
import net.sourceforge.filebot.web.TheTVDBSearchResult;
import org.junit.Test; import org.junit.Test;
public class EpisodeMetricsTest { public class EpisodeMetricsTest {
@Test @Test
public void substringMetrics() { public void substringMetrics() {
Episode eY1T1 = new Episode("Doctor Who", new Date(2005, 0, 0), 1, 1, "Rose", null); Episode eY1T1 = new Episode("Doctor Who", new Date(2005, 0, 0), 1, 1, "Rose", new TheTVDBSearchResult("Doctor Who", -1));
// Episode eY2T2 = new Episode("Doctor Who", new Date(1963, 0, 0), 1, 1, "An Unearthly Child"); // Episode eY2T2 = new Episode("Doctor Who", new Date(1963, 0, 0), 1, 1, "An Unearthly Child");
File fY1T1 = new File("Doctor Who (2005)/Doctor Who - 1x01 - Rose"); File fY1T1 = new File("Doctor Who (2005)/Doctor Who - 1x01 - Rose");
File fY2T2 = new File("Doctor Who (1963)/Doctor Who - 1x01 - An Unearthly Child"); File fY2T2 = new File("Doctor Who (1963)/Doctor Who - 1x01 - An Unearthly Child");
assertEquals(3.0 / 3, SubstringFields.getSimilarity(eY1T1, fY1T1), 0); assertEquals(2.0 / 3, SubstringFields.getSimilarity(eY1T1, fY1T1), 0.01);
assertEquals(2.0 / 3, SubstringFields.getSimilarity(eY1T1, fY2T2), 0.01); assertEquals(1.0 / 3, SubstringFields.getSimilarity(eY1T1, fY2T2), 0.01);
} }
@Test @Test
public void nameIgnoreEmbeddedChecksum() { public void nameIgnoreEmbeddedChecksum() {
assertEquals(1, Name.getSimilarity("test", "test [EF62DF13]"), 0); assertEquals(1, Name.getSimilarity("test", "test [EF62DF13]"), 0);
} }
@Test @Test
public void numericIgnoreEmbeddedChecksum() { public void numericIgnoreEmbeddedChecksum() {
assertEquals(1, Numeric.getSimilarity("S01E02", "Season 1, Episode 2 [00A01E02]"), 0); assertEquals(1, Numeric.getSimilarity("S01E02", "Season 1, Episode 2 [00A01E02]"), 0);
} }
@Test @Test
public void normalizeFile() { public void normalizeFile() {
assertEquals("abc", EpisodeMetrics.normalizeObject(new File("/folder/abc[EF62DF13].txt"))); assertEquals("abc", EpisodeMetrics.normalizeObject(new File("/folder/abc[EF62DF13].txt")));
} }
@Test @Test
public void matcherLevel2() throws Exception { public void matcherLevel2() throws Exception {
List<File> files = new ArrayList<File>(); List<File> files = new ArrayList<File>();
List<Episode> episodes = new ArrayList<Episode>(); List<Episode> episodes = new ArrayList<Episode>();
files.add(new File("Greek/Greek - S01E19 - No Campus for Old Rules")); files.add(new File("Greek/Greek - S01E19 - No Campus for Old Rules"));
files.add(new File("Veronica Mars - Season 1/Veronica Mars [1x19] Hot Dogs")); files.add(new File("Veronica Mars - Season 1/Veronica Mars [1x19] Hot Dogs"));
episodes.add(new Episode("Veronica Mars", null, 1, 19, "Hot Dogs", null)); episodes.add(new Episode("Veronica Mars", null, 1, 19, "Hot Dogs", new TheTVDBSearchResult("Veronica Mars", -1)));
episodes.add(new Episode("Greek", null, 1, 19, "No Campus for Old Rules", null)); episodes.add(new Episode("Greek", null, 1, 19, "No Campus for Old Rules", new TheTVDBSearchResult("Greek", -1)));
SimilarityMetric[] metrics = new SimilarityMetric[] { EpisodeIdentifier, SubstringFields }; SimilarityMetric[] metrics = new SimilarityMetric[] { EpisodeIdentifier, SubstringFields };
List<Match<File, Episode>> m = new Matcher<File, Episode>(files, episodes, true, metrics).match(); List<Match<File, Episode>> m = new Matcher<File, Episode>(files, episodes, true, metrics).match();
assertEquals("Greek - S01E19 - No Campus for Old Rules", m.get(0).getValue().getName()); assertEquals("Greek - S01E19 - No Campus for Old Rules", m.get(0).getValue().getName());
assertEquals("Greek - 1x19 - No Campus for Old Rules", m.get(0).getCandidate().toString()); assertEquals("Greek - 1x19 - No Campus for Old Rules", m.get(0).getCandidate().toString());
assertEquals("Veronica Mars [1x19] Hot Dogs", m.get(1).getValue().getName()); assertEquals("Veronica Mars [1x19] Hot Dogs", m.get(1).getValue().getName());
assertEquals("Veronica Mars - 1x19 - Hot Dogs", m.get(1).getCandidate().toString()); assertEquals("Veronica Mars - 1x19 - Hot Dogs", m.get(1).getCandidate().toString());
} }
} }

View File

@ -73,7 +73,7 @@ public class AnidbClientTest {
public void getEpisodeListAll() throws Exception { public void getEpisodeListAll() throws Exception {
List<Episode> list = anidb.getEpisodeList(monsterSearchResult); List<Episode> list = anidb.getEpisodeList(monsterSearchResult);
assertEquals(74, list.size()); assertEquals(77, list.size());
Episode first = list.get(0); Episode first = list.get(0);
@ -90,7 +90,7 @@ public class AnidbClientTest {
public void getEpisodeListAllShortLink() throws Exception { public void getEpisodeListAllShortLink() throws Exception {
List<Episode> list = anidb.getEpisodeList(twelvekingdomsSearchResult); List<Episode> list = anidb.getEpisodeList(twelvekingdomsSearchResult);
assertEquals(45, list.size()); assertEquals(46, list.size());
Episode first = list.get(0); Episode first = list.get(0);

View File

@ -106,7 +106,7 @@ public class IMDbClientTest {
public void getMovieDescriptor3() throws Exception { public void getMovieDescriptor3() throws Exception {
Movie movie = imdb.getMovieDescriptor(75610, null); Movie movie = imdb.getMovieDescriptor(75610, null);
assertEquals("21", movie.getName()); assertEquals("21 Up", movie.getName());
assertEquals(1977, movie.getYear()); assertEquals(1977, movie.getYear());
assertEquals(75610, movie.getImdbId(), 0); assertEquals(75610, movie.getImdbId(), 0);
} }
@ -152,7 +152,7 @@ public class IMDbClientTest {
MovieInfo movie = imdb.getImdbApiMovieInfo(new Movie(null, -1, 1287357, -1)); MovieInfo movie = imdb.getImdbApiMovieInfo(new Movie(null, -1, 1287357, -1));
assertEquals("Sommersonntag", movie.getName()); assertEquals("Sommersonntag", movie.getName());
assertEquals(2008, movie.getReleased().getYear()); assertEquals(2008, movie.getReleased().getYear());
assertEquals("2008-01-01", movie.getReleased().toString()); assertEquals("2008-06-07", movie.getReleased().toString());
} }
} }

View File

@ -54,17 +54,16 @@ public class TMDbClientTest {
assertEquals("Transformers", movie.getName()); assertEquals("Transformers", movie.getName());
assertEquals("2007-07-02", movie.getReleased().toString()); assertEquals("2007-07-02", movie.getReleased().toString());
assertEquals("PG-13", movie.getCertification()); assertEquals("PG-13", movie.getCertification());
assertEquals("[en]", movie.getSpokenLanguages().toString()); assertEquals("[en, es]", movie.getSpokenLanguages().toString());
assertEquals("Shia LaBeouf", movie.getActors().get(0)); assertEquals("Shia LaBeouf", movie.getActors().get(0));
assertEquals("Michael Bay", movie.getDirector()); assertEquals("Michael Bay", movie.getDirector());
assertEquals("Editor", movie.getCast().get(30).getJob());
} }
@Test @Test
public void getArtwork() throws Exception { public void getArtwork() throws Exception {
List<Artwork> artwork = tmdb.getArtwork("tt0418279"); List<Artwork> artwork = tmdb.getArtwork("tt0418279");
assertEquals("backdrops", artwork.get(0).getCategory()); assertEquals("backdrops", artwork.get(0).getCategory());
assertEquals("http://d3gtl9l2a4fn1j.cloudfront.net/t/p/original/jC4bQLEEcpM8N7BjpkMtP0zPakJ.jpg", artwork.get(0).getUrl().toString()); assertEquals("http://image.tmdb.org/t/p/original/dXTeZELpoVMDOTTLnNoCpsCngwW.jpg", artwork.get(0).getUrl().toString());
} }
@Test @Test

View File

@ -55,7 +55,7 @@ public class TVRageClientTest {
public void getEpisodeListAll() throws Exception { public void getEpisodeListAll() throws Exception {
List<Episode> list = tvrage.getEpisodeList(buffySearchResult); List<Episode> list = tvrage.getEpisodeList(buffySearchResult);
assertEquals(144, list.size()); assertEquals(143, list.size());
Episode first = list.get(0); Episode first = list.get(0);

View File

@ -30,7 +30,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(1, results.size()); assertEquals(2, results.size());
TheTVDBSearchResult first = (TheTVDBSearchResult) results.get(0); TheTVDBSearchResult first = (TheTVDBSearchResult) results.get(0);

View File

@ -119,7 +119,7 @@
<div class="content"> <div class="content">
<div class="section screenshot" style="border:none; box-shadow:none; background:white; margin-left: 20px"> <div class="section screenshot" style="border:none; box-shadow:none; background:white; margin-left: 20px">
<a href="http://www.filebot.net/scripts/" target="_blank"><img alt="See Examples" src="images/script.png" /></a> <a href="https://github.com/filebot/scripts" target="_blank"><img alt="See Examples" src="images/script.png" /></a>
<span class="quote">Anything is possible</span> <span class="quote">Anything is possible</span>
</div> </div>
<div class="section about"> <div class="section about">