| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
#pragma once |
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
#include "Artist.h" |
| 17 |
#include "Song.h" |
| 18 |
#include "XBDateTime.h" |
| 19 |
#include "utils/ScraperUrl.h" |
| 20 |
|
| 21 |
#include <map> |
| 22 |
#include <vector> |
| 23 |
|
| 24 |
class TiXmlNode; |
| 25 |
class CFileItem; |
| 26 |
class CAlbum |
| 27 |
{ |
| 28 |
public: |
| 29 |
explicit CAlbum(const CFileItem& item); |
| 30 |
CAlbum() = default; |
| 31 |
bool operator<(const CAlbum &a) const; |
| 32 |
void MergeScrapedAlbum(const CAlbum& album, bool override = true); |
| 33 |
|
| 34 |
void Reset() |
| 35 |
{ |
| 36 |
idAlbum = -1; |
| 37 |
strAlbum.clear(); |
| 38 |
strMusicBrainzAlbumID.clear(); |
| 39 |
strReleaseGroupMBID.clear(); |
| 40 |
artistCredits.clear(); |
| 41 |
strArtistDesc.clear(); |
| 42 |
strArtistSort.clear(); |
| 43 |
genre.clear(); |
| 44 |
thumbURL.Clear(); |
| 45 |
moods.clear(); |
| 46 |
styles.clear(); |
| 47 |
themes.clear(); |
| 48 |
art.clear(); |
| 49 |
strReview.clear(); |
| 50 |
strLabel.clear(); |
| 51 |
strType.clear(); |
| 52 |
strReleaseStatus.clear(); |
| 53 |
strPath.clear(); |
| 54 |
fRating = -1; |
| 55 |
iUserrating = -1; |
| 56 |
iVotes = -1; |
| 57 |
strOrigReleaseDate.clear(); |
| 58 |
strReleaseDate.clear(); |
| 59 |
bCompilation = false; |
| 60 |
bBoxedSet = false; |
| 61 |
iTimesPlayed = 0; |
| 62 |
dateAdded.Reset(); |
| 63 |
dateUpdated.Reset(); |
| 64 |
dateNew.Reset(); |
| 65 |
lastPlayed.Reset(); |
| 66 |
iTotalDiscs = -1; |
| 67 |
songs.clear(); |
| 68 |
releaseType = Album; |
| 69 |
strLastScraped.clear(); |
| 70 |
bScrapedMBID = false; |
| 71 |
bArtistSongMerge = false; |
| 72 |
iAlbumDuration = 0; |
| 73 |
} |
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
const std::vector<std::string> GetAlbumArtist() const; |
| 79 |
|
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
const std::vector<std::string> GetMusicBrainzAlbumArtistID() const; |
| 84 |
std::string GetGenreString() const; |
| 85 |
|
| 86 |
|
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
const std::string GetAlbumArtistString() const; |
| 91 |
|
| 92 |
|
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
const std::string GetAlbumArtistSort() const; |
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
|
| 101 |
const std::vector<int> GetArtistIDArray() const; |
| 102 |
|
| 103 |
typedef enum ReleaseType { |
| 104 |
Album = 0, |
| 105 |
Single |
| 106 |
} ReleaseType; |
| 107 |
|
| 108 |
std::string GetReleaseType() const; |
| 109 |
void SetReleaseType(const std::string& strReleaseType); |
| 110 |
void SetDateAdded(const std::string& strDateAdded); |
| 111 |
void SetDateUpdated(const std::string& strDateUpdated); |
| 112 |
void SetDateNew(const std::string& strDateNew); |
| 113 |
void SetLastPlayed(const std::string& strLastPlayed); |
| 114 |
|
| 115 |
static std::string ReleaseTypeToString(ReleaseType releaseType); |
| 116 |
static ReleaseType ReleaseTypeFromString(const std::string& strReleaseType); |
| 117 |
|
| 118 |
|
| 119 |
|
| 120 |
|
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
|
| 125 |
|
| 126 |
|
| 127 |
|
| 128 |
void SetArtistCredits(const std::vector<std::string>& names, const std::vector<std::string>& hints, |
| 129 |
const std::vector<std::string>& mbids, |
| 130 |
const std::vector<std::string>& artistnames = std::vector<std::string>(), |
| 131 |
const std::vector<std::string>& artisthints = std::vector<std::string>(), |
| 132 |
const std::vector<std::string>& artistmbids = std::vector<std::string>()); |
| 133 |
|
| 134 |
|
| 135 |
|
| 136 |
|
| 137 |
|
| 138 |
|
| 139 |
|
| 140 |
|
| 141 |
bool Load(const TiXmlElement *element, bool append = false, bool prioritise = false); |
| 142 |
bool Save(TiXmlNode *node, const std::string &tag, const std::string& strPath); |
| 143 |
|
| 144 |
int idAlbum = -1; |
| 145 |
std::string strAlbum; |
| 146 |
std::string strMusicBrainzAlbumID; |
| 147 |
std::string strReleaseGroupMBID; |
| 148 |
std::string strArtistDesc; |
| 149 |
std::string strArtistSort; |
| 150 |
VECARTISTCREDITS artistCredits; |
| 151 |
std::vector<std::string> genre; |
| 152 |
CScraperUrl thumbURL; |
| 153 |
std::vector<std::string> moods; |
| 154 |
std::vector<std::string> styles; |
| 155 |
std::vector<std::string> themes; |
| 156 |
std::map<std::string, std::string> art; |
| 157 |
std::string strReview; |
| 158 |
std::string strLabel; |
| 159 |
std::string strType; |
| 160 |
std::string strReleaseStatus; |
| 161 |
std::string strPath; |
| 162 |
float fRating = -1; |
| 163 |
int iUserrating = -1; |
| 164 |
int iVotes = -1; |
| 165 |
std::string strReleaseDate; |
| 166 |
std::string strOrigReleaseDate; |
| 167 |
bool bBoxedSet = false; |
| 168 |
bool bCompilation = false; |
| 169 |
int iTimesPlayed = 0; |
| 170 |
CDateTime dateAdded; |
| 171 |
CDateTime dateUpdated; |
| 172 |
CDateTime dateNew; |
| 173 |
CDateTime lastPlayed; |
| 174 |
int iTotalDiscs = -1; |
| 175 |
VECSONGS songs; |
| 176 |
ReleaseType releaseType = Album; |
| 177 |
std::string strLastScraped; |
| 178 |
bool bScrapedMBID = false; |
| 179 |
bool bArtistSongMerge = false; |
| 180 |
int iAlbumDuration = 0; |
| 181 |
}; |
| 182 |
|
| 183 |
typedef std::vector<CAlbum> VECALBUMS; |