aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQball Cow <qball@qballcow.nl>2007-08-20 14:58:58 +0000
committerQball Cow <qball@qballcow.nl>2007-08-20 14:58:58 +0000
commite2370c56599d46fd5458d2cf676ed948d23ff0e6 (patch)
tree32f1c30108ca46efd03d61ac1afd2b72d75aa0da
parentcfa55bc43dd805a3157a96550e8f15da16c3587a (diff)
downloadmpd-e2370c56599d46fd5458d2cf676ed948d23ff0e6.tar.gz
mpd-e2370c56599d46fd5458d2cf676ed948d23ff0e6.tar.xz
mpd-e2370c56599d46fd5458d2cf676ed948d23ff0e6.zip
storedplaylist is now the last stored mtime
git-svn-id: https://svn.musicpd.org/mpd/branches/q-mpd@6777 09075e82-0dd4-0310-85a5-a0d7c8717e4f
-rw-r--r--src/storedPlaylist.c17
1 files 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 <time.h>
#include <string.h>
#include <errno.h>
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;
}