diff options
author | Alexey Yakovenko <waker@users.sourceforge.net> | 2014-06-12 22:08:19 +0200 |
---|---|---|
committer | Alexey Yakovenko <waker@users.sourceforge.net> | 2014-06-12 22:09:00 +0200 |
commit | a46e39c5bc58d77a376652fe7f85f9c5b3b8e67b (patch) | |
tree | da93ae83f697e02856c4ede4441f9c1ce0ebc25b /playlist.c | |
parent | 9dc48204208b22b998c981da4840951db6daf731 (diff) |
pl_save_all won't save unmodified playlists
Diffstat (limited to 'playlist.c')
-rw-r--r-- | playlist.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -1921,6 +1921,7 @@ pl_crop_selected (void) { int plt_save (playlist_t *plt, playItem_t *first, playItem_t *last, const char *fname, int *pabort, int (*cb)(playItem_t *it, void *data), void *user_data) { LOCK; + plt->last_save_modification_idx = plt->last_save_modification_idx; const char *ext = strrchr (fname, '.'); if (ext) { DB_playlist_t **plug = deadbeef->plug_get_playlist_list (); @@ -2187,6 +2188,9 @@ pl_save_all (void) { err = -1; break; } + if (p->last_save_modification_idx == p->modification_idx) { + continue; + } err = plt_save (p, NULL, NULL, path, NULL, NULL, NULL); if (err < 0) { break; @@ -2542,6 +2546,7 @@ pl_load_all (void) { plt->current_row[PL_MAIN] = deadbeef->conf_get_int (conf, -1); snprintf (conf, sizeof (conf), "playlist.scroll.%d", i); plt->scroll = deadbeef->conf_get_int (conf, 0); + plt->last_save_modification_idx = plt->modification_idx = 0; plt_unref (plt); if (!it) { |