dvr: remove duplicate clean title code, use '_' for the unknown chars
This commit is contained in:
parent
eddc6ea844
commit
04d684687c
2 changed files with 2 additions and 16 deletions
|
@ -188,7 +188,6 @@ dvr_make_title(char *output, size_t outlen, dvr_entry_t *de)
|
|||
{
|
||||
struct tm tm;
|
||||
char buf[40];
|
||||
int i;
|
||||
dvr_config_t *cfg = dvr_config_find_by_name_default(de->de_config_name);
|
||||
|
||||
if(cfg->dvr_flags & DVR_CHANNEL_IN_TITLE)
|
||||
|
@ -236,19 +235,6 @@ dvr_make_title(char *output, size_t outlen, dvr_entry_t *de)
|
|||
".", "S%02d", NULL, "E%02d", NULL);
|
||||
}
|
||||
}
|
||||
|
||||
if(cfg->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]='_';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -141,7 +141,7 @@ cleanup_filename(char *s, dvr_config_t *cfg)
|
|||
|
||||
/* Do not create hidden files */
|
||||
if (s[0] == '.')
|
||||
s[0] = '-';
|
||||
s[0] = '_';
|
||||
|
||||
for (i = 0, len = strlen(s); i < len; i++) {
|
||||
|
||||
|
@ -155,7 +155,7 @@ cleanup_filename(char *s, dvr_config_t *cfg)
|
|||
else if((dvr_flags & DVR_CLEAN_TITLE) &&
|
||||
((s[i] < 32) || (s[i] > 122) ||
|
||||
(strchr("/:\\<>|*?'\"", s[i]) != NULL)))
|
||||
s[i] = '-';
|
||||
s[i] = '_';
|
||||
}
|
||||
|
||||
return s;
|
||||
|
|
Loading…
Add table
Reference in a new issue