aboutsummaryrefslogtreecommitdiffstats
path: root/src/playlist_vector.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/playlist_vector.c')
-rw-r--r--src/playlist_vector.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/playlist_vector.c b/src/playlist_vector.c
index 80b70a96c..7c1765a98 100644
--- a/src/playlist_vector.c
+++ b/src/playlist_vector.c
@@ -93,16 +93,21 @@ playlist_vector_add(struct playlist_vector *pv,
pv->head = pm;
}
-void
+bool
playlist_vector_update_or_add(struct playlist_vector *pv,
const char *name, time_t mtime)
{
struct playlist_metadata **pmp = playlist_vector_find_p(pv, name);
if (pmp != NULL) {
struct playlist_metadata *pm = *pmp;
+ if (mtime == pm->mtime)
+ return false;
+
pm->mtime = mtime;
} else
playlist_vector_add(pv, name, mtime);
+
+ return true;
}
bool