From 1c29962606e8213366aae29698a0a9256e79b149 Mon Sep 17 00:00:00 2001 From: emeric Date: Sun, 10 Oct 2021 20:37:27 +0200 Subject: [PATCH 1/4] Fixed regression on db object comparison, fixes #178 --- src/libs/database/include/database/Types.hpp | 2 ++ src/libs/database/test/Track.cpp | 14 ++++++++++++++ src/lms/ui/admin/UsersView.cpp | 6 +++--- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/libs/database/include/database/Types.hpp b/src/libs/database/include/database/Types.hpp index c2fb4146..f89a3eb7 100644 --- a/src/libs/database/include/database/Types.hpp +++ b/src/libs/database/include/database/Types.hpp @@ -105,6 +105,8 @@ namespace Database const T* operator->() const { return _obj.get(); } operator bool() const { return _obj.get(); } bool operator!() const { return !_obj.get(); } + bool operator==(const ObjectPtr& other) const { return other._obj == _obj; } + bool operator!=(const ObjectPtr& other) const { return other._obj != _obj; } auto modify() { return _obj.modify(); } void remove() { _obj.remove(); } diff --git a/src/libs/database/test/Track.cpp b/src/libs/database/test/Track.cpp index bdc54855..98934310 100644 --- a/src/libs/database/test/Track.cpp +++ b/src/libs/database/test/Track.cpp @@ -45,6 +45,20 @@ TEST_F(DatabaseFixture, SingleTrack) } } +TEST_F(DatabaseFixture, MultipleTracks) +{ + ScopedTrack track1 {session, "MyTrackFile1"}; + ScopedTrack track2 {session, "MyTrackFile2"}; + + { + auto transaction {session.createSharedTransaction()}; + + EXPECT_TRUE(track1.getId() != track2.getId()); + EXPECT_TRUE(track1.get() != track2.get()); + EXPECT_FALSE(track1.get() == track2.get()); + } +} + TEST_F(DatabaseFixture, MultipleTracksSearchByFilter) { ScopedTrack track1 {session, ""}; diff --git a/src/lms/ui/admin/UsersView.cpp b/src/lms/ui/admin/UsersView.cpp index 50bc58e7..b0608d81 100644 --- a/src/lms/ui/admin/UsersView.cpp +++ b/src/lms/ui/admin/UsersView.cpp @@ -69,8 +69,8 @@ UsersView::refreshView() auto transaction {LmsApp->getDbSession().createSharedTransaction()}; - auto users = Database::User::getAll(LmsApp->getDbSession()); - for (const auto& user : users) + const Database::User::pointer currentUser {LmsApp->getUser()}; + for (const Database::User::pointer& user : Database::User::getAll(LmsApp->getDbSession())) { const Database::UserId userId {user->getId()}; @@ -86,7 +86,7 @@ UsersView::refreshView() } // Don't edit ourself this way - if (LmsApp->getUser() == user) + if (currentUser == user) continue; entry->setCondition("if-edit", true); From 7fb267380ae7c815802b1af78a96695dddada2f1 Mon Sep 17 00:00:00 2001 From: cacko Date: Thu, 13 Jan 2022 01:18:36 +0000 Subject: [PATCH 2/4] Update INSTALL.md --- INSTALL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index 63691737..e0756afd 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -65,7 +65,7 @@ cmake .. -DCMAKE_BUILD_TYPE=Release ``` __Notes__: * you can customize the installation directory using `-DCMAKE_INSTALL_PREFIX=path` (defaults to `/usr/local`). -* you can customize the image library using `-DIMAGE_LIBRARY=` +* you can customize the image library using `-DIMAGE_LIBRARY=` ```sh make From ff7077a1366dfb6a3928a2ee3b2227cf4ee147fd Mon Sep 17 00:00:00 2001 From: emeric Date: Mon, 17 Jan 2022 20:38:18 +0100 Subject: [PATCH 3/4] Updated URLs (switch from poupon.io to poupon.dev) --- INSTALL.md | 4 ++-- README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index e0756afd..19bbd849 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -23,8 +23,8 @@ _Buster_ packages are provided for _amd64_ and _armhf_ architectures. As root, trust the following debian package provider and add it in your list of repositories: ```sh -wget -O - https://debian.poupon.io/apt/debian/epoupon.gpg.key | apt-key add - -echo "deb https://debian.poupon.io/apt/debian buster main" > /etc/apt/sources.list.d/epoupon.list +wget -O - https://debian.poupon.dev/apt/debian/epoupon.gpg.key | apt-key add - +echo "deb https://debian.poupon.dev/apt/debian buster main" > /etc/apt/sources.list.d/epoupon.list ``` To install or upgrade _LMS_: diff --git a/README.md b/README.md index b765f0ac..2c1302a5 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ _LMS_ is a self-hosted music streaming software: access your music collection from anywhere using a web interface! -A [demo instance](http://lms.demo.poupon.io) is available. Note the administration panel is not available. +A [demo instance](http://lms-demo.poupon.dev) is available. Note the administration panel is not available. ## Main features * Low memory requirements: the demo instance runs on a _Raspberry Pi Zero W_ From 37de73a9d0f807e573b0d7598bdf6d60ad69651a Mon Sep 17 00:00:00 2001 From: emeric Date: Wed, 19 Jan 2022 13:58:42 +0100 Subject: [PATCH 4/4] Fixed the transcoding info wrong green color --- approot/mediaplayer.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/approot/mediaplayer.xml b/approot/mediaplayer.xml index f7b70da6..46f1078f 100644 --- a/approot/mediaplayer.xml +++ b/approot/mediaplayer.xml @@ -35,7 +35,7 @@