From ccd29b61691bd6db33ad2a37aa4224223274d71c Mon Sep 17 00:00:00 2001 From: Jeff Lamb Date: Wed, 8 Mar 2017 23:01:29 -0500 Subject: [PATCH] Can now schedule individual recordings by clicking on an item in the schedule and clicking the "Single Record" icon. NOTE: this should enter the start/stop time as well, but the code to do so is commented out because it crashes the program after the recording is added when it reads the schedule. --- .../com/moparisthebest/rcrdit/RcrdIt.java | 23 ++++ .../requestbeans/NewRecordingRequest.java | 69 ++++++++++++ src/main/webapp/css/rcrdit.css | 36 +++++++ src/main/webapp/images/recordMulti.png | Bin 0 -> 18758 bytes src/main/webapp/images/recordSingle.png | Bin 0 -> 18373 bytes src/main/webapp/js/rcrdit.js | 102 +++++++++--------- 6 files changed, 181 insertions(+), 49 deletions(-) create mode 100644 src/main/java/com/moparisthebest/rcrdit/requestbeans/NewRecordingRequest.java create mode 100644 src/main/webapp/images/recordMulti.png create mode 100644 src/main/webapp/images/recordSingle.png diff --git a/src/main/java/com/moparisthebest/rcrdit/RcrdIt.java b/src/main/java/com/moparisthebest/rcrdit/RcrdIt.java index 84cd3e6..e213be3 100644 --- a/src/main/java/com/moparisthebest/rcrdit/RcrdIt.java +++ b/src/main/java/com/moparisthebest/rcrdit/RcrdIt.java @@ -74,6 +74,7 @@ import java.time.temporal.ChronoUnit; import java.util.*; import java.util.stream.Collectors; import com.moparisthebest.rcrdit.requestbeans.GetScheduleRequest; +import com.moparisthebest.rcrdit.requestbeans.NewRecordingRequest; import com.moparisthebest.rcrdit.responsebeans.GetScheduleResponse; import org.glassfish.jersey.jackson.JacksonFeature; @@ -459,6 +460,28 @@ public class RcrdIt extends ResourceConfig implements AutoCloseable { return new GetScheduleResponse(scheduleRequest,channelList); } + @POST + @Path("recordSingleInstanceOfProgram") + @Consumes(MediaType.APPLICATION_JSON) + //List + public String recordSingleInstanceOfProgram(NewRecordingRequest recordingRequest) { + + try (Connection conn = DriverManager.getConnection(databaseUrl); + QueryMapper qm = new QueryMapper(conn)) { + String sql = "INSERT INTO autorecs (autorec_id, profile_id, priority, title, channel_name, days_of_week, between_time_start, between_time_end, time_min, time_max) " + + "VALUES (NULL, ?, ?, ?, ?, NULL, NULL,NULL, from_unixtime(?), from_unixtime(?))"; + Long startDate = null; + Long endDate = null; + //if(recordingRequest.getStartDateEpochSeconds() != null)startDate = recordingRequest.getStartDateEpochSeconds(); + //if(recordingRequest.getEndDateEpochSeconds() != null)endDate = recordingRequest.getEndDateEpochSeconds(); + qm.executeUpdate(sql, recordingRequest.getProfileNo(),recordingRequest.getPriority(),recordingRequest.getTitle(),recordingRequest.getChannelName(),startDate,endDate); + timer.schedule(new AutoRecTask(), 0); + }catch(Exception e){ + log.error("Error in recordSingleInstanceOfProgram",e); + } + return "OK"; + } + @POST @Path("refreshAutoRecs") diff --git a/src/main/java/com/moparisthebest/rcrdit/requestbeans/NewRecordingRequest.java b/src/main/java/com/moparisthebest/rcrdit/requestbeans/NewRecordingRequest.java new file mode 100644 index 0000000..e87abdb --- /dev/null +++ b/src/main/java/com/moparisthebest/rcrdit/requestbeans/NewRecordingRequest.java @@ -0,0 +1,69 @@ +/* + * To change this license header, choose License Headers in Project Properties. + * To change this template file, choose Tools | Templates + * and open the template in the editor. + */ +package com.moparisthebest.rcrdit.requestbeans; + +/** + * + * @author Jeff + */ +public class NewRecordingRequest { + protected Long profileNo; + protected String title; + protected String channelName; + protected Long startDateEpochSeconds; + protected Long endDateEpochSeconds; + protected Long priority; + + public Long getProfileNo() { + return profileNo; + } + + public void setProfileNo(Long profileNo) { + this.profileNo = profileNo; + } + + public String getTitle() { + return title; + } + + public void setTitle(String title) { + this.title = title; + } + + public String getChannelName() { + return channelName; + } + + public void setChannelName(String channelName) { + this.channelName = channelName; + } + + public Long getStartDateEpochSeconds() { + return startDateEpochSeconds; + } + + public void setStartDateEpochSeconds(Long startDateEpochSeconds) { + this.startDateEpochSeconds = startDateEpochSeconds; + } + + public Long getEndDateEpochSeconds() { + return endDateEpochSeconds; + } + + public void setEndDateEpochSeconds(Long endDateEpochSeconds) { + this.endDateEpochSeconds = endDateEpochSeconds; + } + + public Long getPriority() { + return priority; + } + + public void setPriority(Long priority) { + this.priority = priority; + } + + +} diff --git a/src/main/webapp/css/rcrdit.css b/src/main/webapp/css/rcrdit.css index 4d428e5..d18e48c 100644 --- a/src/main/webapp/css/rcrdit.css +++ b/src/main/webapp/css/rcrdit.css @@ -262,4 +262,40 @@ ul#channelGroups li ul li ul li.channel { padding-right: 15px; display: block; +} + +.noTitleStuff .ui-dialog-titlebar {display:none} + +.programTitle{ + font-size: 22pt; +} + +.programSubtitleLine{ + font-size: 12pt; +} + +.blankSpace{ + height: 20px; +} + +.recordSingleDiv{ + height: 50px; + width: 50px; + background-image: url("../images/recordSingle.png"); + float: left; +} + +.recordSingleDiv:hover{ + cursor:pointer; +} + +.recordSingleDiv:active{ + background-color:gray; +} + +.recordMultiDiv{ + height: 50px; + width: 50px; + background-image: url("../images/recordMulti.png"); + float: left; } \ No newline at end of file diff --git a/src/main/webapp/images/recordMulti.png b/src/main/webapp/images/recordMulti.png new file mode 100644 index 0000000000000000000000000000000000000000..8a538ab374584deae5c184b6efbd9df99b02b9c2 GIT binary patch literal 18758 zcmeI3c{G%7`2Qb~T~s8M8cT(Y*(}X8$c!~x7;Bp`o3YI>Q??ILky1&rM`@EK6(OOJ zEs3ZoL_(4el_kpd8``Iu^Ev1D{r>YkGw00AbKTedzOLtf-Pe83^UOKVk?j^nV#2G0 z0RRv)G1j+ceZ%M9g8Zz{wYm{ESYJYPV@C!6h%BFf^8iU_Rsw*qB^8U^zTK6^q%mA+ zbdU)a3!?kb$W#v!0Qj|~*idjb11q#AI>#`k5h15dY1UGLAZtuyh-CBz6*(b^Z4q*5 z&!w!&ml_!Gt*$*6!F%FF$T2A^Rneou&jfnq&Yw7VA>wG=RCnM7_m+~0*AHj&TXp)g zM^o||11s-5B7>(W}UnXz| z;PHDbA_$b3CznCj9G(+@i%Hzc6LN^Bj2XSzR4_ym*cxyGa~arb$P<#1u)zj6#|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r#%kh|3{(ybiX56a{cG ktrPj9iLn~O;A0oyc+V~)UF)RP{Nv~*1{V4`80Q2358j1S!~g&Q literal 0 HcmV?d00001 diff --git a/src/main/webapp/images/recordSingle.png b/src/main/webapp/images/recordSingle.png new file mode 100644 index 0000000000000000000000000000000000000000..9ce011816962d98e8010ce95d0147b5950bc717c GIT binary patch literal 18373 zcmeI3c{o(>`^S%zU9?b=8kCSR3o~QJ7|Ym&FtW9n-Ncx|)SyqItZkCAMp|S|NhzU} zLJ83-$tO#a==Vv|hTjY=nrg1kb$!3T>-W#hb2{#QzZ_q)tAzLa;6X4`s&0D$ZQ{#OjhIIc`rZT&~TtvYM^hkP|Pye}Cj&B^N!p-7=3Qd)1Hc-*qB>_wCQmx1I2RST**dY2v~o zTz~OMR#}T=jg(x9t$_<7Qm(*a*}T7Z)!(Rl-m7mGC9{GJC`y%4)I-KK#efeHSnO(z z8p$hwSm-@jDWJwNvj(~}Zc^cuMf!TN$Y`+|PLh#>ROCXyEPTJkDZtEHEHW!i%MHkx z4fr;aNj<kbGD4_ zp`BAOy8z@2Jn;QS3_@%Ij^6g@dL-D3dowvu)2zP6Njq~EUR zE!@dBrsFm_D}hLw-N7IL*l4*zpK!a(v|b7TEOVlC&zh^gyS7-bMq=r;IZv<2e(^;{ zTdcTo-9phqh7!3n*jJ}`r-gQG(^)lLU&wtkHNzSgzu08b0rm*$$V6+RKAvae}Z zMM=*#Z;)C*RDTjLM%wMExnF8gddvs)YqqoJ?^yx56~E9$!yyS_3v=B~0J+<$y)_A* zg^pWqeL2av0f6uP5?f^hI}~-!#pJ%+1$;$5YDu*9aoM{R4lE;4IVbaO@cAVsdy&Wb z?-uzfJW0gi>!CF-7fTx42!QI>)moGq=}9M(8%s5c<%;T-oLyHeUYRgTZYkx?o*!jZ zBaNKRwEz*9ncI4<@pO7@n-5yL!f@UbX_T~hw9EBX8p-(%=d~`+`*>q92@Z?%wAIsm zI6rX#L~&a@{swBr`~*CFRmFi>cBLl?ZS&i#+X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KVB*7").addClass("programTitle").append($("").html(obj.title))); + if(!isNull(obj.subTitle)){ + $("#programInfoTable").append($("").addClass("programSubtitleLine").append($("").html(obj.subTitle))); + } + if(!isNull(obj.desc)){ + $("#programInfoTable").append($("").append($("").addClass("blankSpace"))); + $("#programInfoTable").append($("").addClass("programDescription").append($("").html(obj.desc))); + } + + $("#programInfo").dialog("open"); + var recordSingleDiv = $("
").attr("class","recordSingleDiv"); + recordSingleDiv.click(function(){ + var programToRecord = $("#programInfoTable").data("programObj"); + var recordingScheduleObject = {"profileNo":"1","title": programToRecord.title,"channelName": programToRecord.channelName,"priority": "9999999","startDateEpochSeconds" : programToRecord.start.epochSecond , "endDateEpochSeconds" : programToRecord.stop.epochSecond}; + scheduleRecording(recordingScheduleObject); + }); + $("#programInfo").append(recordSingleDiv); + $("#programInfo").append($("
").attr("class","recordMultiDiv")); + }); return programDiv; } - -function getSchedule(requestObject){ - if(isNull(requestObject)){ - requestObject = {"channelsPerPage" : "100", "pageNum" : "1"}; - } +function scheduleRecording(recordingDetails){ $.ajax({ - url: 'rest/getSchedule', + url: 'rest/recordSingleInstanceOfProgram', type: 'post', - dataType: 'json', contentType: "application/json", - data: JSON.stringify(requestObject), + data: JSON.stringify(recordingDetails), success: function (data) { - $("#guideGoesHere").html(""); - var guideTable = $("
"); - - var channelList = data.schedule; - var requestObject = data.requestObject; - var requestStartTimeEpochSeconds = requestObject.startTime.epochSecond; - var requestEndTimeEpochSeconds = requestObject.endTime.epochSecond; - var requestStartDate = new Date(requestStartTimeEpochSeconds*1000); - var requestEndDate = new Date(requestEndTimeEpochSeconds*1000); - var nextDate = new Date(requestStartDate.getTime()); - nextDate.setHours(nextDate.getHours()+1); - var timeDisplayRow = $(""+padToTwoDigits(requestStartDate.getHours())+":"+padToTwoDigits(requestStartDate.getMinutes())+""+padToTwoDigits(nextDate.getHours())+":"+padToTwoDigits(nextDate.getMinutes())+""); - guideTable.append(timeDisplayRow); - for(var idx in channelList){ - var channel = channelList[idx]; - var channelTableRow = $(""+channel.displayName+""); - for(var idx2 in channel.programs){ - var program = channel.programs[idx2]; - var durationSeconds = program.stop.epochSecond-program.start.epochSecond; - var durationMinutes = durationSeconds/60; - var displayDurationSeconds = durationSeconds; - if(program.start.epochSecond < requestStartTimeEpochSeconds){ - displayDurationSeconds = displayDurationSeconds-(requestStartTimeEpochSeconds-program.start.epochSecond); - } - if(program.stop.epochSecond > requestEndTimeEpochSeconds){ - displayDurationSeconds = displayDurationSeconds-(program.stop.epochSecond-requestEndTimeEpochSeconds); - } - var displayDurationMinutes = displayDurationSeconds/60; - - - - var programText = program.title; - if(!isNull(program.subTitle)){ - programText+="
"+program.subTitle+""; - } - channelTableRow.append(""+programText+""); - } - guideTable.append(channelTableRow); - } - $("#guideGoesHere").append(guideTable); + alert("scheduled!"); }, error: function ( jqXHR, textStatus, errorThrown ){ alert(errorThrown); } }); + } - function isNull(item){ if(item === null || typeof item === "undefined"){ return true; } return false; +} + +function divExists(divId){ + var found = $("#"+divId); + if(found.length === 0){ + return false; + } + return true; +} + +function initializeProgramInfoPopup(){ + if(!divExists("programInfo")){ + var programInfoDiv = $("
").attr("id","programInfo"); + programInfoDiv.append($("
").attr("id","programInfoTable")); + $("body").append(programInfoDiv); + } + $("#programInfoTable tr").remove(); + + $("#programInfo").dialog({ + autoOpen: false, + dialogClass: 'noTitleStuff2', + width: "600" + }); } \ No newline at end of file