Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
VideoLAN
medialibrary
Commits
10a5e9ec
Commit
10a5e9ec
authored
Oct 29, 2015
by
Hugo Beauzée-Luyssen
Browse files
Artist: Fix albums fetching
parent
36991378
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Artist.cpp
View file @
10a5e9ec
...
...
@@ -85,9 +85,8 @@ std::vector<AlbumPtr> Artist::albums() const
{
if
(
m_id
==
0
)
return
{};
static
const
std
::
string
req
=
"SELECT alb.* FROM "
+
policy
::
AlbumTable
::
Name
+
" alb "
"LEFT JOIN AlbumArtistRelation aar ON aar.id_album = alb.id_album "
"WHERE aar.id_artist = ? ORDER BY alb.title"
;
static
const
std
::
string
req
=
"SELECT * FROM "
+
policy
::
AlbumTable
::
Name
+
" alb "
"WHERE artist_id = ? ORDER BY title"
;
return
Album
::
fetchAll
(
m_dbConnection
,
req
,
m_id
);
}
...
...
test/ArtistTests.cpp
View file @
10a5e9ec
...
...
@@ -88,8 +88,8 @@ TEST_F( Artists, Albums )
ASSERT_NE
(
album1
,
nullptr
);
ASSERT_NE
(
album2
,
nullptr
);
album1
->
add
Artist
(
artist
);
album2
->
add
Artist
(
artist
);
album1
->
setAlbum
Artist
(
artist
.
get
()
);
album2
->
setAlbum
Artist
(
artist
.
get
()
);
auto
albums
=
artist
->
albums
();
ASSERT_EQ
(
albums
.
size
(),
2u
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment