mirror of
https://github.com/owntone/owntone-server.git
synced 2025-03-29 08:43:42 -04:00
Allow empty playlists
This commit is contained in:
parent
9727812201
commit
d9d0acd412
@ -897,8 +897,10 @@ DAAP_BLOCK *daap_response_playlist_items(unsigned int playlist, char* metaStr, c
|
|||||||
henum=db_playlist_items_enum_begin(playlist);
|
henum=db_playlist_items_enum_begin(playlist);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* we can allow an empty playlist...
|
||||||
if(!henum)
|
if(!henum)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
*/
|
||||||
|
|
||||||
root=daap_add_empty(NULL,"apso");
|
root=daap_add_empty(NULL,"apso");
|
||||||
if(root) {
|
if(root) {
|
||||||
|
@ -923,8 +923,14 @@ ENUMHANDLE db_playlist_items_enum_begin(int playlistid) {
|
|||||||
* Walk to the next entry
|
* Walk to the next entry
|
||||||
*/
|
*/
|
||||||
MP3FILE *db_enum(ENUMHANDLE *current) {
|
MP3FILE *db_enum(ENUMHANDLE *current) {
|
||||||
MP3HELPER* helper = *(MP3HELPER**) current;
|
MP3HELPER* helper;
|
||||||
MP3RECORD* record = helper->next;
|
MP3RECORD* record;
|
||||||
|
|
||||||
|
if(!current)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
helper = *(MP3HELPER**) current;
|
||||||
|
record = helper->next;
|
||||||
|
|
||||||
if(helper->next == 0)
|
if(helper->next == 0)
|
||||||
return 0;
|
return 0;
|
||||||
@ -963,9 +969,14 @@ int db_playlist_enum(ENUMHANDLE* handle) {
|
|||||||
* walk to the next entry
|
* walk to the next entry
|
||||||
*/
|
*/
|
||||||
int db_playlist_items_enum(ENUMHANDLE* handle) {
|
int db_playlist_items_enum(ENUMHANDLE* handle) {
|
||||||
DB_PLAYLISTENTRY **current = (DB_PLAYLISTENTRY**) handle;
|
DB_PLAYLISTENTRY **current;
|
||||||
int retval;
|
int retval;
|
||||||
|
|
||||||
|
if(!handle)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
current = (DB_PLAYLISTENTRY**) handle;
|
||||||
|
|
||||||
if(*current) {
|
if(*current) {
|
||||||
retval = (*current)->id;
|
retval = (*current)->id;
|
||||||
*current=(*current)->next;
|
*current=(*current)->next;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user