mirror of
https://github.com/plexusorg/Module-HTTPD.git
synced 2024-11-01 01:47:11 +00:00
scoping issue
This commit is contained in:
parent
87a5693b75
commit
cf83f6f5b2
@ -24,15 +24,17 @@ public class AdminsEndpoint extends AbstractServlet
|
|||||||
{
|
{
|
||||||
private static final String TITLE = "Admins - Plex HTTPD";
|
private static final String TITLE = "Admins - Plex HTTPD";
|
||||||
|
|
||||||
GsonBuilder json = new GsonBuilder().registerTypeAdapter(ZonedDateTime.class, new ZonedDateTimeSerializer()).setPrettyPrinting();
|
|
||||||
|
|
||||||
String adminJson = json.create().toJson(Plex.get().getAdminList().getAllAdminPlayers().stream().peek(plexPlayer -> plexPlayer.setPunishments(Lists.newArrayList())).peek(plexPlayer -> plexPlayer.setNotes(Lists.newArrayList())).collect(Collectors.toList()));
|
|
||||||
|
|
||||||
String nonAdminJson = json.create().toJson(Plex.get().getAdminList().getAllAdminPlayers().stream().peek(plexPlayer -> plexPlayer.setVanished(false)).peek(plexPlayer -> plexPlayer.setCommandSpy(false)).peek(plexPlayer -> plexPlayer.setAdminActive(false)).peek(plexPlayer -> plexPlayer.setIps(Lists.newArrayList())).peek(plexPlayer -> plexPlayer.setPunishments(Lists.newArrayList())).peek(plexPlayer -> plexPlayer.setNotes(Lists.newArrayList())).collect(Collectors.toList()));
|
|
||||||
|
|
||||||
@GetMapping(endpoint = "/api/admins/")
|
@GetMapping(endpoint = "/api/admins/")
|
||||||
public String getAdmins(HttpServletRequest request, HttpServletResponse response)
|
public String getAdmins(HttpServletRequest request, HttpServletResponse response)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
GsonBuilder json = new GsonBuilder().registerTypeAdapter(ZonedDateTime.class, new ZonedDateTimeSerializer()).setPrettyPrinting();
|
||||||
|
|
||||||
|
String adminJson = json.create().toJson(Plex.get().getAdminList().getAllAdminPlayers().stream().peek(plexPlayer -> plexPlayer.setPunishments(Lists.newArrayList())).peek(plexPlayer -> plexPlayer.setNotes(Lists.newArrayList())).collect(Collectors.toList()));
|
||||||
|
|
||||||
|
String nonAdminJson = json.create().toJson(Plex.get().getAdminList().getAllAdminPlayers().stream().peek(plexPlayer -> plexPlayer.setVanished(false)).peek(plexPlayer -> plexPlayer.setCommandSpy(false)).peek(plexPlayer -> plexPlayer.setAdminActive(false)).peek(plexPlayer -> plexPlayer.setIps(Lists.newArrayList())).peek(plexPlayer -> plexPlayer.setPunishments(Lists.newArrayList())).peek(plexPlayer -> plexPlayer.setNotes(Lists.newArrayList())).collect(Collectors.toList()));
|
||||||
|
|
||||||
String ipAddress = request.getRemoteAddr();
|
String ipAddress = request.getRemoteAddr();
|
||||||
if (ipAddress == null)
|
if (ipAddress == null)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user