Added -Durl.refresh=PT0S system property for testing

This commit is contained in:
Reinhard Pointner 2016-03-12 13:46:42 +00:00
parent 0649850f31
commit 117b3be318
3 changed files with 10 additions and 4 deletions

View File

@ -11,6 +11,8 @@ def dir_root = ".."
def dir_website = "${dir_root}/website" def dir_website = "${dir_root}/website"
def dir_data = "${dir_website}/data" def dir_data = "${dir_website}/data"
new File(dir_data).mkdirs()
// sort and check shared regex collections // sort and check shared regex collections
['add-series-alias.txt', ['add-series-alias.txt',
'exclude-blacklist.txt', 'exclude-blacklist.txt',
@ -119,6 +121,12 @@ def csv(f, delim, keyIndex, valueIndex) {
} }
/* ------------------------------------------------------------------------- */
if (_args.mode == /no-index/) {
return
}
/* ------------------------------------------------------------------------- */ /* ------------------------------------------------------------------------- */

View File

@ -412,7 +412,7 @@ public class ReleaseInfo {
protected final Resource<Movie[]> movieIndex = tsv("url.movie-list", Cache.ONE_MONTH, this::parseMovie, Movie[]::new); protected final Resource<Movie[]> movieIndex = tsv("url.movie-list", Cache.ONE_MONTH, this::parseMovie, Movie[]::new);
protected final Resource<SubtitleSearchResult[]> osdbIndex = tsv("url.osdb-index", Cache.ONE_MONTH, this::parseSubtitle, SubtitleSearchResult[]::new); protected final Resource<SubtitleSearchResult[]> osdbIndex = tsv("url.osdb-index", Cache.ONE_MONTH, this::parseSubtitle, SubtitleSearchResult[]::new);
protected final SystemProperty<Duration> refreshDuration = new SystemProperty<Duration>("url.refresh", Duration::parse, null); protected final SystemProperty<Duration> refreshDuration = SystemProperty.of("url.refresh", Duration::parse, null);
private TheTVDBSearchResult parseSeries(String[] v) { private TheTVDBSearchResult parseSeries(String[] v) {
int id = parseInt(v[0]); int id = parseInt(v[0]);

View File

@ -5,9 +5,7 @@ import static net.filebot.Logging.*;
import java.util.function.Function; import java.util.function.Function;
import java.util.logging.Level; import java.util.logging.Level;
import net.filebot.Resource; public class SystemProperty<T> {
public class SystemProperty<T> implements Resource<T> {
public static <T> SystemProperty<T> of(String key, Function<String, T> valueFunction, T defaultValue) { public static <T> SystemProperty<T> of(String key, Function<String, T> valueFunction, T defaultValue) {
return new SystemProperty<T>(key, valueFunction, defaultValue); return new SystemProperty<T>(key, valueFunction, defaultValue);