3 * Copyright (C) 2005-2008 Team XBMC
6 * This Program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
11 * This Program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with XBMC; see the file COPYING. If not, write to
18 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
19 * http://www.gnu.org/copyleft/gpl.html
25 #include "XBDateTime.h"
26 #include "utils/ScraperUrl.h"
27 #include "utils/Fanart.h"
28 #include "utils/ISortable.h"
29 #include "utils/StreamDetails.h"
30 #include "video/Bookmark.h"
31 #include "XBDateTime.h"
45 class CVideoInfoTag : public IArchivable, public ISerializable, public ISortable
48 CVideoInfoTag() { Reset(); };
50 /* \brief Load information to a videoinfotag from an XML element
51 There are three types of tags supported:
52 1. Single-value tags, such as <title>. These are set if available, else are left untouched.
53 2. Additive tags, such as <set> or <genre>. These are appended to or replaced (if available) based on the value
54 of the prioritise parameter. In addition, a clear attribute is available in the XML to clear the current value prior
56 3. Image tags such as <thumb> and <fanart>. If the prioritise value is specified, any additional values are prepended
57 to the existing values.
59 \param element the root XML element to parse.
60 \param append whether information should be added to the existing tag, or whether it should be reset first.
61 \param prioritise if appending, whether additive tags should be prioritised (i.e. replace or prepend) over existing values. Defaults to false.
65 bool Load(const TiXmlElement *element, bool append = false, bool prioritise = false);
66 bool Save(TiXmlNode *node, const CStdString &tag, bool savePathInfo = true, const TiXmlElement *additionalNode = NULL);
67 virtual void Archive(CArchive& ar);
68 virtual void Serialize(CVariant& value);
69 virtual void ToSortable(SortItem& sortable);
70 const CStdString GetCast(bool bIncludeRole = false) const;
71 bool HasStreamDetails() const;
74 const CStdString& GetPath() const
76 if (m_strFileNameAndPath.IsEmpty())
78 return m_strFileNameAndPath;
81 CStdString m_basePath; // the base path of the video, for folder-based lookups
82 int m_parentPathID; // the parent path id where the base path of the video lies
83 std::vector<std::string> m_director;
84 std::vector<std::string> m_writingCredits;
85 std::vector<std::string> m_genre;
86 std::vector<std::string> m_country;
87 CStdString m_strTagLine;
88 CStdString m_strPlotOutline;
89 CStdString m_strTrailer;
91 CScraperUrl m_strPictureURL;
92 CStdString m_strTitle;
93 CStdString m_strSortTitle;
94 CStdString m_strVotes;
95 std::vector<std::string> m_artist;
96 std::vector< SActorInfo > m_cast;
97 typedef std::vector< SActorInfo >::const_iterator iCast;
98 std::vector<std::string> m_set;
99 std::vector<int> m_setId;
100 std::vector<std::string> m_tags;
101 CStdString m_strRuntime;
102 CStdString m_strFile;
103 CStdString m_strPath;
104 CStdString m_strIMDBNumber;
105 CStdString m_strMPAARating;
106 CStdString m_strFileNameAndPath;
107 CStdString m_strOriginalTitle;
108 CStdString m_strEpisodeGuide;
109 CDateTime m_premiered;
110 CStdString m_strStatus;
111 CStdString m_strProductionCode;
112 CDateTime m_firstAired;
113 CStdString m_strShowTitle;
114 std::vector<std::string> m_studio;
115 CStdString m_strAlbum;
116 CDateTime m_lastPlayed;
117 std::vector<std::string> m_showLink;
118 CStdString m_strShowPath;
126 int m_iSpecialSortSeason;
127 int m_iSpecialSortEpisode;
135 CStreamDetails m_streamDetails;
136 CBookmark m_resumePoint;
137 CDateTime m_dateAdded;
141 /* \brief Parse our native XML format for video info.
142 See Load for a description of the available tag types.
144 \param element the root XML element to parse.
145 \param prioritise whether additive tags should be replaced (or prepended) by the content of the tags, or appended to.
148 void ParseNative(const TiXmlElement* element, bool prioritise);
151 typedef std::vector<CVideoInfoTag> VECMOVIES;