fix adding selected items to playlist

This commit is contained in:
Andrzej Rybczak
2009-01-19 15:50:04 +01:00
parent 3adf0a396b
commit bf52375fb5
2 changed files with 16 additions and 9 deletions

View File

@@ -486,7 +486,7 @@ int Connection::AddSong(const string &path)
int Connection::AddSong(const Song &s)
{
return !s.Empty() ? (s.IsFromDB() ? (AddSong(s.Localized() ? locale_to_utf_cpy(s.GetFile()) : s.GetFile())) : AddSong("file://" + (s.Localized() ? locale_to_utf_cpy(s.GetFile()) : s.GetFile()))) : -1;
return !s.Empty() ? (AddSong((!s.IsFromDB() ? "file://" : "") + (s.Localized() ? locale_to_utf_cpy(s.GetFile()) : s.GetFile()))) : -1;
}
void Connection::QueueAddSong(const string &path)
@@ -503,7 +503,7 @@ void Connection::QueueAddSong(const string &path)
void Connection::QueueAddSong(const Song &s)
{
if (!s.Empty())
QueueAddSong(s.Localized() ? locale_to_utf_cpy(s.GetFile()) : s.GetFile());
QueueAddSong((!s.IsFromDB() ? "file://" : "") + (s.Localized() ? locale_to_utf_cpy(s.GetFile()) : s.GetFile()));
}
void Connection::QueueAddToPlaylist(const string &playlist, const string &path)
@@ -521,7 +521,7 @@ void Connection::QueueAddToPlaylist(const string &playlist, const string &path)
void Connection::QueueAddToPlaylist(const string &playlist, const Song &s)
{
if (!s.Empty())
QueueAddToPlaylist(playlist, s.GetFile());
QueueAddToPlaylist(playlist, s.Localized() ? locale_to_utf_cpy(s.GetFile()) : s.GetFile());
}
void Connection::QueueDeleteSong(int id)