Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Issue 1625 - Option for remove unsafe characters from filename while …
…keeping Umlaute and other national characters
  • Loading branch information
dgolda authored and perexg committed Jan 8, 2015
1 parent 6f18074 commit f8de301
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/dvr/dvr.h
Expand Up @@ -64,6 +64,7 @@ typedef struct dvr_config {
int dvr_subtitle_in_title;
int dvr_episode_before_date;
int dvr_episode_duplicate;
int dvr_clean_samba_unsafe;

/* Series link support */
int dvr_sl_brand_lock;
Expand Down
7 changes: 7 additions & 0 deletions src/dvr/dvr_config.c
Expand Up @@ -727,6 +727,13 @@ const idclass_t dvr_config_class = {
.off = offsetof(dvr_config_t, dvr_whitespace_in_title),
.group = 5,
},
{
.type = PT_BOOL,
.id = "clean-samba-unsafe",
.name = "Replace Samba Unsafe Characters with '_'",
.off = offsetof(dvr_config_t, dvr_clean_samba_unsafe),
.group = 5,
},
{}
},
};
Expand Down
3 changes: 3 additions & 0 deletions src/dvr/dvr_rec.c
Expand Up @@ -164,6 +164,9 @@ cleanup_filename(char *s, dvr_config_t *cfg)
((s[i] < 32) || (s[i] > 122) ||
(strchr("/:\\<>|*?'\"", s[i]) != NULL)))
s[i] = '_';
else if(cfg->dvr_clean_samba_unsafe &&
(strchr("/:\\<>|*?'\"", s[i]) != NULL))
s[i] = '_';
}

return s;
Expand Down

0 comments on commit f8de301

Please sign in to comment.