aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSascha Montellese <sascha.montellese@gmail.com>2015-07-28 14:27:05 +0200
committerSascha Montellese <sascha.montellese@gmail.com>2015-07-28 14:27:05 +0200
commitfb75f4c093ae1fcb019b79692f8d00a5e159ad5e (patch)
treede8ab18d84b64196a5eb4540652a5486034cda99
parentc3ab1f905550de32682f04f2c09716b1504d1115 (diff)
parentabd241727674e9937af5b8a0e44dba43335147ef (diff)
Merge pull request #7640 from Montellese/music_dateadded
fix TestDatabaseUtils.GetField_MediaTypeSong unit test
-rw-r--r--xbmc/utils/DatabaseUtils.cpp2
-rw-r--r--xbmc/utils/test/TestDatabaseUtils.cpp7
2 files changed, 2 insertions, 7 deletions
diff --git a/xbmc/utils/DatabaseUtils.cpp b/xbmc/utils/DatabaseUtils.cpp
index bab9ca868c..a672e2c959 100644
--- a/xbmc/utils/DatabaseUtils.cpp
+++ b/xbmc/utils/DatabaseUtils.cpp
@@ -96,7 +96,7 @@ std::string DatabaseUtils::GetField(Field field, const MediaType &mediaType, Dat
else if (field == FieldPath) return "songview.strPath";
else if (field == FieldArtist || field == FieldAlbumArtist) return "songview.strArtists";
else if (field == FieldGenre) return "songview.strGenre";
- else if (field == FieldDateAdded && queryPart == DatabaseQueryPartOrderBy) return "songview.dateAdded";
+ else if (field == FieldDateAdded) return "songview.dateAdded";
}
else if (mediaType == MediaTypeArtist)
{
diff --git a/xbmc/utils/test/TestDatabaseUtils.cpp b/xbmc/utils/test/TestDatabaseUtils.cpp
index 2f213efeec..76db8c9df3 100644
--- a/xbmc/utils/test/TestDatabaseUtils.cpp
+++ b/xbmc/utils/test/TestDatabaseUtils.cpp
@@ -286,12 +286,7 @@ TEST(TestDatabaseUtils, GetField_MediaTypeSong)
DatabaseQueryPartSelect);
EXPECT_STREQ(refstr.c_str(), varstr.c_str());
- refstr = "songview.idSong";
- varstr = DatabaseUtils::GetField(FieldDateAdded, MediaTypeSong,
- DatabaseQueryPartOrderBy);
- EXPECT_STREQ(refstr.c_str(), varstr.c_str());
-
- refstr = "";
+ refstr = "songview.dateAdded";
varstr = DatabaseUtils::GetField(FieldDateAdded, MediaTypeSong,
DatabaseQueryPartSelect);
EXPECT_STREQ(refstr.c_str(), varstr.c_str());