4 * Copyright (C) 2005-2013 Team XBMC
7 * This Program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2, or (at your option)
12 * This Program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with XBMC; see the file COPYING. If not, see
19 * <http://www.gnu.org/licenses/>.
26 #include "utils/ScraperUrl.h"
27 #include "utils/Fanart.h"
37 bool operator<(const CArtist& a) const
39 if (strMusicBrainzArtistID.empty() && a.strMusicBrainzArtistID.empty())
41 if (strArtist < a.strArtist) return true;
42 if (strArtist > a.strArtist) return false;
46 if (strMusicBrainzArtistID < a.strMusicBrainzArtistID) return true;
47 if (strMusicBrainzArtistID > a.strMusicBrainzArtistID) return false;
51 void MergeScrapedArtist(const CArtist& source, bool override = true);
72 /*! \brief Load artist information from an XML file.
73 See CVideoInfoTag::Load for a description of the types of elements we load.
74 \param element the root XML element to parse.
75 \param append whether information should be added to the existing tag, or whether it should be reset first.
76 \param prioritise if appending, whether additive tags should be prioritised (i.e. replace or prepend) over existing values. Defaults to false.
77 \sa CVideoInfoTag::Load
79 bool Load(const TiXmlElement *element, bool append = false, bool prioritise = false);
80 bool Save(TiXmlNode *node, const CStdString &tag, const CStdString& strPath);
83 CStdString strMusicBrainzArtistID;
84 std::vector<std::string> genre;
85 CStdString strBiography;
86 std::vector<std::string> styles;
87 std::vector<std::string> moods;
88 std::vector<std::string> instruments;
92 CStdString strDisbanded;
93 std::vector<std::string> yearsActive;
97 std::vector<std::pair<CStdString,CStdString> > discography;
103 friend class CMusicDatabase;
107 CArtistCredit(std::string strArtist, std::string strJoinPhrase) : m_strArtist(strArtist), m_strJoinPhrase(strJoinPhrase), m_boolFeatured(false) { }
108 CArtistCredit(std::string strArtist, std::string strMusicBrainzArtistID, std::string strJoinPhrase)
109 : m_strArtist(strArtist), m_strMusicBrainzArtistID(strMusicBrainzArtistID), m_strJoinPhrase(strJoinPhrase), m_boolFeatured(false) { }
110 bool operator<(const CArtistCredit& a) const
112 if (m_strMusicBrainzArtistID.empty() && a.m_strMusicBrainzArtistID.empty())
114 if (m_strArtist < a.m_strArtist) return true;
115 if (m_strArtist > a.m_strArtist) return false;
119 if (m_strMusicBrainzArtistID < a.m_strMusicBrainzArtistID) return true;
120 if (m_strMusicBrainzArtistID > a.m_strMusicBrainzArtistID) return false;
124 std::string GetArtist() const { return m_strArtist; }
125 std::string GetMusicBrainzArtistID() const { return m_strMusicBrainzArtistID; }
126 std::string GetJoinPhrase() const { return m_strJoinPhrase; }
127 int GetArtistId() const { return idArtist; }
128 void SetArtist(const std::string &strArtist) { m_strArtist = strArtist; }
129 void SetMusicBrainzArtistID(const std::string &strMusicBrainzArtistID) { m_strMusicBrainzArtistID = strMusicBrainzArtistID; }
130 void SetJoinPhrase(const std::string &strJoinPhrase) { m_strJoinPhrase = strJoinPhrase; }
131 void SetArtistId(int idArtist) { this->idArtist = idArtist; }
135 std::string m_strArtist;
136 std::string m_strMusicBrainzArtistID;
137 std::string m_strJoinPhrase;
141 typedef std::vector<CArtist> VECARTISTS;
142 typedef std::vector<CArtistCredit> VECARTISTCREDITS;