mirror of
https://github.com/moparisthebest/rcrdit
synced 2024-12-21 23:08:57 -05:00
Fix another UI bug and delete expired autorecs automatically
This commit is contained in:
parent
7449a2d85c
commit
d10b871943
@ -398,15 +398,9 @@ public class RcrdIt extends ResourceConfig implements AutoCloseable {
|
|||||||
QueryMapper qm = new QueryMapper(conn)) {
|
QueryMapper qm = new QueryMapper(conn)) {
|
||||||
log.debug("Database connected!");
|
log.debug("Database connected!");
|
||||||
final Map<Integer, Profile> profileMap = qm.toMap("SELECT profile_id, name, folder, run_at_recording_start, run_at_recording_finish FROM profile", new HashMap<>(), Integer.class, Profile.class);
|
final Map<Integer, Profile> profileMap = qm.toMap("SELECT profile_id, name, folder, run_at_recording_start, run_at_recording_finish FROM profile", new HashMap<>(), Integer.class, Profile.class);
|
||||||
//System.out.println(profileMap);
|
// delete old autorecs
|
||||||
/*
|
final int autoRecsDeleted = qm.executeUpdate("DELETE FROM autorecs WHERE time_max < ?", java.sql.Timestamp.from(Instant.now()));
|
||||||
try(java.sql.ResultSet rs = qm.toResultSet("SELECT profile_id, priority, title, channel_name, days_of_week AS daysOfWeekString, between_time_start AS betweenTimeStartTime, between_time_end AS betweenTimeEndTime, time_min AS timeMinDate, time_max AS timeMaxDate FROM autorecs")) {
|
log.debug("expired autorecs deleted: {}", autoRecsDeleted);
|
||||||
for(int x = 1; x <= rs.getMetaData().getColumnCount(); ++x) {
|
|
||||||
System.out.println(rs.getMetaData().getColumnName(x));
|
|
||||||
System.out.println(rs.getMetaData().getColumnLabel(x));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
autoRecs.clear();
|
autoRecs.clear();
|
||||||
qm.toCollection("SELECT profile_id, priority, title, channel_name, days_of_week, between_time_start, between_time_end, time_min, time_max FROM autorecs", autoRecs, AutoRec.class);
|
qm.toCollection("SELECT profile_id, priority, title, channel_name, days_of_week, between_time_start, between_time_end, time_min, time_max FROM autorecs", autoRecs, AutoRec.class);
|
||||||
autoRecs.forEach(a -> a.setProfile(profileMap.get(a.getProfileId())));
|
autoRecs.forEach(a -> a.setProfile(profileMap.get(a.getProfileId())));
|
||||||
|
@ -562,12 +562,12 @@ function validateProgramRecordDialog(advancedRecordMode){
|
|||||||
var effectiveEndText = $("#effectiveEndText").val();
|
var effectiveEndText = $("#effectiveEndText").val();
|
||||||
var effectiveEndTimestamp = moment(effectiveEndText,["MM/DD/YYYY hh:mm"]).unix();
|
var effectiveEndTimestamp = moment(effectiveEndText,["MM/DD/YYYY hh:mm"]).unix();
|
||||||
|
|
||||||
if(isNaN(effectiveBeginTimestamp) && !isNull(effectiveBeginText)){
|
if(isNaN(effectiveBeginTimestamp) && !isEmpty(effectiveBeginText)){
|
||||||
toastr["error"]("Effective Begin entry is not valid!");
|
toastr["error"]("Effective Begin entry is not valid!");
|
||||||
$("#effectiveBeginText").addClass("entryError");
|
$("#effectiveBeginText").addClass("entryError");
|
||||||
error = true;
|
error = true;
|
||||||
}
|
}
|
||||||
if(isNaN(effectiveEndTimestamp) && !isNull(effectiveEndText)){
|
if(isNaN(effectiveEndTimestamp) && !isEmpty(effectiveEndText)){
|
||||||
toastr["error"]("Effective End entry is not valid!");
|
toastr["error"]("Effective End entry is not valid!");
|
||||||
$("#effectiveEndText").addClass("entryError");
|
$("#effectiveEndText").addClass("entryError");
|
||||||
error = true;
|
error = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user