display Never if directory was never synced

This commit is contained in:
Zlatin Balevsky
2020-03-28 02:52:22 +00:00
parent 9837e1e3d7
commit 1e67139e74
3 changed files with 8 additions and 1 deletions

View File

@ -111,6 +111,7 @@ public class AdvancedSharingServlet extends HttpServlet {
sb.append("<Directory>").append(Util.escapeHTMLinXML(directory)).append("</Directory>");
sb.append("<AutoWatch>").append(autoWatch).append("</AutoWatch>");
sb.append("<LastSync>").append(DataHelper.formatTime(lastSync)).append("</LastSync>");
sb.append("<LastSyncTS>").append(lastSync).append("</LastSyncTS>");
sb.append("<SyncInterval>").append(syncInterval).append("</SyncInterval>");
sb.append("</WatchedDir>");
}

View File

@ -87,6 +87,7 @@ public class Util {
_x("MuWire Status"),
_x("must be greater than zero"),
_x("Name"),
_x("Never"),
_x("Number of items to keep on disk (-1 means unlimited)"),
_x("Outgoing Connections"),
// verb

View File

@ -5,6 +5,7 @@ class Directory {
this.autoWatch = xmlNode.getElementsByTagName("AutoWatch")[0].childNodes[0].nodeValue
this.syncInterval = xmlNode.getElementsByTagName("SyncInterval")[0].childNodes[0].nodeValue
this.lastSync = xmlNode.getElementsByTagName("LastSync")[0].childNodes[0].nodeValue
this.lastSyncTS = parseInt(xmlNode.getElementsByTagName("LastSyncTS")[0].childNodes[0].nodeValue)
}
getMapping() {
@ -20,7 +21,11 @@ class Directory {
mapping.set("Directory", this.directory + divRight)
mapping.set("Auto Watch", this.autoWatch)
mapping.set("Last Sync", this.lastSync)
if (this.lastSyncTS == 0)
mapping.set("Last Sync", _t("Never"))
else
mapping.set("Last Sync", this.lastSync)
mapping.set("Sync Interval", this.syncInterval)
return mapping