aboutsummaryrefslogtreecommitdiffstats
path: root/src/update.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/update.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/update.c b/src/update.c
index e07a32aff..52c87bbfd 100644
--- a/src/update.c
+++ b/src/update.c
@@ -123,6 +123,23 @@ delete_directory(struct directory *directory)
directory_free(directory);
}
+static void
+delete_name_in(struct directory *parent, const char *name)
+{
+ struct directory *directory = directory_get_child(parent, name);
+ struct song *song = songvec_find(&parent->songs, name);
+
+ if (directory != NULL) {
+ delete_directory(directory);
+ modified = true;
+ }
+
+ if (song != NULL) {
+ delete_song(parent, song);
+ modified = true;
+ }
+}
+
struct delete_data {
char *tmp;
struct directory *dir;
@@ -306,7 +323,7 @@ updateDirectory(struct directory *directory, const struct stat *st)
if (myStat(path_max_tmp, &st2) == 0)
updateInDirectory(directory, path_max_tmp, &st2);
else
- delete_path(path_max_tmp);
+ delete_name_in(directory, mpd_basename(path_max_tmp));
}
closedir(dir);