]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Issue 1625 - Option for remove unsafe characters from filename while keeping Umlaute...
authorDamian Gołda <Damian.Golda@gmail.com>
Tue, 6 Jan 2015 21:18:59 +0000 (22:18 +0100)
committerJaroslav Kysela <perex@perex.cz>
Thu, 8 Jan 2015 21:22:03 +0000 (22:22 +0100)
src/dvr/dvr.h
src/dvr/dvr_config.c
src/dvr/dvr_rec.c

index 91bd209600396634f7fb21c579611abbd3bec019..346d452dd59a111fd3fa728188af4921f3a689f9 100644 (file)
@@ -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;
index d1d2ccf37fd6b19900a89a5de9d1c3e8d3baae81..eb5199c1fb9dde257e0d0afcf1e120e368749bae 100644 (file)
@@ -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,
+    },
     {}
   },
 };
index 7784e2c324eb5bf274952aa535b13d16775589d5..d028e77d9e4e4846ef1c70d56822659a25f58fed 100644 (file)
@@ -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;