Remove the per view tags selection
This commit is contained in:
@@ -11,7 +11,6 @@ lms_SOURCES = \
|
|||||||
$(srcdir)/database/Playlist.cpp \
|
$(srcdir)/database/Playlist.cpp \
|
||||||
$(srcdir)/database/Release.cpp \
|
$(srcdir)/database/Release.cpp \
|
||||||
$(srcdir)/database/ScanSettings.cpp \
|
$(srcdir)/database/ScanSettings.cpp \
|
||||||
$(srcdir)/database/Setting.cpp \
|
|
||||||
$(srcdir)/database/SqlQuery.cpp \
|
$(srcdir)/database/SqlQuery.cpp \
|
||||||
$(srcdir)/database/Track.cpp \
|
$(srcdir)/database/Track.cpp \
|
||||||
$(srcdir)/database/User.cpp \
|
$(srcdir)/database/User.cpp \
|
||||||
@@ -33,7 +32,6 @@ lms_SOURCES = \
|
|||||||
$(srcdir)/ui/explore/ArtistView.cpp \
|
$(srcdir)/ui/explore/ArtistView.cpp \
|
||||||
$(srcdir)/ui/explore/ArtistsView.cpp \
|
$(srcdir)/ui/explore/ArtistsView.cpp \
|
||||||
$(srcdir)/ui/explore/Explore.cpp \
|
$(srcdir)/ui/explore/Explore.cpp \
|
||||||
$(srcdir)/ui/explore/ExploreUtils.cpp \
|
|
||||||
$(srcdir)/ui/explore/Filters.cpp \
|
$(srcdir)/ui/explore/Filters.cpp \
|
||||||
$(srcdir)/ui/explore/ReleasesView.cpp \
|
$(srcdir)/ui/explore/ReleasesView.cpp \
|
||||||
$(srcdir)/ui/explore/ReleaseView.cpp \
|
$(srcdir)/ui/explore/ReleaseView.cpp \
|
||||||
|
|||||||
@@ -27,7 +27,6 @@
|
|||||||
namespace Database {
|
namespace Database {
|
||||||
|
|
||||||
class ClusterType;
|
class ClusterType;
|
||||||
// class meant to store general settings
|
|
||||||
class ScanSettings : public Wt::Dbo::Dbo<ScanSettings>
|
class ScanSettings : public Wt::Dbo::Dbo<ScanSettings>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -34,31 +34,14 @@
|
|||||||
|
|
||||||
#include "LmsApplication.hpp"
|
#include "LmsApplication.hpp"
|
||||||
#include "Filters.hpp"
|
#include "Filters.hpp"
|
||||||
#include "ExploreUtils.hpp"
|
|
||||||
|
|
||||||
using namespace Database;
|
using namespace Database;
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
const std::string artistClusterTypesSetting = "artist_cluster_types";
|
|
||||||
const std::set<std::string> defaultArtistClusterTypes =
|
|
||||||
{
|
|
||||||
"GENRE",
|
|
||||||
"ALBUMGROUPING",
|
|
||||||
"ALBUMMOOD",
|
|
||||||
"COMMENT:SONGS-DB_OCCASION",
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
namespace UserInterface {
|
namespace UserInterface {
|
||||||
|
|
||||||
Artist::Artist(Filters* filters)
|
Artist::Artist(Filters* filters)
|
||||||
: _filters(filters)
|
: _filters(filters)
|
||||||
{
|
{
|
||||||
if (!Setting::exists(LmsApp->getDboSession(), artistClusterTypesSetting))
|
|
||||||
setClusterTypesToSetting(artistClusterTypesSetting, defaultArtistClusterTypes);
|
|
||||||
|
|
||||||
wApp->internalPathChanged().connect(std::bind([=]
|
wApp->internalPathChanged().connect(std::bind([=]
|
||||||
{
|
{
|
||||||
refresh();
|
refresh();
|
||||||
@@ -98,7 +81,7 @@ Artist::refresh()
|
|||||||
Wt::WContainerWidget* clusterContainers = t->bindNew<Wt::WContainerWidget>("clusters");
|
Wt::WContainerWidget* clusterContainers = t->bindNew<Wt::WContainerWidget>("clusters");
|
||||||
|
|
||||||
{
|
{
|
||||||
auto clusterTypes = getClusterTypesFromSetting(artistClusterTypesSetting);
|
auto clusterTypes = ScanSettings::get(LmsApp->getDboSession())->getClusterTypes();
|
||||||
auto clusterGroups = artist->getClusterGroups(clusterTypes, 3);
|
auto clusterGroups = artist->getClusterGroups(clusterTypes, 3);
|
||||||
|
|
||||||
for (auto clusters : clusterGroups)
|
for (auto clusters : clusterGroups)
|
||||||
|
|||||||
@@ -31,31 +31,15 @@
|
|||||||
|
|
||||||
#include "LmsApplication.hpp"
|
#include "LmsApplication.hpp"
|
||||||
#include "Filters.hpp"
|
#include "Filters.hpp"
|
||||||
#include "ExploreUtils.hpp"
|
|
||||||
|
|
||||||
using namespace Database;
|
using namespace Database;
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
const std::string artistsClusterTypesSetting = "artists_cluster_types";
|
|
||||||
const std::set<std::string> defaultArtistsClusterTypes =
|
|
||||||
{
|
|
||||||
"ALBUMGROUPING",
|
|
||||||
"GENRE",
|
|
||||||
"ALBUMMOOD",
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace UserInterface {
|
namespace UserInterface {
|
||||||
|
|
||||||
Artists::Artists(Filters* filters)
|
Artists::Artists(Filters* filters)
|
||||||
: Wt::WTemplate(Wt::WString::tr("Lms.Explore.Artists.template")),
|
: Wt::WTemplate(Wt::WString::tr("Lms.Explore.Artists.template")),
|
||||||
_filters(filters)
|
_filters(filters)
|
||||||
{
|
{
|
||||||
if (!Setting::exists(LmsApp->getDboSession(), artistsClusterTypesSetting))
|
|
||||||
setClusterTypesToSetting(artistsClusterTypesSetting, defaultArtistsClusterTypes);
|
|
||||||
|
|
||||||
addFunction("tr", &Wt::WTemplate::Functions::tr);
|
addFunction("tr", &Wt::WTemplate::Functions::tr);
|
||||||
|
|
||||||
_search = bindNew<Wt::WLineEdit>("search");
|
_search = bindNew<Wt::WLineEdit>("search");
|
||||||
@@ -109,7 +93,7 @@ Artists::addSome()
|
|||||||
|
|
||||||
Wt::WContainerWidget* clusterContainers = entry->bindNew<Wt::WContainerWidget>("clusters");
|
Wt::WContainerWidget* clusterContainers = entry->bindNew<Wt::WContainerWidget>("clusters");
|
||||||
{
|
{
|
||||||
auto clusterTypes = getClusterTypesFromSetting(artistsClusterTypesSetting);
|
auto clusterTypes = ScanSettings::get(LmsApp->getDboSession())->getClusterTypes();
|
||||||
auto clusterGroups = artist->getClusterGroups(clusterTypes, 1);
|
auto clusterGroups = artist->getClusterGroups(clusterTypes, 1);
|
||||||
|
|
||||||
for (auto clusters : clusterGroups)
|
for (auto clusters : clusterGroups)
|
||||||
|
|||||||
@@ -1,51 +0,0 @@
|
|||||||
|
|
||||||
/*
|
|
||||||
* Copyright (C) 2018 Emeric Poupon
|
|
||||||
*
|
|
||||||
* This file is part of LMS.
|
|
||||||
*
|
|
||||||
* LMS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* LMS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with LMS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "ExploreUtils.hpp"
|
|
||||||
|
|
||||||
#include "utils/Utils.hpp"
|
|
||||||
|
|
||||||
#include "database/Setting.hpp"
|
|
||||||
|
|
||||||
#include "LmsApplication.hpp"
|
|
||||||
|
|
||||||
namespace UserInterface {
|
|
||||||
|
|
||||||
std::vector<Database::ClusterType::pointer> getClusterTypesFromSetting(std::string setting)
|
|
||||||
{
|
|
||||||
std::vector<Database::ClusterType::pointer> res;
|
|
||||||
for (auto clusterTypeName : splitString(Database::Setting::getString(LmsApp->getDboSession(), setting), " "))
|
|
||||||
{
|
|
||||||
auto clusterType = Database::ClusterType::getByName(LmsApp->getDboSession(), clusterTypeName);
|
|
||||||
if (clusterType)
|
|
||||||
res.push_back(clusterType);
|
|
||||||
}
|
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
|
||||||
|
|
||||||
void setClusterTypesToSetting(std::string setting, const std::set<std::string>& clusterTypes)
|
|
||||||
{
|
|
||||||
std::vector<std::string> vec(clusterTypes.begin(), clusterTypes.end());
|
|
||||||
Database::Setting::setString(LmsApp->getDboSession(), setting, joinStrings(vec, " "));
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace UserInterface
|
|
||||||
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
|
|
||||||
/*
|
|
||||||
* Copyright (C) 2018 Emeric Poupon
|
|
||||||
*
|
|
||||||
* This file is part of LMS.
|
|
||||||
*
|
|
||||||
* LMS is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU General Public License as published by
|
|
||||||
* the Free Software Foundation, either version 3 of the License, or
|
|
||||||
* (at your option) any later version.
|
|
||||||
*
|
|
||||||
* LMS is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with LMS. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "database/Cluster.hpp"
|
|
||||||
|
|
||||||
namespace UserInterface {
|
|
||||||
|
|
||||||
std::vector<Database::ClusterType::pointer> getClusterTypesFromSetting(std::string setting);
|
|
||||||
|
|
||||||
void setClusterTypesToSetting(std::string setting, const std::set<std::string>& clusterTypes);
|
|
||||||
|
|
||||||
} // namespace UserInterface
|
|
||||||
@@ -26,7 +26,6 @@
|
|||||||
#include <Wt/WText.h>
|
#include <Wt/WText.h>
|
||||||
|
|
||||||
#include "database/Release.hpp"
|
#include "database/Release.hpp"
|
||||||
#include "database/Setting.hpp"
|
|
||||||
#include "database/Track.hpp"
|
#include "database/Track.hpp"
|
||||||
|
|
||||||
#include "utils/Logger.hpp"
|
#include "utils/Logger.hpp"
|
||||||
@@ -36,31 +35,14 @@
|
|||||||
|
|
||||||
#include "LmsApplication.hpp"
|
#include "LmsApplication.hpp"
|
||||||
#include "Filters.hpp"
|
#include "Filters.hpp"
|
||||||
#include "ExploreUtils.hpp"
|
|
||||||
|
|
||||||
using namespace Database;
|
using namespace Database;
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
const std::string releaseClusterTypesSetting = "release_cluster_types";
|
|
||||||
const std::set<std::string> defaultReleaseClusterTypes =
|
|
||||||
{
|
|
||||||
"GENRE",
|
|
||||||
"ALBUMGROUPING",
|
|
||||||
"ALBUMMOOD",
|
|
||||||
"COMMENT:SONGS-DB_OCCASION",
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
namespace UserInterface {
|
namespace UserInterface {
|
||||||
|
|
||||||
Release::Release(Filters* filters)
|
Release::Release(Filters* filters)
|
||||||
: _filters(filters)
|
: _filters(filters)
|
||||||
{
|
{
|
||||||
if (!Setting::exists(LmsApp->getDboSession(), releaseClusterTypesSetting))
|
|
||||||
setClusterTypesToSetting(releaseClusterTypesSetting, defaultReleaseClusterTypes);
|
|
||||||
|
|
||||||
wApp->internalPathChanged().connect(std::bind([=]
|
wApp->internalPathChanged().connect(std::bind([=]
|
||||||
{
|
{
|
||||||
refresh();
|
refresh();
|
||||||
@@ -131,7 +113,7 @@ Release::refresh()
|
|||||||
|
|
||||||
Wt::WContainerWidget* clusterContainers = t->bindNew<Wt::WContainerWidget>("clusters");
|
Wt::WContainerWidget* clusterContainers = t->bindNew<Wt::WContainerWidget>("clusters");
|
||||||
{
|
{
|
||||||
auto clusterTypes = getClusterTypesFromSetting(releaseClusterTypesSetting);
|
auto clusterTypes = ScanSettings::get(LmsApp->getDboSession())->getClusterTypes();
|
||||||
auto clusterGroups = release->getClusterGroups(clusterTypes, 3);
|
auto clusterGroups = release->getClusterGroups(clusterTypes, 3);
|
||||||
|
|
||||||
for (auto clusters : clusterGroups)
|
for (auto clusters : clusterGroups)
|
||||||
|
|||||||
@@ -26,7 +26,6 @@
|
|||||||
#include <Wt/WTemplate.h>
|
#include <Wt/WTemplate.h>
|
||||||
|
|
||||||
#include "database/Release.hpp"
|
#include "database/Release.hpp"
|
||||||
#include "database/Setting.hpp"
|
|
||||||
|
|
||||||
#include "utils/Logger.hpp"
|
#include "utils/Logger.hpp"
|
||||||
#include "utils/Utils.hpp"
|
#include "utils/Utils.hpp"
|
||||||
@@ -35,30 +34,15 @@
|
|||||||
|
|
||||||
#include "LmsApplication.hpp"
|
#include "LmsApplication.hpp"
|
||||||
#include "Filters.hpp"
|
#include "Filters.hpp"
|
||||||
#include "ExploreUtils.hpp"
|
|
||||||
|
|
||||||
using namespace Database;
|
using namespace Database;
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
const std::string releasesClusterTypesSetting = "releases_cluster_types";
|
|
||||||
const std::set<std::string> defaultReleasesClusterTypes =
|
|
||||||
{
|
|
||||||
"GENRE",
|
|
||||||
"ALBUMGROUPING",
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
namespace UserInterface {
|
namespace UserInterface {
|
||||||
|
|
||||||
Releases::Releases(Filters* filters)
|
Releases::Releases(Filters* filters)
|
||||||
: Wt::WTemplate(Wt::WString::tr("Lms.Explore.Releases.template")),
|
: Wt::WTemplate(Wt::WString::tr("Lms.Explore.Releases.template")),
|
||||||
_filters(filters)
|
_filters(filters)
|
||||||
{
|
{
|
||||||
if (!Setting::exists(LmsApp->getDboSession(), releasesClusterTypesSetting))
|
|
||||||
setClusterTypesToSetting(releasesClusterTypesSetting, defaultReleasesClusterTypes);
|
|
||||||
|
|
||||||
addFunction("tr", &Wt::WTemplate::Functions::tr);
|
addFunction("tr", &Wt::WTemplate::Functions::tr);
|
||||||
|
|
||||||
_search = bindNew<Wt::WLineEdit>("search");
|
_search = bindNew<Wt::WLineEdit>("search");
|
||||||
@@ -126,7 +110,7 @@ Releases::addSome()
|
|||||||
|
|
||||||
Wt::WContainerWidget* clusterContainers = entry->bindNew<Wt::WContainerWidget>("clusters");
|
Wt::WContainerWidget* clusterContainers = entry->bindNew<Wt::WContainerWidget>("clusters");
|
||||||
{
|
{
|
||||||
auto clusterTypes = getClusterTypesFromSetting(releasesClusterTypesSetting);
|
auto clusterTypes = ScanSettings::get(LmsApp->getDboSession())->getClusterTypes();
|
||||||
auto clusterGroups = release->getClusterGroups(clusterTypes, 1);
|
auto clusterGroups = release->getClusterGroups(clusterTypes, 1);
|
||||||
|
|
||||||
for (auto clusters : clusterGroups)
|
for (auto clusters : clusterGroups)
|
||||||
|
|||||||
@@ -26,7 +26,6 @@
|
|||||||
|
|
||||||
#include "database/Artist.hpp"
|
#include "database/Artist.hpp"
|
||||||
#include "database/Release.hpp"
|
#include "database/Release.hpp"
|
||||||
#include "database/Setting.hpp"
|
|
||||||
#include "database/Track.hpp"
|
#include "database/Track.hpp"
|
||||||
|
|
||||||
#include "utils/Logger.hpp"
|
#include "utils/Logger.hpp"
|
||||||
@@ -36,32 +35,15 @@
|
|||||||
|
|
||||||
#include "LmsApplication.hpp"
|
#include "LmsApplication.hpp"
|
||||||
#include "Filters.hpp"
|
#include "Filters.hpp"
|
||||||
#include "ExploreUtils.hpp"
|
|
||||||
|
|
||||||
using namespace Database;
|
using namespace Database;
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
const std::string trackClusterTypesSetting = "track_cluster_types";
|
|
||||||
const std::set<std::string> defaultTrackClusterTypes =
|
|
||||||
{
|
|
||||||
"GENRE",
|
|
||||||
"ALBUMGROUPING",
|
|
||||||
"ALBUMMOOD",
|
|
||||||
"COMMENT:SONGS-DB_OCCASION",
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace
|
|
||||||
|
|
||||||
namespace UserInterface {
|
namespace UserInterface {
|
||||||
|
|
||||||
Tracks::Tracks(Filters* filters)
|
Tracks::Tracks(Filters* filters)
|
||||||
: Wt::WTemplate(Wt::WString::tr("Lms.Explore.Tracks.template")),
|
: Wt::WTemplate(Wt::WString::tr("Lms.Explore.Tracks.template")),
|
||||||
_filters(filters)
|
_filters(filters)
|
||||||
{
|
{
|
||||||
if (!Setting::exists(LmsApp->getDboSession(), trackClusterTypesSetting))
|
|
||||||
setClusterTypesToSetting(trackClusterTypesSetting, defaultTrackClusterTypes);
|
|
||||||
|
|
||||||
addFunction("tr", &Wt::WTemplate::Functions::tr);
|
addFunction("tr", &Wt::WTemplate::Functions::tr);
|
||||||
|
|
||||||
_search = bindNew<Wt::WLineEdit>("search");
|
_search = bindNew<Wt::WLineEdit>("search");
|
||||||
@@ -154,7 +136,7 @@ Tracks::addSome()
|
|||||||
|
|
||||||
Wt::WContainerWidget* clusterContainers = entry->bindNew<Wt::WContainerWidget>("clusters");
|
Wt::WContainerWidget* clusterContainers = entry->bindNew<Wt::WContainerWidget>("clusters");
|
||||||
{
|
{
|
||||||
auto clusterTypes = getClusterTypesFromSetting(trackClusterTypesSetting);
|
auto clusterTypes = ScanSettings::get(LmsApp->getDboSession())->getClusterTypes();
|
||||||
auto clusterGroups = track->getClusterGroups(clusterTypes, 1);
|
auto clusterGroups = track->getClusterGroups(clusterTypes, 1);
|
||||||
|
|
||||||
for (auto clusters : clusterGroups)
|
for (auto clusters : clusterGroups)
|
||||||
|
|||||||
Reference in New Issue
Block a user