directory: allow directories with just playlists

Keep those when scanning for empty directories.  The check in
playlist_vector_is_empty() was missing.
This commit is contained in:
Max Kellermann 2011-05-09 21:37:43 +02:00
parent 26735390ff
commit 4b4aa64261
3 changed files with 9 additions and 1 deletions

1
NEWS
View File

@ -2,6 +2,7 @@ ver 0.16.3 (2011/??/??)
* fix assertion failure in audio format mask parser
* fix NULL pointer dereference in playlist parser
* fix playlist files in base music directory
* database: allow directories with just playlists
* decoder:
- ffmpeg: support libavcodec 0.7

View File

@ -62,7 +62,8 @@ directory_free(struct directory *directory);
static inline bool
directory_is_empty(const struct directory *directory)
{
return directory->children.nr == 0 && directory->songs.nr == 0;
return directory->children.nr == 0 && directory->songs.nr == 0 &&
playlist_vector_is_empty(&directory->playlists);
}
static inline const char *

View File

@ -51,6 +51,12 @@ playlist_vector_init(struct playlist_vector *pv)
void
playlist_vector_deinit(struct playlist_vector *pv);
static inline bool
playlist_vector_is_empty(const struct playlist_vector *pv)
{
return pv->head == NULL;
}
struct playlist_metadata *
playlist_vector_find(struct playlist_vector *pv, const char *name);