Very basic listing of upcoming recordings functionality in the UI
This commit is contained in:
parent
ce4481f60c
commit
c9de3a4e2c
|
@ -323,6 +323,7 @@ public class RcrdIt extends ResourceConfig implements AutoCloseable {
|
||||||
cursor = cursor.plus(1, ChronoUnit.MINUTES);
|
cursor = cursor.plus(1, ChronoUnit.MINUTES);
|
||||||
}
|
}
|
||||||
// increment by minute up until end scheduling all timers until then, somehow store this info to show/email etc?
|
// increment by minute up until end scheduling all timers until then, somehow store this info to show/email etc?
|
||||||
|
|
||||||
log.debug("import done.\n\n------\n\n");
|
log.debug("import done.\n\n------\n\n");
|
||||||
if (!calendar.getComponents().isEmpty())
|
if (!calendar.getComponents().isEmpty())
|
||||||
try (FileOutputStream fout = new FileOutputStream("rcrdit.ics")) {
|
try (FileOutputStream fout = new FileOutputStream("rcrdit.ics")) {
|
||||||
|
@ -331,6 +332,7 @@ public class RcrdIt extends ResourceConfig implements AutoCloseable {
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// ignore e.printStackTrace();
|
// ignore e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void removeStoppedShows(final VTimeZone tz, final Calendar calendar, final Map<ProgramAutoRec, Instant> recs, final Instant finalCursor, final MessageDigest md, final boolean skipped) {
|
private static void removeStoppedShows(final VTimeZone tz, final Calendar calendar, final Map<ProgramAutoRec, Instant> recs, final Instant finalCursor, final MessageDigest md, final boolean skipped) {
|
||||||
|
@ -449,7 +451,6 @@ public class RcrdIt extends ResourceConfig implements AutoCloseable {
|
||||||
@POST
|
@POST
|
||||||
@Path("getRecordingProfiles")
|
@Path("getRecordingProfiles")
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
//List<Channel>
|
|
||||||
public Map<Integer, Profile> getRecordingProfiles() {
|
public Map<Integer, Profile> getRecordingProfiles() {
|
||||||
try (Connection conn = DriverManager.getConnection(databaseUrl);
|
try (Connection conn = DriverManager.getConnection(databaseUrl);
|
||||||
QueryMapper qm = new QueryMapper(conn)) {
|
QueryMapper qm = new QueryMapper(conn)) {
|
||||||
|
@ -479,11 +480,27 @@ public class RcrdIt extends ResourceConfig implements AutoCloseable {
|
||||||
return currentlyRecording;
|
return currentlyRecording;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@POST
|
||||||
|
@Path("getUpcomingRecordings")
|
||||||
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
|
public Map<Long,Program> getUpcomingRecordings() {
|
||||||
|
Map<Long,Program> returnMap = new LinkedHashMap<>();
|
||||||
|
for(TimerTask t : startTimers){
|
||||||
|
if(t instanceof RecordingTask){
|
||||||
|
RecordingTask rt = (RecordingTask)t;
|
||||||
|
if(rt.start != null && rt.scheduledExecutionTime() > System.currentTimeMillis()){
|
||||||
|
returnMap.put(rt.scheduledExecutionTime(),rt.start.getProgram());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return returnMap;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
@Path("getSchedule")
|
@Path("getSchedule")
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
@Produces(MediaType.APPLICATION_JSON)
|
||||||
@Consumes(MediaType.APPLICATION_JSON)
|
@Consumes(MediaType.APPLICATION_JSON)
|
||||||
//List<Channel>
|
|
||||||
public GetScheduleResponse getSchedule(GetScheduleRequest scheduleRequest) {
|
public GetScheduleResponse getSchedule(GetScheduleRequest scheduleRequest) {
|
||||||
List<Channel> channelList = new ArrayList<>();
|
List<Channel> channelList = new ArrayList<>();
|
||||||
try{
|
try{
|
||||||
|
@ -506,7 +523,6 @@ public class RcrdIt extends ResourceConfig implements AutoCloseable {
|
||||||
@POST
|
@POST
|
||||||
@Path("recordSingleInstanceOfProgram")
|
@Path("recordSingleInstanceOfProgram")
|
||||||
@Consumes(MediaType.APPLICATION_JSON)
|
@Consumes(MediaType.APPLICATION_JSON)
|
||||||
//List<Channel>
|
|
||||||
public String recordSingleInstanceOfProgram(NewRecordingRequest recordingRequest) {
|
public String recordSingleInstanceOfProgram(NewRecordingRequest recordingRequest) {
|
||||||
|
|
||||||
try (Connection conn = DriverManager.getConnection(databaseUrl);
|
try (Connection conn = DriverManager.getConnection(databaseUrl);
|
||||||
|
@ -532,19 +548,10 @@ public class RcrdIt extends ResourceConfig implements AutoCloseable {
|
||||||
|
|
||||||
@POST
|
@POST
|
||||||
@Path("refreshAutoRecs")
|
@Path("refreshAutoRecs")
|
||||||
//List<Channel>
|
|
||||||
public void refreshAutoRecs() {
|
public void refreshAutoRecs() {
|
||||||
timer.schedule(new AutoRecTask(), 0);
|
timer.schedule(new AutoRecTask(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* @GET
|
|
||||||
@Path("getSchedule")
|
|
||||||
@Produces(MediaType.APPLICATION_JSON)
|
|
||||||
@Consumes(MediaType.APPLICATION_JSON)
|
|
||||||
public void getSchedule() {
|
|
||||||
return schedule;
|
|
||||||
}*/
|
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
final File cfg;
|
final File cfg;
|
||||||
if (args.length < 1 || !((cfg = new File(args[0])).exists())) {
|
if (args.length < 1 || !((cfg = new File(args[0])).exists())) {
|
||||||
|
|
|
@ -337,6 +337,7 @@ ul#channelGroups li ul li ul li.channel {
|
||||||
padding: 21px;
|
padding: 21px;
|
||||||
margin-left: 10px;
|
margin-left: 10px;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
|
color:white;
|
||||||
vertical-align:top;
|
vertical-align:top;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -367,6 +368,14 @@ ul#channelGroups li ul li ul li.channel {
|
||||||
height: 400px;
|
height: 400px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#upcomingRecordingsGoHere{
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
background-color: white;
|
||||||
|
padding:20px;
|
||||||
|
border-radius: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
.circle:before {
|
.circle:before {
|
||||||
content: ' \25CF';
|
content: ' \25CF';
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
<div class="logoImageDiv"><a href="javascript:forceScheduleUpdate();"><img src="images/rcrditx128.png" alt='logo'/></a></div>
|
<div class="logoImageDiv"><a href="javascript:forceScheduleUpdate();"><img src="images/rcrditx128.png" alt='logo'/></a></div>
|
||||||
<div class="sectionSelection" id="gotoTvGuide"><img alt="Schedule" src="images/guideicon.png"/></div>
|
<div class="sectionSelection" id="gotoTvGuide"><img alt="Schedule" src="images/guideicon.png"/></div>
|
||||||
<div class="sectionSelection" id="gotoAutoRecs"><img alt="Schedule" src="images/autorecsicon.png"/></div>
|
<div class="sectionSelection" id="gotoAutoRecs"><img alt="Schedule" src="images/autorecsicon.png"/></div>
|
||||||
<div class="sectionSelection"></div>
|
<div class="sectionSelection" id="gotoUpcomingRecordings">Upcoming Recordings</div>
|
||||||
<div class="sectionSelection"></div>
|
<div class="sectionSelection"></div>
|
||||||
<div class="sectionSelection nowRecording" id="nowRecordingDiv"></div>
|
<div class="sectionSelection nowRecording" id="nowRecordingDiv"></div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -50,5 +50,6 @@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div id="autoRecsGoHere" style='display:none; width: 90%'></div>
|
<div id="autoRecsGoHere" style='display:none; width: 90%'></div>
|
||||||
|
<div id="upcomingRecordingsGoHere" style='display:none; width: 90%'></div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
|
@ -14,15 +14,26 @@ $( document ).ready(function() {
|
||||||
$("#gotoTvGuide").click(function(){
|
$("#gotoTvGuide").click(function(){
|
||||||
getSchedule2(null);
|
getSchedule2(null);
|
||||||
$("#autoRecsGoHere").hide();
|
$("#autoRecsGoHere").hide();
|
||||||
|
$("#upcomingRecordingsGoHere").hide();
|
||||||
$("#guideGoesHere").show();
|
$("#guideGoesHere").show();
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#gotoAutoRecs").click(function(){
|
$("#gotoAutoRecs").click(function(){
|
||||||
$("#guideGoesHere").hide();
|
$("#guideGoesHere").hide();
|
||||||
|
$("#upcomingRecordingsGoHere").hide();
|
||||||
getAutoRecs();
|
getAutoRecs();
|
||||||
$("#autoRecsGoHere").show();
|
$("#autoRecsGoHere").show();
|
||||||
$("#programInfo").dialog("close");
|
$("#programInfo").dialog("close");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$("#gotoUpcomingRecordings").click(function(){
|
||||||
|
$("#guideGoesHere").hide();
|
||||||
|
getUpcomingRecordings();
|
||||||
|
$("#autoRecsGoHere").hide();
|
||||||
|
$("#upcomingRecordingsGoHere").show();
|
||||||
|
|
||||||
|
$("#programInfo").dialog("close");
|
||||||
|
});
|
||||||
getCurrentlyRecording();
|
getCurrentlyRecording();
|
||||||
setInterval(getCurrentlyRecording,30000);
|
setInterval(getCurrentlyRecording,30000);
|
||||||
});
|
});
|
||||||
|
@ -46,6 +57,32 @@ function getCurrentlyRecording(){
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getUpcomingRecordings(){
|
||||||
|
$("#upcomingRecordingsGoHere").html("");
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: 'rest/getUpcomingRecordings',
|
||||||
|
type: 'post',
|
||||||
|
dataType: 'json',
|
||||||
|
success: function (data) {
|
||||||
|
var upcomingRecordingsDiv = $("#upcomingRecordingsGoHere");
|
||||||
|
var upcomingRecordingTable = $("<table></table");
|
||||||
|
for(var idx in data){
|
||||||
|
var scheduledRec = data[idx];
|
||||||
|
var startRecordingDate = new Date(0);
|
||||||
|
startRecordingDate.setUTCSeconds((idx/1000));
|
||||||
|
var subtitle = scheduledRec.subTitle;
|
||||||
|
if(subtitle === null)subtitle = "";
|
||||||
|
upcomingRecordingTable.append($("<tr></tr>").append($("<td></td>").append(startRecordingDate.toString()+" - "+scheduledRec.title+" - "+subtitle)));
|
||||||
|
}
|
||||||
|
upcomingRecordingsDiv.append(upcomingRecordingTable);
|
||||||
|
},
|
||||||
|
error: function ( jqXHR, textStatus, errorThrown ){
|
||||||
|
alert(errorThrown);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function getAutoRecs(){
|
function getAutoRecs(){
|
||||||
$("#autoRecsGoHere").html("");
|
$("#autoRecsGoHere").html("");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue