int dvr_skip_commercials;
int dvr_subtitle_in_title;
int dvr_windows_compatible_filenames;
+ char *dvr_format_tvmovies_subdir;
+ char *dvr_format_tvshows_subdir;
struct dvr_entry_list dvr_entries;
struct dvr_autorec_entry_list dvr_autorec_entries;
free(cfg->dvr_preproc);
free(cfg->dvr_postproc);
free(cfg->dvr_postremove);
+ free(cfg->dvr_format_tvmovies_subdir);
+ free(cfg->dvr_format_tvshows_subdir);
free(cfg);
}
.opts = PO_ADVANCED,
.group = 6,
},
+ {
+ .type = PT_STR,
+ .id = "format-tvmovies-subdir",
+ .name = N_("Subdirectory for tvmovies for $q format specifier"),
+ .desc = N_("Subdirectory to use for tvmovies when using the $q specifier. "
+ "Default value is \"tvmovies\". "
+ "This can contain any alphanumeric "
+ "characters (A-Za-z0-9). Other characters may be supported depending "
+ "on your OS and filesystem."
+ ),
+ .off = offsetof(dvr_config_t, dvr_format_tvmovies_subdir),
+ .opts = PO_ADVANCED,
+ .group = 6,
+ },
+ {
+ .type = PT_STR,
+ .id = "format-tvshows-subdir",
+ .name = N_("Subdirectory for tvshows for $q format specifier"),
+ .desc = N_("Subdirectory to use for tvshows when using the $q specifier. "
+ "Default value is \"tvshows\". "
+ "This can contain any alphanumeric "
+ "characters (A-Za-z0-9). Other characters may be supported depending "
+ "on your OS and filesystem."
+ ),
+ .off = offsetof(dvr_config_t, dvr_format_tvshows_subdir),
+ .opts = PO_ADVANCED,
+ .group = 6,
+ },
{}
},
};
*/
size_t offset = 0;
+ const dvr_config_t *config = de->de_config;
if (is_movie) {
/* TV movies are probably best saved in one folder rather than
* "title (yyyy)" (without genre_subdir)
* "title" (without genre_subdir, no airdate)
*/
- if (with_genre_subdir) tvh_strlcatf(tmp, tmplen, offset, "tvmovies/");
+ if (with_genre_subdir) {
+ const char *subdir = config && config->dvr_format_tvmovies_subdir && *config->dvr_format_tvmovies_subdir ?
+ config->dvr_format_tvmovies_subdir : "tvmovies";
+ tvh_strlcatf(tmp, tmplen, offset, "%s/", subdir);
+ }
+
if (*title_buf) tvh_strlcatf(tmp, tmplen, offset, "%s", title_buf);
/* Movies don't have anything relevant in sub-titles field so
* anything there should be ignored. I think some channels store a
* "title - subtitle_2001-05-04" (without genre_subdir, long running show)
* "title - subtitle" (without genre_subdir, no epg info on show)
*/
- if (with_genre_subdir) tvh_strlcatf(tmp, tmplen, offset, "tvshows/");
+ if (with_genre_subdir) {
+ const char *subdir = config && config->dvr_format_tvshows_subdir && *config->dvr_format_tvshows_subdir ?
+ config->dvr_format_tvshows_subdir : "tvshows";
+ tvh_strlcatf(tmp, tmplen, offset, "%s/", subdir);
+ }
if (*title_buf) tvh_strlcatf(tmp, tmplen, offset, "%s/%s", title_buf, title_buf);
if (*episode_buf) tvh_strlcatf(tmp, tmplen, offset, " - %s", episode_buf);
if (*subtitle_buf) tvh_strlcatf(tmp, tmplen, offset, " - %s", subtitle_buf);