From 3c2376950457f85a4e96aa014962ce68cb8e4bd4 Mon Sep 17 00:00:00 2001 From: Jeff Lamb Date: Mon, 6 Mar 2017 18:16:31 -0500 Subject: [PATCH] Clicking on the logo now forces a schedule update on the backend. This is temporary until I can get adding recordings to be done through the UI --- .../java/com/moparisthebest/rcrdit/RcrdIt.java | 8 ++++++++ src/main/webapp/index.html | 2 +- src/main/webapp/js/rcrdit.js | 14 ++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/moparisthebest/rcrdit/RcrdIt.java b/src/main/java/com/moparisthebest/rcrdit/RcrdIt.java index 80e46c1..575b19a 100644 --- a/src/main/java/com/moparisthebest/rcrdit/RcrdIt.java +++ b/src/main/java/com/moparisthebest/rcrdit/RcrdIt.java @@ -455,6 +455,14 @@ public class RcrdIt extends ResourceConfig implements AutoCloseable { return new GetScheduleResponse(scheduleRequest,channelList); } + + @POST + @Path("refreshAutoRecs") + //List + public void refreshAutoRecs() { + timer.schedule(new AutoRecTask(), 0); + } + /* @GET @Path("getSchedule") @Produces(MediaType.APPLICATION_JSON) diff --git a/src/main/webapp/index.html b/src/main/webapp/index.html index 6be6012..f7707a2 100644 --- a/src/main/webapp/index.html +++ b/src/main/webapp/index.html @@ -27,7 +27,7 @@
- logo + logo
diff --git a/src/main/webapp/js/rcrdit.js b/src/main/webapp/js/rcrdit.js index fdb3ae9..70d54b5 100644 --- a/src/main/webapp/js/rcrdit.js +++ b/src/main/webapp/js/rcrdit.js @@ -18,6 +18,20 @@ function padToTwoDigits(ss){ return ss; } +function forceScheduleUpdate(){ + $.ajax({ + url: 'rest/refreshAutoRecs', + type: 'post', + success: function (data) { + alert("Refresh Scheduled"); + }, + error: function ( jqXHR, textStatus, errorThrown ){ + alert(errorThrown); + } + }); + +} + function getSchedule2(requestObject){ if(isNull(requestObject)){