aboutsummaryrefslogtreecommitdiffstats
path: root/src/playlist.c
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2008-10-06 18:52:13 +0200
committerMax Kellermann <max@duempel.org>2008-10-06 18:52:13 +0200
commitf1c53fe0eda77bf126d837c0fb93ffcfb1fc9aea (patch)
tree47a2c85685dbf09cc4c1f44f66f8afd11c0daa84 /src/playlist.c
parent22e40b61cc0166dcda15b7146724928368201b07 (diff)
downloadmpd-f1c53fe0eda77bf126d837c0fb93ffcfb1fc9aea.tar.gz
mpd-f1c53fe0eda77bf126d837c0fb93ffcfb1fc9aea.tar.xz
mpd-f1c53fe0eda77bf126d837c0fb93ffcfb1fc9aea.zip
song: stop storing song_type
We already know if a song is a URL or not based on whether it has parentDir defined or not. Hopefully one day in the future we can drop HTTP support from MPD entirely when an HTTP filesystem comes along and we can access streams via open(2).
Diffstat (limited to 'src/playlist.c')
-rw-r--r--src/playlist.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/playlist.c b/src/playlist.c
index e735d7731..b6329cfde 100644
--- a/src/playlist.c
+++ b/src/playlist.c
@@ -174,7 +174,7 @@ void finishPlaylist(void)
{
int i;
for (i = 0; i < playlist.length; i++) {
- if (playlist.songs[i]->type == SONG_TYPE_URL) {
+ if (!song_is_file(playlist.songs[i])) {
freeJustSong(playlist.songs[i]);
}
}
@@ -200,7 +200,7 @@ void clearPlaylist(void)
stopPlaylist();
for (i = 0; i < playlist.length; i++) {
- if (playlist.songs[i]->type == SONG_TYPE_URL) {
+ if (!song_is_file(playlist.songs[i])) {
freeJustSong(playlist.songs[i]);
}
playlist.idToPosition[playlist.positionToId[i]] = -1;
@@ -560,7 +560,7 @@ enum playlist_result addToPlaylist(const char *url, int *added_id)
if ((song = getSongFromDB(url))) {
} else if (!(isValidRemoteUtf8Url(url) &&
- (song = newSong(url, SONG_TYPE_URL, NULL)))) {
+ (song = newSong(url, NULL)))) {
return PLAYLIST_RESULT_NO_SUCH_SONG;
}
@@ -580,7 +580,7 @@ int addToStoredPlaylist(const char *url, const char *utf8file)
if (!isValidRemoteUtf8Url(url))
return ACK_ERROR_NO_EXIST;
- song = newSong(url, SONG_TYPE_URL, NULL);
+ song = newSong(url, NULL);
if (song) {
int ret = appendSongToStoredPlaylistByPath(utf8file, song);
freeJustSong(song);
@@ -715,7 +715,7 @@ enum playlist_result deleteFromPlaylist(int song)
clearPlayerQueue();
}
- if (playlist.songs[song]->type == SONG_TYPE_URL) {
+ if (!song_is_file(playlist.songs[song])) {
freeJustSong(playlist.songs[song]);
}
@@ -891,7 +891,7 @@ static void syncCurrentPlayerDecodeMetadata(void)
songNum = playlist.order[playlist.current];
song = playlist.songs[songNum];
- if (song->type == SONG_TYPE_URL &&
+ if (!song_is_file(song) &&
0 == strcmp(get_song_url(path_max_tmp, song), songPlayer->url) &&
!tag_equal(song->tag, songPlayer->tag)) {
if (song->tag)
@@ -1267,7 +1267,7 @@ enum playlist_result savePlaylist(const char *utf8file)
utf8_to_fs_charset(tmp, path_max_tmp);
if (playlist_saveAbsolutePaths &&
- playlist.songs[i]->type == SONG_TYPE_FILE)
+ song_is_file(playlist.songs[i]))
fprintf(fp, "%s\n", rmp2amp_r(tmp, tmp));
else
fprintf(fp, "%s\n", tmp);