mirror of https://github.com/zlatinb/muwire
add some default file types to ignore
parent
34b7496036
commit
1c2972ecfc
|
@ -157,7 +157,7 @@ class MuWireSettings {
|
|||
allowMessages = Boolean.valueOf(props.getProperty("allowMessages","true"))
|
||||
allowOnlyTrustedMessages = Boolean.valueOf(props.getProperty("allowOnlyTrustedMessages","false"))
|
||||
|
||||
ignoredFileTypes = DataUtil.readEncodedSet(props, "ignoredFileTypes")
|
||||
ignoredFileTypes = DataUtil.readEncodedSet(props, "ignoredFileTypes", "part,az!,ut!,!qb")
|
||||
watchedDirectories = DataUtil.readEncodedSet(props, "watchedDirectories")
|
||||
watchedKeywords = DataUtil.readEncodedSet(props, "watchedKeywords")
|
||||
watchedRegexes = DataUtil.readEncodedSet(props, "watchedRegexes")
|
||||
|
|
|
@ -190,17 +190,24 @@ public class DataUtil {
|
|||
}
|
||||
|
||||
public static Set<String> readEncodedSet(Properties props, String property) {
|
||||
return readEncodedSet(props, property, null);
|
||||
}
|
||||
|
||||
public static Set<String> readEncodedSet(Properties props, String property, String defaults) {
|
||||
Set<String> rv = new ConcurrentHashSet<>();
|
||||
if (props.containsKey(property)) {
|
||||
String [] encoded = props.getProperty(property).split(",");
|
||||
for(String s : encoded)
|
||||
String[] encoded = props.getProperty(property).split(",");
|
||||
for (String s : encoded)
|
||||
rv.add(readi18nString(Base64.decode(s)));
|
||||
} else if (defaults != null) {
|
||||
for (String s : defaults.split(","))
|
||||
rv.add(s);
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
public static void writeEncodedSet(Set<String> set, String property, Properties props) {
|
||||
if (set.isEmpty())
|
||||
if (set.isEmpty())
|
||||
return;
|
||||
String encoded = set.stream().map(s -> Base64.encode(encodei18nString(s)))
|
||||
.collect(Collectors.joining(","));
|
||||
|
|
|
@ -297,7 +297,7 @@ OPTIONS_SHARING_SETTINGS=Sharing Settings
|
|||
OPTIONS_SHARE_DOWNLOADED_FILES=Share downloaded files
|
||||
OPTIONS_SHARE_HIDDEN_FILES=Share hidden files
|
||||
OPTIONS_HASHING_CORES=CPU Cores to use when hashing
|
||||
OPTIONS_IGNORED_FILE_TYPES=File types to not share (comma-separated)
|
||||
OPTIONS_IGNORED_FILE_TYPES=File types to not share
|
||||
OPTIONS_UPDATE_SETTINGS=Update Settings
|
||||
OPTIONS_CHECK_FOR_UPDATES=Check for updates every (hours)
|
||||
OPTIONS_DOWNLOAD_UPDATES=Download updates automatically
|
||||
|
|
Loading…
Reference in New Issue