[scan] Changes to commit 9a3cb3b7

* 'split_genre' -> 'only_first_genre' + changed description
* fix memleak on multiple genre tags
This commit is contained in:
ejurgensen
2022-12-29 20:04:43 +01:00
parent 0c43de9735
commit af07f9eeb4
3 changed files with 10 additions and 7 deletions

View File

@@ -118,7 +118,7 @@ static cfg_opt_t sec_library[] =
CFG_BOOL("allow_modifying_stored_playlists", cfg_false, CFGF_NONE),
CFG_STR("default_playlist_directory", NULL, CFGF_NONE),
CFG_BOOL("clear_queue_on_stop_disable", cfg_false, CFGF_NONE),
CFG_BOOL("split_genre", cfg_false, CFGF_NONE),
CFG_BOOL("only_first_genre", cfg_false, CFGF_NONE),
CFG_END()
};

View File

@@ -62,9 +62,12 @@ parse_genre(struct media_file_info *mfi, char *genre_string)
char **genre = (char**)((char *) mfi + mfi_offsetof(genre));
char *ptr;
if (*genre) // Previous genre tag exists
return 0;
*genre = strdup(genre_string);
if (cfg_getbool(cfg_getsec(cfg, "library"), "split_genre"))
if (cfg_getbool(cfg_getsec(cfg, "library"), "only_first_genre"))
{
ptr = strchr(*genre, ';');
if (ptr)