Commit 4d3d091c authored by Jochen Keil's avatar Jochen Keil Committed by Max Kellermann

Fix remove-flac-song-on-every-update

Until now every flac file got removed unconditionally (and then re-added) whenever the update command was issued. Now there is a check if we need to that, so the file will only be removed if there is a embedded cuesheet in that file
parent 706112bb
...@@ -447,13 +447,6 @@ update_regular_file(struct directory *directory, ...@@ -447,13 +447,6 @@ update_regular_file(struct directory *directory,
const char* pathname = map_directory_child_fs(directory, name); const char* pathname = map_directory_child_fs(directory, name);
struct directory* contdir = dirvec_find(&directory->children, name); struct directory* contdir = dirvec_find(&directory->children, name);
// is there already a song for this file?
if (song != NULL)
{
delete_song(directory, song);
song = NULL;
}
// directory exists already // directory exists already
if (contdir != NULL) if (contdir != NULL)
{ {
...@@ -471,6 +464,13 @@ update_regular_file(struct directory *directory, ...@@ -471,6 +464,13 @@ update_regular_file(struct directory *directory,
// contdir doesn't yet exist // contdir doesn't yet exist
if (contdir == NULL) if (contdir == NULL)
{ {
// is there already a song for this file?
if (song != NULL && (plugin->container_scan(pathname, 1) != NULL))
{
delete_song(directory, song);
song = NULL;
}
// reset flag if there are no vtracks // reset flag if there are no vtracks
no_container = true; no_container = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment