aboutsummaryrefslogtreecommitdiffstats
path: root/src/playlist.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-14 11:10:47 +0200
committerMax Kellermann <max@duempel.org>2008-10-14 11:10:47 +0200
commita52a9fc1fc2b385dd66edd45f602ac337399cc83 (patch)
tree68ffeb4b6a2c689519ea38ca87782f935eb7b29d /src/playlist.c
parent308bc230b241757088668d65aafcea4575a52e9c (diff)
downloadmpd-a52a9fc1fc2b385dd66edd45f602ac337399cc83.tar.gz
mpd-a52a9fc1fc2b385dd66edd45f602ac337399cc83.tar.xz
mpd-a52a9fc1fc2b385dd66edd45f602ac337399cc83.zip
playlist: moved code to playlist_save.c
playlist_print_song() and playlist_print_uri() handle charset conversion and (optional) music directory prefixing.
Diffstat (limited to '')
-rw-r--r--src/playlist.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/playlist.c b/src/playlist.c
index 34a2311aa..65e7d6391 100644
--- a/src/playlist.c
+++ b/src/playlist.c
@@ -17,6 +17,7 @@
*/
#include "playlist.h"
+#include "playlist_save.h"
#include "player_control.h"
#include "command.h"
#include "ls.h"
@@ -1212,18 +1213,8 @@ enum playlist_result savePlaylist(const char *utf8file)
if (fp == NULL)
return PLAYLIST_RESULT_ERRNO;
- for (i = 0; i < playlist.length; i++) {
- char tmp[MPD_PATH_MAX];
-
- song_get_url(playlist.songs[i], path_max_tmp);
- utf8_to_fs_charset(tmp, path_max_tmp);
-
- if (playlist_saveAbsolutePaths &&
- song_is_file(playlist.songs[i]))
- fprintf(fp, "%s\n", rmp2amp_r(tmp, tmp));
- else
- fprintf(fp, "%s\n", tmp);
- }
+ for (i = 0; i < playlist.length; i++)
+ playlist_print_song(fp, playlist.songs[i]);
while (fclose(fp) && errno == EINTR) ;