From: David ‘Bombe’ Roden Date: Sun, 24 Oct 2010 15:12:18 +0000 (+0200) Subject: Return the name of the Sone. X-Git-Tag: 0.1-RC1~42 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=8c8b13f370554e861ec755afc9e157ea048adc07;p=Sone.git Return the name of the Sone. --- diff --git a/src/main/java/net/pterodactylus/sone/web/ajax/GetSoneStatusPage.java b/src/main/java/net/pterodactylus/sone/web/ajax/GetSoneStatusPage.java index 3b619cc..740d143 100644 --- a/src/main/java/net/pterodactylus/sone/web/ajax/GetSoneStatusPage.java +++ b/src/main/java/net/pterodactylus/sone/web/ajax/GetSoneStatusPage.java @@ -22,6 +22,7 @@ import java.util.Date; import net.pterodactylus.sone.core.Core.SoneStatus; import net.pterodactylus.sone.data.Sone; +import net.pterodactylus.sone.template.SoneAccessor; import net.pterodactylus.sone.web.WebInterface; import net.pterodactylus.util.json.JsonObject; @@ -55,7 +56,7 @@ public class GetSoneStatusPage extends JsonPage { String soneId = request.getHttpRequest().getParam("sone"); Sone sone = webInterface.core().getSone(soneId); SoneStatus soneStatus = webInterface.core().getSoneStatus(sone); - return new JsonObject().put("status", soneStatus.name()).put("modified", sone.getModificationCounter() > 0).put("lastUpdated", new SimpleDateFormat("MMM d, yyyy, HH:mm:ss").format(new Date(sone.getTime()))).put("age", (System.currentTimeMillis() - sone.getTime()) / 1000); + return new JsonObject().put("status", soneStatus.name()).put("name", SoneAccessor.getNiceName(sone)).put("modified", sone.getModificationCounter() > 0).put("lastUpdated", new SimpleDateFormat("MMM d, yyyy, HH:mm:ss").format(new Date(sone.getTime()))).put("age", (System.currentTimeMillis() - sone.getTime()) / 1000); } /**