Minor update
This commit is contained in:
@@ -94,7 +94,7 @@ getReleaseArtists(const Av::IAudioFile::MetadataMap& metadataMap)
|
|||||||
|
|
||||||
auto mbid {findFirstValueOfAs<UUID>(metadataMap, {"MUSICBRAINZ ALBUM ARTIST ID", "MUSICBRAINZ/ALBUM ARTIST ID"})};
|
auto mbid {findFirstValueOfAs<UUID>(metadataMap, {"MUSICBRAINZ ALBUM ARTIST ID", "MUSICBRAINZ/ALBUM ARTIST ID"})};
|
||||||
|
|
||||||
return {Artist {*name, std::nullopt, mbid} };
|
return {Artist {mbid, *name, std::nullopt} };
|
||||||
}
|
}
|
||||||
|
|
||||||
static
|
static
|
||||||
@@ -118,9 +118,9 @@ getArtists(const Av::IAudioFile::MetadataMap& metadataMap)
|
|||||||
for (std::size_t i {}; i < artistNames.size(); ++i)
|
for (std::size_t i {}; i < artistNames.size(); ++i)
|
||||||
{
|
{
|
||||||
if (artistMBIDs && artistNames.size() == artistMBIDs->size())
|
if (artistMBIDs && artistNames.size() == artistMBIDs->size())
|
||||||
artists.emplace_back(Artist {artistNames[i], std::nullopt, (*artistMBIDs)[i]});
|
artists.emplace_back(Artist {(*artistMBIDs)[i], artistNames[i], std::nullopt});
|
||||||
else
|
else
|
||||||
artists.emplace_back(Artist {artistNames[i], std::nullopt, {}});
|
artists.emplace_back(Artist {std::nullopt, artistNames[i], std::nullopt});
|
||||||
}
|
}
|
||||||
|
|
||||||
return artists;
|
return artists;
|
||||||
|
|||||||
@@ -37,31 +37,31 @@ namespace MetaData
|
|||||||
|
|
||||||
struct Artist
|
struct Artist
|
||||||
{
|
{
|
||||||
|
std::optional<UUID> mbid;
|
||||||
std::string name;
|
std::string name;
|
||||||
std::optional<std::string> sortName;
|
std::optional<std::string> sortName;
|
||||||
std::optional<UUID> mbid;
|
|
||||||
|
|
||||||
Artist(std::string_view _name) : name {_name} {}
|
Artist(std::string_view _name) : name {_name} {}
|
||||||
Artist(std::string_view _name, std::optional<std::string> _sortName, std::optional<UUID> _mbid) : name {_name}, sortName {std::move(_sortName)}, mbid {std::move(_mbid)} {}
|
Artist(std::optional<UUID> _mbid, std::string_view _name, std::optional<std::string> _sortName) : mbid {std::move(_mbid)}, name {_name}, sortName {std::move(_sortName)} {}
|
||||||
};
|
};
|
||||||
|
|
||||||
using PerformerContainer = std::map<std::string /*role*/, std::vector<Artist>>;
|
using PerformerContainer = std::map<std::string /*role*/, std::vector<Artist>>;
|
||||||
|
|
||||||
struct Release
|
struct Release
|
||||||
{
|
{
|
||||||
|
std::optional<UUID> mbid;
|
||||||
std::string name;
|
std::string name;
|
||||||
std::vector<Artist> artists;
|
std::vector<Artist> artists;
|
||||||
std::optional<UUID> mbid;
|
|
||||||
std::optional<std::size_t> mediumCount;
|
std::optional<std::size_t> mediumCount;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Medium
|
struct Medium
|
||||||
{
|
{
|
||||||
std::optional<std::size_t> position;
|
|
||||||
std::string type;
|
std::string type;
|
||||||
std::string name;
|
std::string name;
|
||||||
std::optional<float> replayGain;
|
std::optional<std::size_t> position; // in release
|
||||||
std::optional<std::size_t> trackCount;
|
std::optional<std::size_t> trackCount;
|
||||||
|
std::optional<float> replayGain;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct AudioStream
|
struct AudioStream
|
||||||
@@ -71,15 +71,14 @@ namespace MetaData
|
|||||||
|
|
||||||
struct Track
|
struct Track
|
||||||
{
|
{
|
||||||
std::vector<Artist> artists;
|
|
||||||
std::string title;
|
|
||||||
std::optional<UUID> mbid;
|
std::optional<UUID> mbid;
|
||||||
std::optional<UUID> recordingMBID;
|
std::optional<UUID> recordingMBID;
|
||||||
std::optional<Release> release;
|
std::string title;
|
||||||
std::optional<Medium> medium;
|
std::optional<Medium> medium;
|
||||||
|
std::optional<std::size_t> position; // in medium
|
||||||
|
std::optional<Release> release;
|
||||||
Tags tags;
|
Tags tags;
|
||||||
std::chrono::milliseconds duration;
|
std::chrono::milliseconds duration;
|
||||||
std::optional<std::size_t> position; // in medium
|
|
||||||
Wt::WDate date;
|
Wt::WDate date;
|
||||||
Wt::WDate originalDate;
|
Wt::WDate originalDate;
|
||||||
bool hasCover {};
|
bool hasCover {};
|
||||||
@@ -88,6 +87,7 @@ namespace MetaData
|
|||||||
std::string copyright;
|
std::string copyright;
|
||||||
std::string copyrightURL;
|
std::string copyrightURL;
|
||||||
std::optional<float> replayGain;
|
std::optional<float> replayGain;
|
||||||
|
std::vector<Artist> artists;
|
||||||
std::vector<Artist> conductorArtists;
|
std::vector<Artist> conductorArtists;
|
||||||
std::vector<Artist> composerArtists;
|
std::vector<Artist> composerArtists;
|
||||||
std::vector<Artist> lyricistArtists;
|
std::vector<Artist> lyricistArtists;
|
||||||
|
|||||||
Reference in New Issue
Block a user