#define DVR_WHITESPACE_IN_TITLE 0x20
#define DVR_DIR_PER_TITLE 0x40
#define DVR_EPISODE_IN_TITLE 0x80
+#define DVR_CLEAN_TITLE 0x100
typedef enum {
DVR_PRIO_IMPORTANT,
{
struct tm tm;
char buf[40];
+ int i;
if(dvr_flags & DVR_CHANNEL_IN_TITLE)
snprintf(output, outlen, "%s-", de->de_channel->ch_name);
".E%02d",
de->de_episode.ee_episode);
}
+
+ if(dvr_flags & DVR_CLEAN_TITLE) {
+ for (i=0;i<strlen(output);i++) {
+ if (
+ output[i]<32 ||
+ output[i]>122 ||
+ output[i]==34 ||
+ output[i]==39 ||
+ output[i]==92 ||
+ output[i]==58
+ ) output[i]='_';
+ }
+ }
}
htsmsg_add_u32(r, "whitespaceInTitle", !!(dvr_flags & DVR_WHITESPACE_IN_TITLE));
htsmsg_add_u32(r, "titleDirs", !!(dvr_flags & DVR_DIR_PER_TITLE));
htsmsg_add_u32(r, "episodeInTitle", !!(dvr_flags & DVR_EPISODE_IN_TITLE));
+ htsmsg_add_u32(r, "cleanTitle", !!(dvr_flags & DVR_CLEAN_TITLE));
out = json_single_record(r, "dvrSettings");
flags |= DVR_DIR_PER_CHANNEL;
if(http_arg_get(&hc->hc_req_args, "channelInTitle") != NULL)
flags |= DVR_CHANNEL_IN_TITLE;
+ if(http_arg_get(&hc->hc_req_args, "cleanTitle") != NULL)
+ flags |= DVR_CLEAN_TITLE;
if(http_arg_get(&hc->hc_req_args, "dateInTitle") != NULL)
flags |= DVR_DATE_IN_TITLE;
if(http_arg_get(&hc->hc_req_args, "timeInTitle") != NULL)
'channelDirs','channelInTitle',
'dateInTitle','timeInTitle',
'preExtraTime', 'postExtraTime', 'whitespaceInTitle',
- 'titleDirs', 'episodeInTitle']);
+ 'titleDirs', 'episodeInTitle','cleanTitle']);
var confpanel = new Ext.FormPanel({
title:'Digital Video Recorder',
}), new Ext.form.Checkbox({
fieldLabel: 'Include channel name in filename',
name: 'channelInTitle'
+ }), new Ext.form.Checkbox({
+ fieldLabel: 'Remove all unsafe characters from filename',
+ name: 'cleanTitle'
}), new Ext.form.Checkbox({
fieldLabel: 'Include date in filename',
name: 'dateInTitle'