2 * Copyright (C) 2005-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
18 #include "XBDateTime.h"
19 #include "utils/ScraperUrl.h"
30 explicit CAlbum(const CFileItem
& item
);
32 bool operator<(const CAlbum
&a
) const;
33 void MergeScrapedAlbum(const CAlbum
& album
, bool override
= true);
39 strMusicBrainzAlbumID
.clear();
40 strReleaseGroupMBID
.clear();
41 artistCredits
.clear();
42 strArtistDesc
.clear();
43 strArtistSort
.clear();
53 strReleaseStatus
.clear();
58 strOrigReleaseDate
.clear();
59 strReleaseDate
.clear();
70 strLastScraped
.clear();
72 bArtistSongMerge
= false;
76 /*! \brief Get album artist names from the vector of artistcredits objects
77 \return album artist names as a vector of strings
79 const std::vector
<std::string
> GetAlbumArtist() const;
81 /*! \brief Get album artist MusicBrainz IDs from the vector of artistcredits objects
82 \return album artist MusicBrainz IDs as a vector of strings
84 const std::vector
<std::string
> GetMusicBrainzAlbumArtistID() const;
85 std::string
GetGenreString() const;
87 /*! \brief Get album artist names from the artist description string (if it exists)
88 or concatenated from the vector of artistcredits objects
89 \return album artist names as a single string
91 const std::string
GetAlbumArtistString() const;
93 /*! \brief Get album artist sort name from the artist sort string (if it exists)
94 or concatenated from the vector of artistcredits objects
95 \return album artist sort names as a single string
97 const std::string
GetAlbumArtistSort() const;
99 /*! \brief Get album artist IDs (for json rpc) from the vector of artistcredits objects
100 \return album artist IDs as a vector of integers
102 const std::vector
<int> GetArtistIDArray() const;
104 typedef enum ReleaseType
{
109 std::string
GetReleaseType() const;
110 void SetReleaseType(const std::string
& strReleaseType
);
111 void SetDateAdded(const std::string
& strDateAdded
);
112 void SetDateUpdated(const std::string
& strDateUpdated
);
113 void SetDateNew(const std::string
& strDateNew
);
114 void SetLastPlayed(const std::string
& strLastPlayed
);
116 static std::string
ReleaseTypeToString(ReleaseType releaseType
);
117 static ReleaseType
ReleaseTypeFromString(const std::string
& strReleaseType
);
119 /*! \brief Set album artist credits using the arrays of tag values.
120 If strArtistSort (as from ALBUMARTISTSORT tag) is already set then individual
121 artist sort names are also processed.
122 \param names String vector of albumartist names (as from ALBUMARTIST tag)
123 \param hints String vector of albumartist name hints (as from ALBUMARTISTS tag)
124 \param mbids String vector of albumartist Musicbrainz IDs (as from MUSICBRAINZABUMARTISTID tag)
125 \param artistnames String vector of artist names (as from ARTIST tag)
126 \param artisthints String vector of artist name hints (as from ARTISTS tag)
127 \param artistmbids String vector of artist Musicbrainz IDs (as from MUSICBRAINZARTISTID tag)
129 void SetArtistCredits(const std::vector
<std::string
>& names
, const std::vector
<std::string
>& hints
,
130 const std::vector
<std::string
>& mbids
,
131 const std::vector
<std::string
>& artistnames
= std::vector
<std::string
>(),
132 const std::vector
<std::string
>& artisthints
= std::vector
<std::string
>(),
133 const std::vector
<std::string
>& artistmbids
= std::vector
<std::string
>());
135 /*! \brief Load album information from an XML file.
136 See CVideoInfoTag::Load for a description of the types of elements we load.
137 \param element the root XML element to parse.
138 \param append whether information should be added to the existing tag, or whether it should be reset first.
139 \param prioritise if appending, whether additive tags should be prioritised (i.e. replace or prepend) over existing values. Defaults to false.
140 \sa CVideoInfoTag::Load
142 bool Load(const TiXmlElement
*element
, bool append
= false, bool prioritise
= false);
143 bool Save(TiXmlNode
*node
, const std::string
&tag
, const std::string
& strPath
);
146 std::string strAlbum
;
147 std::string strMusicBrainzAlbumID
;
148 std::string strReleaseGroupMBID
;
149 std::string strArtistDesc
;
150 std::string strArtistSort
;
151 VECARTISTCREDITS artistCredits
;
152 std::vector
<std::string
> genre
;
153 CScraperUrl thumbURL
;
154 std::vector
<std::string
> moods
;
155 std::vector
<std::string
> styles
;
156 std::vector
<std::string
> themes
;
157 std::map
<std::string
, std::string
> art
;
158 std::string strReview
;
159 std::string strLabel
;
161 std::string strReleaseStatus
;
164 int iUserrating
= -1;
166 std::string strReleaseDate
;
167 std::string strOrigReleaseDate
;
168 bool bBoxedSet
= false;
169 bool bCompilation
= false;
170 int iTimesPlayed
= 0;
171 CDateTime dateAdded
; // From related file creation or modification times, or when (re-)scanned
172 CDateTime dateUpdated
; // Time db record Last modified
173 CDateTime dateNew
; // Time db record created
174 CDateTime lastPlayed
;
175 int iTotalDiscs
= -1;
176 VECSONGS songs
; ///< Local songs
177 ReleaseType releaseType
= Album
;
178 std::string strLastScraped
;
179 bool bScrapedMBID
= false;
180 bool bArtistSongMerge
= false;
181 int iAlbumDuration
= 0;
184 typedef std::vector
<CAlbum
> VECALBUMS
;