Index: src/dvr/dvr.h =================================================================== --- src/dvr/dvr.h (revision 4940) +++ src/dvr/dvr.h (working copy) @@ -43,6 +43,7 @@ #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, Index: src/dvr/dvr_db.c =================================================================== --- src/dvr/dvr_db.c (revision 4940) +++ src/dvr/dvr_db.c (working copy) @@ -154,6 +154,7 @@ { struct tm tm; char buf[40]; + int i; if(dvr_flags & DVR_CHANNEL_IN_TITLE) snprintf(output, outlen, "%s-", de->de_channel->ch_name); @@ -187,6 +188,19 @@ ".E%02d", de->de_episode.ee_episode); } + + if(dvr_flags & DVR_CLEAN_TITLE) { + for (i=0;i122 || + output[i]==34 || + output[i]==39 || + output[i]==92 || + output[i]==58 + ) output[i]='_'; + } + } } Index: src/webui/static/app/dvr.js =================================================================== --- src/webui/static/app/dvr.js (revision 4940) +++ src/webui/static/app/dvr.js (working copy) @@ -564,7 +564,7 @@ 'channelDirs','channelInTitle', 'dateInTitle','timeInTitle', 'preExtraTime', 'postExtraTime', 'whitespaceInTitle', - 'titleDirs', 'episodeInTitle']); + 'titleDirs', 'episodeInTitle','cleanTitle']); var confpanel = new Ext.FormPanel({ title:'Digital Video Recorder', @@ -609,6 +609,9 @@ 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' }), new Ext.form.Checkbox({ Index: src/webui/extjs.c =================================================================== --- src/webui/extjs.c (revision 4940) +++ src/webui/extjs.c (working copy) @@ -821,6 +821,7 @@ 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"); @@ -847,6 +848,8 @@ 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)