summaryrefslogtreecommitdiff
path: root/playlist.c
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2011-01-24 22:12:09 +0100
committerGravatar waker <wakeroid@gmail.com>2011-01-24 22:12:09 +0100
commita94e74a41bca74b9cff70ef45eb69a1ecf6dd2ba (patch)
tree23343c0e2b04e2e6fbd49677628206e77c4ea278 /playlist.c
parent7f874f0e16d9b527869a0695fbaa6d78482c73d0 (diff)
pl_delete_all_meta doesn't delete properties (starting with ':') anymore
Diffstat (limited to 'playlist.c')
-rw-r--r--playlist.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/playlist.c b/playlist.c
index 2205c0ef..f843aba8 100644
--- a/playlist.c
+++ b/playlist.c
@@ -2468,14 +2468,26 @@ pl_reshuffle (playItem_t **ppmin, playItem_t **ppmax) {
void
pl_delete_all_meta (playItem_t *it) {
LOCK;
- while (it->meta) {
- DB_metaInfo_t *m = it->meta;
- it->meta = m->next;
- metacache_remove_string (m->key);
- metacache_remove_string (m->value);
- free (m);
- }
- it->meta = NULL;
+ DB_metaInfo_t *m = it->meta;
+ DB_metaInfo_t *prev = NULL;
+ while (m) {
+ DB_metaInfo_t *next = m->next;
+ if (m->key[0] == ':') {
+ prev = m;
+ }
+ else {
+ if (prev) {
+ prev->next = next;
+ }
+ else {
+ it->meta = next;
+ }
+ metacache_remove_string (m->key);
+ metacache_remove_string (m->value);
+ free (m);
+ }
+ m = next;
+ }
UNLOCK;
}