uint16_t s_dvb_prefcapid;
int s_dvb_prefcapid_lock;
uint16_t s_dvb_forcecaid;
+ time_t s_dvb_last_seen;
/*
* EIT/EPG control
.off = offsetof(mpegts_service_t, s_dvb_forcecaid),
.opts = PO_ADVANCED | PO_HEXA,
},
+ {
+ .type = PT_TIME,
+ .id = "last_seen",
+ .name = "Last Seen",
+ .off = offsetof(mpegts_service_t, s_dvb_last_seen),
+ .opts = PO_ADVANCED | PO_RDONLY,
+ },
{},
}
};
s->s_pmt_pid = pmt_pid;
if (save) *save = 1;
}
+ if (create && (*save || s->s_dvb_last_seen + 3600 < dispatch_clock)) {
+ s->s_dvb_last_seen = dispatch_clock;
+ if (save) *save = 1;
+ }
return s;
}
}
/* Create */
if (create) {
s = mm->mm_network->mn_create_service(mm, sid, pmt_pid);
+ s->s_dvb_last_seen = dispatch_clock;
if (save) *save = 1;
}
-
+
return s;
}
htsmsg_add_bool(m, "duration", 1);
if (opts & PO_HEXA)
htsmsg_add_bool(m, "hexa", 1);
+ if (opts & PO_DATE)
+ htsmsg_add_bool(m, "date", 1);
/* Enum list */
if (pl->list)
#define PO_PASSWORD 0x0080 // String is a password
#define PO_DURATION 0x0100 // For PT_TIME - differentiate between duration and datetime
#define PO_HEXA 0x0200 // Hexadecimal value
+#define PO_DATE 0x0400 // Show date only
/*
* Property definition
this.hidden = conf.hidden || conf.advanced;
this.password = conf.showpwd ? false : conf.password;
this.duration = conf.duration;
+ this.date = conf.date;
this.intsplit = conf.intsplit;
this.hexa = conf.hexa;
this.group = conf.group;
} else if (this.type === 'time') {
w = 120;
ftype = 'date';
- if (this.durations) {
+ if (this.duration) {
ftype = 'numeric';
w = 80;
}
}
return min + ' min';
}
+ if (this.date) {
+ return function(v) {
+ var dt = new Date(v * 1000);
+ return dt.toLocaleDateString();
+ }
+ }
return function(v) {
var dt = new Date(v * 1000);
- return dt.format('D j M H:i');
+ return dt.toLocaleString();
}
}
});
case 'time':
- if (!f.duration)
+ if (!f.duration) {
+ if (d) {
+ var dt = new Date(value * 1000);
+ value = f.date ? dt.toLocaleDateString() :
+ dt.toLocaleString();
+ return new Ext.form.TextField({
+ fieldLabel: f.caption,
+ name: f.id,
+ value: value,
+ disabled: true,
+ width: 300
+ });
+ }
return new Ext.ux.form.TwinDateTimeField({
fieldLabel: f.caption,
name: f.id,
value: value,
- disabled: d,
+ disabled: false,
width: 300,
timeFormat: 'H:i:s',
timeConfig: {
allowBlank: true
}
});
+ }
/* fall thru!!! */
case 'int':