Put all directories and images in database, use the info to associate an image to each artist

This commit is contained in:
emeric
2024-07-06 13:53:41 +02:00
parent 45c8b82865
commit d1324c1c3a
59 changed files with 2023 additions and 960 deletions
-16
View File
@@ -76,22 +76,6 @@ namespace lms::core::stringUtils
return std::nullopt;
}
template<>
std::optional<db::ImageId> readAs(std::string_view str)
{
std::vector<std::string_view> values{ core::stringUtils::splitString(str, '-') };
if (values.size() != 2)
return std::nullopt;
if (values[0] != "im")
return std::nullopt;
if (const auto value{ core::stringUtils::readAs<db::ImageId::ValueType>(values[1]) })
return db::ImageId{ *value };
return std::nullopt;
}
template<>
std::optional<db::MediaLibraryId> readAs(std::string_view str)
{
-5
View File
@@ -21,7 +21,6 @@
#include "core/String.hpp"
#include "database/ArtistId.hpp"
#include "database/ImageId.hpp"
#include "database/MediaLibraryId.hpp"
#include "database/ReleaseId.hpp"
#include "database/TrackId.hpp"
@@ -34,7 +33,6 @@ namespace lms::api::subsonic
};
std::string idToString(db::ArtistId id);
std::string idToString(db::ImageId id);
std::string idToString(db::MediaLibraryId id);
std::string idToString(db::ReleaseId id);
std::string idToString(db::TrackId id);
@@ -51,9 +49,6 @@ namespace lms::core::stringUtils
template<>
std::optional<db::ArtistId> readAs(std::string_view str);
template<>
std::optional<db::ImageId> readAs(std::string_view str);
template<>
std::optional<db::MediaLibraryId> readAs(std::string_view str);
@@ -39,7 +39,7 @@ namespace lms::api::subsonic::Scan
{
std::size_t count{};
if (scanStatus.currentScanStepStats && scanStatus.currentScanStepStats->currentStep == ScanStep::ScanAudioFiles)
if (scanStatus.currentScanStepStats && scanStatus.currentScanStepStats->currentStep == ScanStep::ScanFiles)
count = scanStatus.currentScanStepStats->processedElems;
statusResponse.setAttribute("count", count);