mirror of
https://github.com/clangen/musikcube.git
synced 2025-03-29 19:20:28 +00:00
Allow for playlists to be created through ISimpleDataProvider with an
empty tracklist.
This commit is contained in:
parent
0fcd05dc2c
commit
acd5a94c10
@ -65,7 +65,9 @@ TrackList::TrackList(TrackList* other)
|
||||
|
||||
TrackList::TrackList(ILibraryPtr library, int64_t trackIds[], size_t trackIdCount)
|
||||
: library(library) {
|
||||
this->ids.insert(this->ids.end(), &trackIds[0], &trackIds[trackIdCount]);
|
||||
if (trackIdCount > 0) {
|
||||
this->ids.insert(this->ids.end(), &trackIds[0], &trackIds[trackIdCount]);
|
||||
}
|
||||
}
|
||||
|
||||
TrackList::~TrackList() {
|
||||
|
@ -792,7 +792,10 @@ void WebSocketServer::RespondWithSavePlaylist(connection_hdl connection, json& r
|
||||
|
||||
size_t count = ids.size();
|
||||
int64_t* idArray = new int64_t[count];
|
||||
std::copy(ids.begin(), ids.end(), idArray);
|
||||
|
||||
if (count > 0) {
|
||||
std::copy(ids.begin(), ids.end(), idArray);
|
||||
}
|
||||
|
||||
uint64_t newPlaylistId = this->context.dataProvider
|
||||
->SavePlaylist(idArray, count, name.c_str(), id);
|
||||
|
Loading…
x
Reference in New Issue
Block a user