From e2370c56599d46fd5458d2cf676ed948d23ff0e6 Mon Sep 17 00:00:00 2001 From: Qball Cow Date: Mon, 20 Aug 2007 14:58:58 +0000 Subject: storedplaylist is now the last stored mtime git-svn-id: https://svn.musicpd.org/mpd/branches/q-mpd@6777 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/storedPlaylist.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/storedPlaylist.c b/src/storedPlaylist.c index 0f1160aa0..eae4a6fd9 100644 --- a/src/storedPlaylist.c +++ b/src/storedPlaylist.c @@ -25,16 +25,13 @@ #include "command.h" #include "ls.h" #include "directory.h" - +#include #include #include static mpd_uint32 storedplaylistversion =0; static void incrStoredPlaylistVersion(void) { - static unsigned long max = ((mpd_uint32) 1 << 31) - 1; - storedplaylistversion++; - if (storedplaylistversion >= max) - storedplaylistversion = 1; + storedplaylistversion= time(NULL); } unsigned long getStoredPlaylistVersion(void) @@ -311,9 +308,6 @@ static int moveSongInStoredPlaylist(int fd, StoredPlaylist *sp, int src, int des destNode->nextNode = srcNode; } } - /* Increase stored playlist version id*/ - DEBUG("move stored playlist\n"); - incrStoredPlaylistVersion(); return 0; } @@ -339,10 +333,6 @@ int moveSongInStoredPlaylistByPath(int fd, const char *utf8path, int src, int de freeStoredPlaylist(sp); - /* Increase stored playlist version id*/ - DEBUG("Move stored playlist\n"); - incrStoredPlaylistVersion(); - return 0; } @@ -413,8 +403,6 @@ int removeOneSongFromStoredPlaylistByPath(int fd, const char *utf8path, int pos) freeStoredPlaylist(sp); - /* Increase stored playlist version id*/ - incrStoredPlaylistVersion(); return 0; } @@ -446,6 +434,7 @@ static int writeStoredPlaylistToPath(StoredPlaylist *sp, const char *fspath) } while (fclose(file) != 0 && errno == EINTR); + incrStoredPlaylistVersion(); return 0; } -- cgit v1.2.3