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"
29 explicit CAlbum(const CFileItem
& item
);
31 bool operator<(const CAlbum
&a
) const;
32 void MergeScrapedAlbum(const CAlbum
& album
, bool override
= true);
38 strMusicBrainzAlbumID
.clear();
39 strReleaseGroupMBID
.clear();
40 artistCredits
.clear();
41 strArtistDesc
.clear();
42 strArtistSort
.clear();
52 strReleaseStatus
.clear();
57 strOrigReleaseDate
.clear();
58 strReleaseDate
.clear();
69 strLastScraped
.clear();
71 bArtistSongMerge
= false;
75 /*! \brief Get album artist names from the vector of artistcredits objects
76 \return album artist names as a vector of strings
78 const std::vector
<std::string
> GetAlbumArtist() const;
80 /*! \brief Get album artist MusicBrainz IDs from the vector of artistcredits objects
81 \return album artist MusicBrainz IDs as a vector of strings
83 const std::vector
<std::string
> GetMusicBrainzAlbumArtistID() const;
84 std::string
GetGenreString() const;
86 /*! \brief Get album artist names from the artist description string (if it exists)
87 or concatenated from the vector of artistcredits objects
88 \return album artist names as a single string
90 const std::string
GetAlbumArtistString() const;
92 /*! \brief Get album artist sort name from the artist sort string (if it exists)
93 or concatenated from the vector of artistcredits objects
94 \return album artist sort names as a single string
96 const std::string
GetAlbumArtistSort() const;
98 /*! \brief Get album artist IDs (for json rpc) from the vector of artistcredits objects
99 \return album artist IDs as a vector of integers
101 const std::vector
<int> GetArtistIDArray() const;
103 typedef enum ReleaseType
{
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
);
115 static std::string
ReleaseTypeToString(ReleaseType releaseType
);
116 static ReleaseType
ReleaseTypeFromString(const std::string
& strReleaseType
);
118 /*! \brief Set album artist credits using the arrays of tag values.
119 If strArtistSort (as from ALBUMARTISTSORT tag) is already set then individual
120 artist sort names are also processed.
121 \param names String vector of albumartist names (as from ALBUMARTIST tag)
122 \param hints String vector of albumartist name hints (as from ALBUMARTISTS tag)
123 \param mbids String vector of albumartist Musicbrainz IDs (as from MUSICBRAINZABUMARTISTID tag)
124 \param artistnames String vector of artist names (as from ARTIST tag)
125 \param artisthints String vector of artist name hints (as from ARTISTS tag)
126 \param artistmbids String vector of artist Musicbrainz IDs (as from MUSICBRAINZARTISTID tag)
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
>());
134 /*! \brief Load album information from an XML file.
135 See CVideoInfoTag::Load for a description of the types of elements we load.
136 \param element the root XML element to parse.
137 \param append whether information should be added to the existing tag, or whether it should be reset first.
138 \param prioritise if appending, whether additive tags should be prioritised (i.e. replace or prepend) over existing values. Defaults to false.
139 \sa CVideoInfoTag::Load
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
);
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
;
160 std::string strReleaseStatus
;
163 int iUserrating
= -1;
165 std::string strReleaseDate
;
166 std::string strOrigReleaseDate
;
167 bool bBoxedSet
= false;
168 bool bCompilation
= false;
169 int iTimesPlayed
= 0;
170 CDateTime dateAdded
; // From related file creation or modification times, or when (re-)scanned
171 CDateTime dateUpdated
; // Time db record Last modified
172 CDateTime dateNew
; // Time db record created
173 CDateTime lastPlayed
;
174 int iTotalDiscs
= -1;
175 VECSONGS songs
; ///< Local songs
176 ReleaseType releaseType
= Album
;
177 std::string strLastScraped
;
178 bool bScrapedMBID
= false;
179 bool bArtistSongMerge
= false;
180 int iAlbumDuration
= 0;
183 typedef std::vector
<CAlbum
> VECALBUMS
;