aboutsummaryrefslogtreecommitdiff
path: root/src/update.c
diff options
context:
space:
mode:
authorJochen Keil <jochen.keil@gmail.com>2009-03-09 15:10:54 +0100
committerMax Kellermann <max@duempel.org>2009-03-09 15:15:26 +0100
commit4d3d091c22b03bc70a53a96161778b0ea191a0ae (patch)
treee08fc60a06cc2f400f70123f5f5e77de6b187a82 /src/update.c
parent706112bb885b653d4084fe8bdbbb5bb2ca9c9905 (diff)
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
Diffstat (limited to 'src/update.c')
-rw-r--r--src/update.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/update.c b/src/update.c
index 9f3f6c22..cf033104 100644
--- a/src/update.c
+++ b/src/update.c
@@ -447,13 +447,6 @@ update_regular_file(struct directory *directory,
const char* pathname = map_directory_child_fs(directory, 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
if (contdir != NULL)
{
@@ -471,6 +464,13 @@ update_regular_file(struct directory *directory,
// contdir doesn't yet exist
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
no_container = true;