Added support for record labels, fixes #502

This commit is contained in:
emeric
2024-09-02 08:06:17 +02:00
parent 24e867ea8c
commit cb4014b0e5
17 changed files with 267 additions and 12 deletions
+2
View File
@@ -337,11 +337,13 @@ VALUES
EXPECT_FALSE(ClusterType::find(session, ClusterTypeId{}));
EXPECT_FALSE(Directory::find(session, DirectoryId{}));
EXPECT_FALSE(Image::find(session, ImageId{}));
EXPECT_FALSE(Label::find(session, LabelId{}));
EXPECT_FALSE(Listen::find(session, ListenId{}));
EXPECT_FALSE(RatedArtist::find(session, RatedArtistId{}));
EXPECT_FALSE(RatedRelease::find(session, RatedReleaseId{}));
EXPECT_FALSE(RatedTrack::find(session, RatedTrackId{}));
EXPECT_FALSE(Release::find(session, ReleaseId{}));
EXPECT_FALSE(ReleaseType::find(session, ReleaseTypeId{}));
EXPECT_FALSE(StarredArtist::find(session, StarredArtistId{}));
EXPECT_FALSE(StarredRelease::find(session, StarredReleaseId{}));
EXPECT_FALSE(StarredTrack::find(session, StarredTrackId{}));
+18
View File
@@ -21,6 +21,7 @@
namespace lms::db::tests
{
using ScopedLabel = ScopedEntity<db::Label>;
using ScopedReleaseType = ScopedEntity<db::ReleaseType>;
TEST_F(DatabaseFixture, Release)
@@ -744,6 +745,23 @@ namespace lms::db::tests
}
}
TEST_F(DatabaseFixture, Label)
{
{
auto transaction{ session.createReadTransaction() };
Label::pointer res{ Label::find(session, "label") };
EXPECT_EQ(res, Label::pointer{});
}
ScopedLabel label{ session, "MyLabel" };
{
auto transaction{ session.createReadTransaction() };
Label::pointer res{ Label::find(session, "MyLabel") };
EXPECT_EQ(res, label.get());
}
}
TEST_F(DatabaseFixture, ReleaseType)
{
{