song: replaced all song constructors

Provide separate constructors for creating a remote song, a local
song, and one for loading data from a song file.  This way, we can add
more assertions.
This commit is contained in:
Max Kellermann
2008-10-08 11:05:25 +02:00
parent 4a510a2674
commit 5e4be9e495
5 changed files with 49 additions and 28 deletions

View File

@@ -201,7 +201,7 @@ addToDirectory(struct directory *directory, const char *name)
struct song *song;
const char *shortname = mpd_basename(name);
if (!(song = newSong(shortname, directory)))
if (!(song = song_file_load(shortname, directory)))
return -1;
songvec_add(&directory->songs, song);
LOG("added %s\n", name);