35
37
Private(const string &title, const string &artist,
36
38
const string &date, const string &genre,
37
const string &filename)
39
const string &filename, bool has_thumbnail)
38
40
: title(title), artist(artist), date(date), genre(genre),
41
filename(filename), has_thumbnail(has_thumbnail) {}
40
42
Private(const Private &other) {
48
50
Album::Album(const std::string &title, const std::string &artist)
49
: Album(title, artist, "", "", "") {
51
: Album(title, artist, "", "", "", false) {
52
54
Album::Album(const std::string &title, const std::string &artist,
53
55
const std::string &date, const std::string &genre,
54
56
const std::string &filename)
55
: p(new Private(title, artist, date, genre, filename)) {
57
: Album(title, artist, date, genre, filename, !filename.empty()) {
60
Album::Album(const std::string &title, const std::string &artist,
61
const std::string &date, const std::string &genre,
62
const std::string &filename, bool has_thumbnail)
63
: p(new Private(title, artist, date, genre, filename, has_thumbnail)) {
58
66
Album::Album(const Album &other) : p(new Private(*other.p)) {
100
108
return p->filename;
111
bool Album::getHasThumbnail() const noexcept {
112
return p->has_thumbnail;
103
115
std::string Album::getArtUri() const {
104
if (p->filename.empty()) {
116
if (p->has_thumbnail) {
117
return make_thumbnail_uri(getUri(p->filename));
119
auto standalone = FolderArtCache::get().get_art_for_file(p->filename);
120
if (!standalone.empty()) {
121
return make_thumbnail_uri(getUri(standalone));
105
123
return make_album_art_uri(p->artist, p->title);
107
return make_thumbnail_uri(getUri(p->filename));
113
129
p->artist == other.p->artist &&
114
130
p->date == other.p->date &&
115
131
p->genre == other.p->genre &&
116
p->filename == other.p->filename;
132
p->filename == other.p->filename &&
133
p->has_thumbnail == other.p->has_thumbnail;
119
136
bool Album::operator!=(const Album &other) const {