config options for feeds

pull/42/head
Zlatin Balevsky 2020-03-13 11:50:45 +00:00
parent f4c96db841
commit 455b0ea48e
3 changed files with 55 additions and 0 deletions

View File

@ -49,6 +49,11 @@ public class ConfigurationServlet extends HttpServlet {
core.getMuOptions().setShareHiddenFiles(false);
core.getMuOptions().setSearchComments(false);
core.getMuOptions().setBrowseFiles(false);
core.getMuOptions().setFileFeed(true);
core.getMuOptions().setAdvertiseFeed(true);
core.getMuOptions().setAutoPublishSharedFiles(false);
core.getMuOptions().setDefaultFeedAutoDownload(false);
core.getMuOptions().setDefaultFeedSequential(false);
}
private void update(String name, String value) throws Exception {
@ -71,6 +76,14 @@ public class ConfigurationServlet extends HttpServlet {
case "inbound.quantity" : core.getI2pOptions().setProperty(name, String.valueOf(getPositiveInteger(value,"Inbound tunnel quantity"))); break;
case "outbound.length" : core.getI2pOptions().setProperty(name, String.valueOf(getPositiveInteger(value,"Outbound tunnel length"))); break;
case "outbound.quantity" : core.getI2pOptions().setProperty(name, String.valueOf(getPositiveInteger(value,"Outbound tunnel quantity"))); break;
case "fileFeed" : core.getMuOptions().setFileFeed(true); break;
case "advertiseFeed" : core.getMuOptions().setAdvertiseFeed(true); break;
case "autoPublishSharedFiles" : core.getMuOptions().setAutoPublishSharedFiles(true); break;
case "defaultFeedAutoDownload" : core.getMuOptions().setDefaultFeedAutoDownload(true); break;
case "defaultFeedSequential" : core.getMuOptions().setDefaultFeedSequential(true); break;
case "defaultFeedUpdateInterval" : core.getMuOptions().setDefaultFeedUpdateInterval(60000 * getPositiveInteger(value,"Feed update frequency (minutes")); break;
case "defaultFeedItemsToKeep" : core.getMuOptions().setDefaultFeedItemsToKeep(getInteger(value, "Number of items to keep on disk (-1 means unlimited)")); break;
// TODO: ui settings
}
}

View File

@ -39,6 +39,7 @@ public class Util {
_x("Certify"),
_x("Clear Finished"),
_x("Comment"),
_x("Default settings for new feeds"),
_x("Details for {0}"),
_x("Distrusted"),
_x("Distrusted User"),
@ -77,8 +78,11 @@ public class Util {
_x("Pause"),
_x("Piece Size"),
_x("Progress"),
_x("Publish"),
_x("Publish shared files automatically"),
_x("Published"),
_x("Publisher"),
_x("Publishing"),
_x("Query"),
// noun
_x("Reason"),

View File

@ -94,6 +94,44 @@ Exception error = (Exception) application.getAttribute("MWConfigError");
</tr>
</table>
</div>
<div class="configuration-section">
<h3><%=Util._t("Publishing")%></h3>
<table>
<tr>
<td><%=Util._t("Enable my feed")%></td>
<td><p align="right"><input type="checkbox" <% if (core.getMuOptions().getFileFeed()) out.write("checked"); %> name="fileFeed" value="true"></p></td>
</tr>
<tr>
<td><%=Util._t("Advertise my feed in search results")%></td>
<td><p align="right"><input type="checkbox" <% if (core.getMuOptions().getAdvertiseFeed()) out.write("checked"); %> name="advertiseFeed" value="true"></p></td>
</tr>
<tr>
<td><%=Util._t("Publish shared files automatically")%></td>
<td><p align="right"><input type="checkbox" <% if (core.getMuOptions().getAutoPublishSharedFiles()) out.write("checked"); %> name="autoPublishSharedFiles" value="true"></p></td>
</tr>
</table>
</div>
<div class="configuration-section">
<h3><%=Util._t("Default settings for new feeds")%></h3>
<table>
<tr>
<td><%=Util._t("Download published files automatically")%></td>
<td><p align="right"><input type="checkbox" <% if (core.getMuOptions().getDefaultFeedAutoDownload()) out.write("checked"); %> name="defaultFeedAutoDownload" value="true"></p></td>
</tr>
<tr>
<td><%=Util._t("Download each file sequentially")%></td>
<td><p align="right"><input type="checkbox" <% if (core.getMuOptions().getDefaultFeedSequential()) out.write("checked"); %> name="defaultFeedAutoDownload" value="true"></p></td>
</tr>
<tr>
<td><%=Util._t("Feed update frequency (minutes)")%></td>
<td><p align="right"><input type="text" size="1" name="defaultFeedUpdateInterval" class="right" value="<%= core.getMuOptions().getDefaultFeedUpdateInterval() / 60000 %>"></p></td>
</tr>
<tr>
<td><%=Util._t("Number of items to keep on disk (-1 means unlimited)")%></td>
<td><p align="right"><input type="text" size="1" name="defaultFeedItemsToKeep" class="right" value="<%= core.getMuOptions().getDefaultFeedItemsToKeep() %>"></p></td>
</tr>
</table>
</div>
<div class="configuration-section">
<h3><%=Util._t("Trust")%></h3>
<table>