From a46e39c5bc58d77a376652fe7f85f9c5b3b8e67b Mon Sep 17 00:00:00 2001 From: Alexey Yakovenko Date: Thu, 12 Jun 2014 22:08:19 +0200 Subject: pl_save_all won't save unmodified playlists --- playlist.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'playlist.c') diff --git a/playlist.c b/playlist.c index ff9e8435..7a3bf5a0 100644 --- a/playlist.c +++ b/playlist.c @@ -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) { -- cgit v1.2.3