diff options
author | Max Kellermann <max@duempel.org> | 2009-02-28 14:02:03 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2009-02-28 14:02:03 +0100 |
commit | 83b1b0ff69e03cbb472c6cfaaf87f782bb9d9a91 (patch) | |
tree | a30ee76e95d12ae2857709b3faa83340e98dc4ed /src | |
parent | 2aebbf84606fa6fa5a014ac288eef9bc5d63402e (diff) | |
download | mpd-83b1b0ff69e03cbb472c6cfaaf87f782bb9d9a91.tar.gz mpd-83b1b0ff69e03cbb472c6cfaaf87f782bb9d9a91.tar.xz mpd-83b1b0ff69e03cbb472c6cfaaf87f782bb9d9a91.zip |
update: don't update unchanged archive
When the mtime of an archive time hasn't changed, don't update it
again.
Diffstat (limited to '')
-rw-r--r-- | src/update.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/update.c b/src/update.c index 78929f7d2..5cb02cb4e 100644 --- a/src/update.c +++ b/src/update.c @@ -373,6 +373,12 @@ update_archive_file(struct directory *parent, const char *name, struct directory *directory; char *filepath; + directory = dirvec_find(&parent->children, name); + if (directory != NULL && directory->mtime == st->st_mtime) + /* MPD has already scanned the archive, and it hasn't + changed since - don't consider updating it */ + return; + path_fs = map_directory_child_fs(parent, name); /* open archive */ @@ -386,7 +392,6 @@ update_archive_file(struct directory *parent, const char *name, g_debug("archive %s opened", path_fs); g_free(path_fs); - directory = dirvec_find(&parent->children, name); if (directory == NULL) { g_debug("creating archive directory: %s", name); directory = make_subdir(parent, name); |