Minot cleanup
This commit is contained in:
@@ -248,7 +248,7 @@ namespace lms::db
|
||||
}
|
||||
else if (checkType != "none")
|
||||
{
|
||||
throw Exception("Invalid 'db-integrity-check' value: '" + checkType + "'. Expected 'quick', 'full' or 'none'.");
|
||||
throw Exception{ "Invalid 'db-integrity-check' value: '" + checkType + "'. Expected 'quick', 'full' or 'none'." };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -360,7 +360,7 @@ namespace lms::db
|
||||
}) };
|
||||
|
||||
if (!foreignKeyConstraintsPassed)
|
||||
throw Exception("Foreign key constraints check failed! Please restore from a backup or recreate the database.");
|
||||
throw Exception{ "Foreign key constraints check failed! Please restore from a backup or recreate the database." };
|
||||
|
||||
LMS_LOG(DB, INFO, "Foreign key constraints check passed!");
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ namespace lms::db
|
||||
WhereClause clusterClause;
|
||||
for (const ClusterId clusterId : params.filters.clusters)
|
||||
{
|
||||
clusterClause.Or(WhereClause("t_c.cluster_id = ?"));
|
||||
clusterClause.Or(WhereClause{ "t_c.cluster_id = ?" });
|
||||
query.bind(clusterId);
|
||||
}
|
||||
|
||||
@@ -442,11 +442,11 @@ AND NOT EXISTS (
|
||||
std::ostringstream oss;
|
||||
oss << "SELECT c FROM cluster c INNER JOIN track t ON c.id = t_c.cluster_id INNER JOIN track_cluster t_c ON t_c.track_id = t.id INNER JOIN cluster_type c_type ON c.cluster_type_id = c_type.id INNER JOIN artist a ON t_a_l.artist_id = a.id INNER JOIN track_artist_link t_a_l ON t_a_l.track_id = t.id";
|
||||
|
||||
where.And(WhereClause("a.id = ?")).bind(getId().toString());
|
||||
where.And(WhereClause{ "a.id = ?" }).bind(getId().toString());
|
||||
{
|
||||
WhereClause clusterClause;
|
||||
for (const ClusterTypeId clusterTypeId : clusterTypeIds)
|
||||
clusterClause.Or(WhereClause("c_type.id = ?")).bind(clusterTypeId.toString());
|
||||
clusterClause.Or(WhereClause{ "c_type.id = ?" }).bind(clusterTypeId.toString());
|
||||
|
||||
where.And(clusterClause);
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ namespace lms::db
|
||||
WhereClause clusterClause;
|
||||
for (const db::ClusterId id : params.filters.clusters)
|
||||
{
|
||||
clusterClause.Or(WhereClause("t_c.cluster_id = ?"));
|
||||
clusterClause.Or(WhereClause{ "t_c.cluster_id = ?" });
|
||||
query.bind(id);
|
||||
}
|
||||
|
||||
@@ -229,7 +229,7 @@ namespace lms::db
|
||||
WhereClause clusterClause;
|
||||
for (const ClusterId id : params.filters.clusters)
|
||||
{
|
||||
clusterClause.Or(WhereClause("c.id = ?"));
|
||||
clusterClause.Or(WhereClause{ "c.id = ?" });
|
||||
query.bind(id);
|
||||
}
|
||||
|
||||
@@ -313,7 +313,7 @@ namespace lms::db
|
||||
WhereClause clusterClause;
|
||||
for (const ClusterId id : params.filters.clusters)
|
||||
{
|
||||
clusterClause.Or(WhereClause("c.id = ?")).bind(id.toString());
|
||||
clusterClause.Or(WhereClause{ "c.id = ?" }).bind(id.toString());
|
||||
query.bind(id);
|
||||
}
|
||||
|
||||
|
||||
@@ -236,7 +236,7 @@ namespace lms::db
|
||||
WhereClause clusterClause;
|
||||
for (const ClusterId clusterId : params.filters.clusters)
|
||||
{
|
||||
clusterClause.Or(WhereClause("t_c.cluster_id = ?"));
|
||||
clusterClause.Or(WhereClause{ "t_c.cluster_id = ?" });
|
||||
query.bind(clusterId);
|
||||
}
|
||||
|
||||
@@ -1003,11 +1003,11 @@ namespace lms::db
|
||||
|
||||
oss << "SELECT c from cluster c INNER JOIN track_cluster t_c ON t_c.cluster_id = c.id INNER JOIN track t ON t.id = t_c.track_id ";
|
||||
|
||||
where.And(WhereClause("t.release_id = ?")).bind(getId().toString());
|
||||
where.And(WhereClause{ "t.release_id = ?" }).bind(getId().toString());
|
||||
{
|
||||
WhereClause clusterClause;
|
||||
for (const ClusterTypeId clusterTypeId : clusterTypeIds)
|
||||
clusterClause.Or(WhereClause("c.cluster_type_id = ?")).bind(clusterTypeId.toString());
|
||||
clusterClause.Or(WhereClause{ "c.cluster_type_id = ?" }).bind(clusterTypeId.toString());
|
||||
where.And(clusterClause);
|
||||
}
|
||||
oss << " " << where.get();
|
||||
|
||||
@@ -105,7 +105,7 @@ namespace lms::db
|
||||
WhereClause clusterClause;
|
||||
for (const ClusterId clusterId : params.filters.clusters)
|
||||
{
|
||||
clusterClause.Or(WhereClause("t_c.cluster_id = ?"));
|
||||
clusterClause.Or(WhereClause{ "t_c.cluster_id = ?" });
|
||||
query.bind(clusterId);
|
||||
}
|
||||
|
||||
@@ -897,11 +897,11 @@ namespace lms::db
|
||||
|
||||
oss << "SELECT c from cluster c INNER JOIN track t ON c.id = t_c.cluster_id INNER JOIN track_cluster t_c ON t_c.track_id = t.id INNER JOIN cluster_type c_type ON c.cluster_type_id = c_type.id";
|
||||
|
||||
where.And(WhereClause("t.id = ?")).bind(getId().toString());
|
||||
where.And(WhereClause{ "t.id = ?" }).bind(getId().toString());
|
||||
{
|
||||
WhereClause clusterClause;
|
||||
for (ClusterTypeId clusterTypeId : clusterTypeIds)
|
||||
clusterClause.Or(WhereClause("c_type.id = ?")).bind(clusterTypeId.toString());
|
||||
clusterClause.Or(WhereClause{ "c_type.id = ?" }).bind(clusterTypeId.toString());
|
||||
where.And(clusterClause);
|
||||
}
|
||||
oss << " " << where.get();
|
||||
|
||||
@@ -115,7 +115,7 @@ namespace lms::db
|
||||
WhereClause clusterClause;
|
||||
for (const ClusterId clusterId : params.filters.clusters)
|
||||
{
|
||||
clusterClause.Or(WhereClause("c.id = ?"));
|
||||
clusterClause.Or(WhereClause{ "c.id = ?" });
|
||||
query.bind(clusterId);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user