Index: src/dvr/dvr.h =================================================================== --- src/dvr/dvr.h (revision 4302) +++ src/dvr/dvr.h (working copy) @@ -34,11 +34,12 @@ extern int dvr_extra_time_post; extern struct dvr_entry_list dvrentries; -#define DVR_DIR_PER_DAY 0x1 -#define DVR_DIR_PER_CHANNEL 0x2 -#define DVR_CHANNEL_IN_TITLE 0x4 -#define DVR_DATE_IN_TITLE 0x8 -#define DVR_TIME_IN_TITLE 0x10 +#define DVR_DIR_PER_DAY 0x1 +#define DVR_DIR_PER_CHANNEL 0x2 +#define DVR_CHANNEL_IN_TITLE 0x4 +#define DVR_DATE_IN_TITLE 0x8 +#define DVR_TIME_IN_TITLE 0x10 +#define DVR_WHITESPACE_IN_TITLE 0x20 LIST_HEAD(dvr_rec_stream_list, dvr_rec_stream); Index: src/dvr/dvr_db.c =================================================================== --- src/dvr/dvr_db.c (revision 4302) +++ src/dvr/dvr_db.c (working copy) @@ -557,7 +557,10 @@ if(!htsmsg_get_u32(m, "time-in-title", &u32) && u32) dvr_flags |= DVR_TIME_IN_TITLE; - + + if(!htsmsg_get_u32(m, "whitespace-in-title", &u32) && u32) + dvr_flags |= DVR_WHITESPACE_IN_TITLE; + tvh_str_set(&dvr_postproc, htsmsg_get_str(m, "postproc")); htsmsg_destroy(m); @@ -608,6 +611,7 @@ htsmsg_add_u32(m, "channel-in-title", !!(dvr_flags & DVR_CHANNEL_IN_TITLE)); htsmsg_add_u32(m, "date-in-title", !!(dvr_flags & DVR_DATE_IN_TITLE)); htsmsg_add_u32(m, "time-in-title", !!(dvr_flags & DVR_TIME_IN_TITLE)); + htsmsg_add_u32(m, "whitespace-in-title", !!(dvr_flags & DVR_WHITESPACE_IN_TITLE)); if(dvr_postproc != NULL) htsmsg_add_str(m, "postproc", dvr_postproc); Index: src/dvr/dvr_rec.c =================================================================== --- src/dvr/dvr_rec.c (revision 4302) +++ src/dvr/dvr_rec.c (working copy) @@ -145,10 +145,14 @@ cleanupfilename(char *s) { int i, len = strlen(s); - for(i = 0; i < len; i++) + for(i = 0; i < len; i++){ if(s[i] == '/' || s[i] == ':' || s[i] == '\\' || s[i] == '<' || s[i] == '>' || s[i] == '|' || s[i] == '*' || s[i] == '?') s[i] = '-'; + + if((dvr_flags & DVR_WHITESPACE_IN_TITLE) && s[i] == ' ') + s[i] = '-'; + } } /** Index: src/webui/static/app/dvr.js =================================================================== --- src/webui/static/app/dvr.js (revision 4302) +++ src/webui/static/app/dvr.js (working copy) @@ -456,7 +456,7 @@ }, ['storage','postproc','retention','dayDirs', 'channelDirs','channelInTitle', 'dateInTitle','timeInTitle', - 'preExtraTime', 'postExtraTime']); + 'preExtraTime', 'postExtraTime', 'whitespaceInTitle']); var confpanel = new Ext.FormPanel({ title:'Digital Video Recorder', @@ -503,6 +503,9 @@ }), new Ext.form.Checkbox({ fieldLabel: 'Include time in title', name: 'timeInTitle' + }), new Ext.form.Checkbox({ + fieldLabel: 'Replace whitespace in title with \'-\'', + name: 'whitespaceInTitle' }), { width: 300, fieldLabel: 'Post-processor command', Index: src/webui/extjs.c =================================================================== --- src/webui/extjs.c (revision 4302) +++ src/webui/extjs.c (working copy) @@ -807,6 +807,7 @@ htsmsg_add_u32(r, "channelInTitle", !!(dvr_flags & DVR_CHANNEL_IN_TITLE)); htsmsg_add_u32(r, "dateInTitle", !!(dvr_flags & DVR_DATE_IN_TITLE)); htsmsg_add_u32(r, "timeInTitle", !!(dvr_flags & DVR_TIME_IN_TITLE)); + htsmsg_add_u32(r, "whitespaceInTitle", !!(dvr_flags & DVR_WHITESPACE_IN_TITLE)); out = json_single_record(r, "dvrSettings"); @@ -837,6 +838,8 @@ flags |= DVR_DATE_IN_TITLE; if(http_arg_get(&hc->hc_req_args, "timeInTitle") != NULL) flags |= DVR_TIME_IN_TITLE; + if(http_arg_get(&hc->hc_req_args, "whitespaceInTitle") != NULL) + flags |= DVR_WHITESPACE_IN_TITLE; dvr_flags_set(flags);