Centralized artwork lookup logic
This commit is contained in:
@@ -320,6 +320,11 @@ AND NOT EXISTS (
|
||||
return ObjectPtr<Image>{ _image };
|
||||
}
|
||||
|
||||
ImageId Artist::getImageId() const
|
||||
{
|
||||
return _image.id();
|
||||
}
|
||||
|
||||
RangeResults<ArtistId> Artist::findSimilarArtistIds(core::EnumSet<TrackArtistLinkType> artistLinkTypes, std::optional<Range> range) const
|
||||
{
|
||||
assert(session());
|
||||
|
||||
@@ -706,6 +706,11 @@ namespace lms::db
|
||||
return ObjectPtr<Image>{ _image };
|
||||
}
|
||||
|
||||
ImageId Release::getImageId() const
|
||||
{
|
||||
return _image.id();
|
||||
}
|
||||
|
||||
void Release::clearLabels()
|
||||
{
|
||||
_labels.clear();
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
#include "database/ArtistId.hpp"
|
||||
#include "database/ClusterId.hpp"
|
||||
#include "database/Filters.hpp"
|
||||
#include "database/ImageId.hpp"
|
||||
#include "database/MediaLibraryId.hpp"
|
||||
#include "database/Object.hpp"
|
||||
#include "database/ReleaseId.hpp"
|
||||
@@ -137,6 +138,7 @@ namespace lms::db
|
||||
std::optional<core::UUID> getMBID() const;
|
||||
bool hasMBID() const;
|
||||
ObjectPtr<Image> getImage() const;
|
||||
ImageId getImageId() const;
|
||||
void visitLinks(std::function<void(const ObjectPtr<TrackArtistLink>& link)> visitor) const;
|
||||
|
||||
// No artistLinkTypes means get them all
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "database/CountryId.hpp"
|
||||
#include "database/DirectoryId.hpp"
|
||||
#include "database/Filters.hpp"
|
||||
#include "database/ImageId.hpp"
|
||||
#include "database/LabelId.hpp"
|
||||
#include "database/MediaLibraryId.hpp"
|
||||
#include "database/Object.hpp"
|
||||
@@ -292,6 +293,7 @@ namespace lms::db
|
||||
std::string_view getBarcode() const { return _barcode; }
|
||||
std::string_view getComment() const { return _comment; }
|
||||
ObjectPtr<Image> getImage() const;
|
||||
ImageId getImageId() const;
|
||||
|
||||
// Setters
|
||||
void setName(std::string_view name) { _name = name; }
|
||||
|
||||
Reference in New Issue
Block a user