Skip to content

Commit fa7f193

Browse files
committed
Reformat after merge.
1 parent 94d761e commit fa7f193

27 files changed

Lines changed: 343 additions & 329 deletions

‎approot/multisearch.xml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
${cover}
3232
</div>
3333
<div class="p-1">
34-
<i class="fa fa-music text-secondary" aria-hidden="true"></i>
34+
<i class="fa fa-music" aria-hidden="true"></i>
3535
</div>
3636
<div class="row align-items-center flex-fill overflow-hidden">
3737
<div class="col-12 col-md-6 col-lg-4">
@@ -74,7 +74,7 @@
7474
${cover}
7575
</div>
7676
<div class="p-1">
77-
<i class="fa fa-list text-primary" aria-hidden="true"></i>
77+
<i class="fa fa-list" aria-hidden="true"></i>
7878
</div>
7979
<div class="row align-items-center flex-fill overflow-hidden">
8080
<div class="col-12 col-md-6 col-lg-4">
@@ -117,7 +117,7 @@
117117
${cover}
118118
</div>
119119
<div class="p-1">
120-
<i class="fa fa-user text-info" aria-hidden="true"></i>
120+
<i class="fa fa-user" aria-hidden="true"></i>
121121
</div>
122122
<div class="row align-items-center flex-fill overflow-hidden">
123123
<div class="col-12 col-md-6 col-lg-4">

‎src/libs/database/impl/AnyMedium.cpp‎

Lines changed: 22 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
using namespace lms::db;
1111

12-
AnyMediumId any_medium::fromString(const std::string &type, const Wt::Dbo::dbo_default_traits::IdType id)
12+
AnyMediumId any_medium::fromString(const std::string& type, const Wt::Dbo::dbo_default_traits::IdType id)
1313
{
1414
if (type == "artist")
1515
return ArtistId(id);
@@ -21,19 +21,18 @@ AnyMediumId any_medium::fromString(const std::string &type, const Wt::Dbo::dbo_d
2121
throw std::logic_error("unknown medium type");
2222
}
2323

24-
RangeResults<AnyMediumId> any_medium::findIds(Session &session, Type type, const std::vector<std::string_view> &keywords,
25-
std::span<const ClusterId> clusters, MediaLibraryId mediaLibrary,
26-
std::optional<Range> range)
24+
RangeResults<AnyMediumId> any_medium::findIds(Session& session, Type type, const std::vector<std::string_view>& keywords,
25+
std::span<const ClusterId> clusters, MediaLibraryId mediaLibrary,
26+
std::optional<Range> range)
2727
{
2828
using Columns = std::tuple<std::string, Wt::Dbo::dbo_default_traits::IdType, int>;
2929

3030
session.checkReadTransaction();
3131

32-
auto media_library_query = session.getDboSession()->query<Wt::Dbo::dbo_default_traits::IdType>("SELECT json_each.value FROM json_each(media_library_ids)")
33-
.where("json_each.value = ?").bind(mediaLibrary.getValue());
32+
auto media_library_query = session.getDboSession()->query<Wt::Dbo::dbo_default_traits::IdType>("SELECT json_each.value FROM json_each(media_library_ids)").where("json_each.value = ?").bind(mediaLibrary.getValue());
3433

3534
auto cluster_query = session.getDboSession()->query<Wt::Dbo::dbo_default_traits::IdType>("SELECT json_each.value FROM json_each(cluster_ids)");
36-
for (auto cluster_id: clusters)
35+
for (auto cluster_id : clusters)
3736
cluster_query.orWhere("json_each.value = ?").bind(cluster_id.getValue());
3837

3938
auto query = session.getDboSession()->query<Columns>(R"(
@@ -54,17 +53,17 @@ RangeResults<AnyMediumId> any_medium::findIds(Session &session, Type type, const
5453

5554
switch (type)
5655
{
57-
case Type::ALL:
58-
break;
59-
case Type::RELEASES:
60-
query.where("type = 'release'");
61-
break;
62-
case Type::ARTISTS:
63-
query.where("type = 'artist'");
64-
break;
65-
case Type::TRACKS:
66-
query.where("type = 'track'");
67-
break;
56+
case Type::ALL:
57+
break;
58+
case Type::RELEASES:
59+
query.where("type = 'release'");
60+
break;
61+
case Type::ARTISTS:
62+
query.where("type = 'artist'");
63+
break;
64+
case Type::TRACKS:
65+
query.where("type = 'track'");
66+
break;
6867
}
6968

7069
query
@@ -75,7 +74,7 @@ RangeResults<AnyMediumId> any_medium::findIds(Session &session, Type type, const
7574

7675
auto results = std::vector<AnyMediumId>();
7776
results.reserve(columns.results.size());
78-
for (const auto&[type, id, _] : columns.results)
77+
for (const auto& [type, id, _] : columns.results)
7978
results.emplace_back(fromString(type, id));
8079

8180
return {
@@ -85,10 +84,9 @@ RangeResults<AnyMediumId> any_medium::findIds(Session &session, Type type, const
8584
};
8685
}
8786

88-
std::ostream & lms::db::operator<<(std::ostream &os, const AnyMediumId &v)
87+
std::ostream& lms::db::operator<<(std::ostream& os, const AnyMediumId& v)
8988
{
90-
std::visit([&os](auto&& arg)
91-
{
89+
std::visit([&os](auto&& arg) {
9290
using T = std::decay_t<decltype(arg)>;
9391
if constexpr (std::is_same_v<T, ArtistId>)
9492
os << "Artist(" << arg.getValue() << ")";
@@ -98,7 +96,7 @@ std::ostream & lms::db::operator<<(std::ostream &os, const AnyMediumId &v)
9896
os << "Track(" << arg.getValue() << ")";
9997
else
10098
static_assert(false, "inexhaustible patterns");
101-
102-
}, v);
99+
},
100+
v);
103101
return os;
104102
}
Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#pragma once
22

3+
#include <optional>
34
#include <variant>
45
#include <vector>
5-
#include <optional>
66

77
#include "ArtistId.hpp"
88
#include "ClusterId.hpp"
@@ -11,7 +11,6 @@
1111
#include "TrackId.hpp"
1212
#include "Types.hpp"
1313

14-
1514
namespace lms::db
1615
{
1716
class Session;
@@ -23,12 +22,15 @@ namespace lms::db
2322
{
2423
enum class Type
2524
{
26-
ALL, RELEASES, ARTISTS, TRACKS
25+
ALL,
26+
RELEASES,
27+
ARTISTS,
28+
TRACKS
2729
};
2830

29-
AnyMediumId fromString(const std::string &type, Wt::Dbo::dbo_default_traits::IdType id);
30-
RangeResults<AnyMediumId> findIds(Session &session, Type type, const std::vector<std::string_view> &keywords,
31-
std::span<const ClusterId> clusters, MediaLibraryId mediaLibrary,
32-
std::optional<Range> range);
33-
}
34-
}
31+
AnyMediumId fromString(const std::string& type, Wt::Dbo::dbo_default_traits::IdType id);
32+
RangeResults<AnyMediumId> findIds(Session& session, Type type, const std::vector<std::string_view>& keywords,
33+
std::span<const ClusterId> clusters, MediaLibraryId mediaLibrary,
34+
std::optional<Range> range);
35+
} // namespace any_medium
36+
} // namespace lms::db

‎src/libs/database/include/database/ArtistId.hpp‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@
2121

2222
#include "database/IdType.hpp"
2323

24-
namespace lms::db {
25-
class Artist;
24+
namespace lms::db
25+
{
26+
class Artist;
2627
}
2728

2829
LMS_DECLARE_IDTYPE(ArtistId, lms::db::Artist)

‎src/libs/database/include/database/ClusterId.hpp‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@
2121

2222
#include "database/IdType.hpp"
2323

24-
namespace lms::db {
25-
class Cluster;
26-
class ClusterType;
27-
}
24+
namespace lms::db
25+
{
26+
class Cluster;
27+
class ClusterType;
28+
} // namespace lms::db
2829

2930
LMS_DECLARE_IDTYPE(ClusterId, lms::db::Cluster)
3031
LMS_DECLARE_IDTYPE(ClusterTypeId, lms::db::ClusterType)

‎src/libs/database/include/database/IdType.hpp‎

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -48,24 +48,25 @@ namespace lms::db
4848
Wt::Dbo::dbo_default_traits::IdType _id{ Wt::Dbo::dbo_default_traits::invalidId() };
4949
};
5050

51-
#define LMS_DECLARE_IDTYPE(name, target) \
52-
namespace lms::db { \
53-
class name : public IdType \
54-
{ \
55-
public: \
56-
using IdType::IdType; \
57-
using Target = target; \
58-
auto operator<=>(const name& other) const = default; \
59-
};\
60-
} \
61-
namespace std \
62-
{ \
63-
template<> \
64-
class hash<lms::db::name> \
65-
{ \
66-
public: \
67-
size_t operator()(lms::db::name id) const \
68-
{ \
51+
#define LMS_DECLARE_IDTYPE(name, target) \
52+
namespace lms::db \
53+
{ \
54+
class name : public IdType \
55+
{ \
56+
public: \
57+
using IdType::IdType; \
58+
using Target = target; \
59+
auto operator<=>(const name& other) const = default; \
60+
}; \
61+
} \
62+
namespace std \
63+
{ \
64+
template<> \
65+
class hash<lms::db::name> \
66+
{ \
67+
public: \
68+
size_t operator()(lms::db::name id) const \
69+
{ \
6970
return std::hash<lms::db::name::ValueType>()(id.getValue()); \
7071
} \
7172
}; \

‎src/libs/database/include/database/ListenId.hpp‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@
2121

2222
#include "database/IdType.hpp"
2323

24-
namespace lms::db {
25-
class Listen;
24+
namespace lms::db
25+
{
26+
class Listen;
2627
}
2728

2829
LMS_DECLARE_IDTYPE(ListenId, lms::db::Listen)

‎src/libs/database/include/database/MediaLibraryId.hpp‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@
2121

2222
#include "database/IdType.hpp"
2323

24-
namespace lms::db {
25-
class MediaLibrary;
24+
namespace lms::db
25+
{
26+
class MediaLibrary;
2627
}
2728

2829
LMS_DECLARE_IDTYPE(MediaLibraryId, lms::db::MediaLibrary)

‎src/libs/database/include/database/ReleaseId.hpp‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@
2121

2222
#include "database/IdType.hpp"
2323

24-
namespace lms::db {
25-
class Release;
24+
namespace lms::db
25+
{
26+
class Release;
2627
}
2728

2829
LMS_DECLARE_IDTYPE(ReleaseId, lms::db::Release)

‎src/libs/database/include/database/ReleaseTypeId.hpp‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,9 @@
2121

2222
#include "database/IdType.hpp"
2323

24-
namespace lms::db {
25-
class ReleaseType;
24+
namespace lms::db
25+
{
26+
class ReleaseType;
2627
}
2728

2829
LMS_DECLARE_IDTYPE(ReleaseTypeId, lms::db::ReleaseType)

0 commit comments

Comments
 (0)