3 * Copyright (C) 2005-2013 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, see
18 * <http://www.gnu.org/licenses/>.
21 #include "dbwrappers/Database.h"
22 #include "VideoInfoTag.h"
23 #include "addons/Scraper.h"
25 #include "utils/SortUtils.h"
26 #include "video/VideoDbUrl.h"
34 class CGUIDialogProgress;
35 class CGUIDialogProgressBarHandle;
40 typedef std::vector<field_value> sql_record;
45 #define my_offsetof(TYPE, MEMBER) offsetof(TYPE, MEMBER)
48 Custom version of standard offsetof() macro which can be used to get
49 offsets of members in class for non-POD types (according to the current
50 version of C++ standard offsetof() macro can't be used in such cases and
51 attempt to do so causes warnings to be emitted, OTOH in many cases it is
52 still OK to assume that all instances of the class has the same offsets
53 for the same members).
55 #define my_offsetof(TYPE, MEMBER) \
56 ((size_t)((char *)&(((TYPE *)0x10)->MEMBER) - (char*)0x10))
60 typedef std::vector<CVideoInfoTag> VECMOVIES;
64 class IVideoInfoScannerObserver;
68 // these defines are based on how many columns we have and which column certain data is going to be in
69 // when we do GetDetailsForMovie()
70 #define VIDEODB_MAX_COLUMNS 24
71 #define VIDEODB_DETAILS_FILEID 1
73 #define VIDEODB_DETAILS_MOVIE_SET_ID VIDEODB_MAX_COLUMNS + 2
74 #define VIDEODB_DETAILS_MOVIE_SET_NAME VIDEODB_MAX_COLUMNS + 3
75 #define VIDEODB_DETAILS_MOVIE_FILE VIDEODB_MAX_COLUMNS + 4
76 #define VIDEODB_DETAILS_MOVIE_PATH VIDEODB_MAX_COLUMNS + 5
77 #define VIDEODB_DETAILS_MOVIE_PLAYCOUNT VIDEODB_MAX_COLUMNS + 6
78 #define VIDEODB_DETAILS_MOVIE_LASTPLAYED VIDEODB_MAX_COLUMNS + 7
79 #define VIDEODB_DETAILS_MOVIE_DATEADDED VIDEODB_MAX_COLUMNS + 8
80 #define VIDEODB_DETAILS_MOVIE_RESUME_TIME VIDEODB_MAX_COLUMNS + 9
81 #define VIDEODB_DETAILS_MOVIE_TOTAL_TIME VIDEODB_MAX_COLUMNS + 10
83 #define VIDEODB_DETAILS_EPISODE_TVSHOW_ID VIDEODB_MAX_COLUMNS + 2
84 #define VIDEODB_DETAILS_EPISODE_FILE VIDEODB_MAX_COLUMNS + 3
85 #define VIDEODB_DETAILS_EPISODE_PATH VIDEODB_MAX_COLUMNS + 4
86 #define VIDEODB_DETAILS_EPISODE_PLAYCOUNT VIDEODB_MAX_COLUMNS + 5
87 #define VIDEODB_DETAILS_EPISODE_LASTPLAYED VIDEODB_MAX_COLUMNS + 6
88 #define VIDEODB_DETAILS_EPISODE_DATEADDED VIDEODB_MAX_COLUMNS + 7
89 #define VIDEODB_DETAILS_EPISODE_TVSHOW_NAME VIDEODB_MAX_COLUMNS + 8
90 #define VIDEODB_DETAILS_EPISODE_TVSHOW_STUDIO VIDEODB_MAX_COLUMNS + 9
91 #define VIDEODB_DETAILS_EPISODE_TVSHOW_AIRED VIDEODB_MAX_COLUMNS + 10
92 #define VIDEODB_DETAILS_EPISODE_TVSHOW_MPAA VIDEODB_MAX_COLUMNS + 11
93 #define VIDEODB_DETAILS_EPISODE_TVSHOW_PATH VIDEODB_MAX_COLUMNS + 12
94 #define VIDEODB_DETAILS_EPISODE_RESUME_TIME VIDEODB_MAX_COLUMNS + 13
95 #define VIDEODB_DETAILS_EPISODE_TOTAL_TIME VIDEODB_MAX_COLUMNS + 14
96 #define VIDEODB_DETAILS_EPISODE_SEASON_ID VIDEODB_MAX_COLUMNS + 15
98 #define VIDEODB_DETAILS_TVSHOW_PATH VIDEODB_MAX_COLUMNS + 1
99 #define VIDEODB_DETAILS_TVSHOW_DATEADDED VIDEODB_MAX_COLUMNS + 2
100 #define VIDEODB_DETAILS_TVSHOW_LASTPLAYED VIDEODB_MAX_COLUMNS + 3
101 #define VIDEODB_DETAILS_TVSHOW_NUM_EPISODES VIDEODB_MAX_COLUMNS + 4
102 #define VIDEODB_DETAILS_TVSHOW_NUM_WATCHED VIDEODB_MAX_COLUMNS + 5
103 #define VIDEODB_DETAILS_TVSHOW_NUM_SEASONS VIDEODB_MAX_COLUMNS + 6
105 #define VIDEODB_DETAILS_MUSICVIDEO_FILE VIDEODB_MAX_COLUMNS + 2
106 #define VIDEODB_DETAILS_MUSICVIDEO_PATH VIDEODB_MAX_COLUMNS + 3
107 #define VIDEODB_DETAILS_MUSICVIDEO_PLAYCOUNT VIDEODB_MAX_COLUMNS + 4
108 #define VIDEODB_DETAILS_MUSICVIDEO_LASTPLAYED VIDEODB_MAX_COLUMNS + 5
109 #define VIDEODB_DETAILS_MUSICVIDEO_DATEADDED VIDEODB_MAX_COLUMNS + 6
110 #define VIDEODB_DETAILS_MUSICVIDEO_RESUME_TIME VIDEODB_MAX_COLUMNS + 7
111 #define VIDEODB_DETAILS_MUSICVIDEO_TOTAL_TIME VIDEODB_MAX_COLUMNS + 8
113 #define VIDEODB_TYPE_STRING 1
114 #define VIDEODB_TYPE_INT 2
115 #define VIDEODB_TYPE_FLOAT 3
116 #define VIDEODB_TYPE_BOOL 4
117 #define VIDEODB_TYPE_COUNT 5
118 #define VIDEODB_TYPE_STRINGARRAY 6
119 #define VIDEODB_TYPE_DATE 7
120 #define VIDEODB_TYPE_DATETIME 8
124 VIDEODB_CONTENT_MOVIES = 1,
125 VIDEODB_CONTENT_TVSHOWS = 2,
126 VIDEODB_CONTENT_MUSICVIDEOS = 3,
127 VIDEODB_CONTENT_EPISODES = 4,
128 VIDEODB_CONTENT_MOVIE_SETS = 5
129 } VIDEODB_CONTENT_TYPE;
131 typedef enum // this enum MUST match the offset struct further down!! and make sure to keep min and max at -1 and sizeof(offsets)
134 VIDEODB_ID_TITLE = 0,
136 VIDEODB_ID_PLOTOUTLINE = 2,
137 VIDEODB_ID_TAGLINE = 3,
138 VIDEODB_ID_VOTES = 4,
139 VIDEODB_ID_RATING = 5,
140 VIDEODB_ID_CREDITS = 6,
142 VIDEODB_ID_THUMBURL = 8,
143 VIDEODB_ID_IDENT = 9,
144 VIDEODB_ID_SORTTITLE = 10,
145 VIDEODB_ID_RUNTIME = 11,
146 VIDEODB_ID_MPAA = 12,
147 VIDEODB_ID_TOP250 = 13,
148 VIDEODB_ID_GENRE = 14,
149 VIDEODB_ID_DIRECTOR = 15,
150 VIDEODB_ID_ORIGINALTITLE = 16,
151 VIDEODB_ID_THUMBURL_SPOOF = 17,
152 VIDEODB_ID_STUDIOS = 18,
153 VIDEODB_ID_TRAILER = 19,
154 VIDEODB_ID_FANART = 20,
155 VIDEODB_ID_COUNTRY = 21,
156 VIDEODB_ID_BASEPATH = 22,
157 VIDEODB_ID_PARENTPATHID = 23,
161 const struct SDbTableOffsets
167 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strTitle) },
168 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strPlot) },
169 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strPlotOutline) },
170 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strTagLine) },
171 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strVotes) },
172 { VIDEODB_TYPE_FLOAT, my_offsetof(CVideoInfoTag,m_fRating) },
173 { VIDEODB_TYPE_STRINGARRAY, my_offsetof(CVideoInfoTag,m_writingCredits) },
174 { VIDEODB_TYPE_INT, my_offsetof(CVideoInfoTag,m_iYear) },
175 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strPictureURL.m_xml) },
176 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strIMDBNumber) },
177 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strSortTitle) },
178 { VIDEODB_TYPE_INT, my_offsetof(CVideoInfoTag,m_duration) },
179 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strMPAARating) },
180 { VIDEODB_TYPE_INT, my_offsetof(CVideoInfoTag,m_iTop250) },
181 { VIDEODB_TYPE_STRINGARRAY, my_offsetof(CVideoInfoTag,m_genre) },
182 { VIDEODB_TYPE_STRINGARRAY, my_offsetof(CVideoInfoTag,m_director) },
183 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strOriginalTitle) },
184 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strPictureURL.m_spoof) },
185 { VIDEODB_TYPE_STRINGARRAY, my_offsetof(CVideoInfoTag,m_studio) },
186 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strTrailer) },
187 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_fanart.m_xml) },
188 { VIDEODB_TYPE_STRINGARRAY, my_offsetof(CVideoInfoTag,m_country) },
189 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_basePath) },
190 { VIDEODB_TYPE_INT, my_offsetof(CVideoInfoTag,m_parentPathID) }
193 typedef enum // this enum MUST match the offset struct further down!! and make sure to keep min and max at -1 and sizeof(offsets)
195 VIDEODB_ID_TV_MIN = -1,
196 VIDEODB_ID_TV_TITLE = 0,
197 VIDEODB_ID_TV_PLOT = 1,
198 VIDEODB_ID_TV_STATUS = 2,
199 VIDEODB_ID_TV_VOTES = 3,
200 VIDEODB_ID_TV_RATING = 4,
201 VIDEODB_ID_TV_PREMIERED = 5,
202 VIDEODB_ID_TV_THUMBURL = 6,
203 VIDEODB_ID_TV_THUMBURL_SPOOF = 7,
204 VIDEODB_ID_TV_GENRE = 8,
205 VIDEODB_ID_TV_ORIGINALTITLE = 9,
206 VIDEODB_ID_TV_EPISODEGUIDE = 10,
207 VIDEODB_ID_TV_FANART = 11,
208 VIDEODB_ID_TV_IDENT = 12,
209 VIDEODB_ID_TV_MPAA = 13,
210 VIDEODB_ID_TV_STUDIOS = 14,
211 VIDEODB_ID_TV_SORTTITLE = 15,
212 VIDEODB_ID_TV_BASEPATH = 16,
213 VIDEODB_ID_TV_PARENTPATHID = 17,
217 const struct SDbTableOffsets DbTvShowOffsets[] =
219 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strTitle) },
220 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strPlot) },
221 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strStatus) },
222 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strVotes) },
223 { VIDEODB_TYPE_FLOAT, my_offsetof(CVideoInfoTag,m_fRating) },
224 { VIDEODB_TYPE_DATE, my_offsetof(CVideoInfoTag,m_premiered) },
225 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strPictureURL.m_xml) },
226 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strPictureURL.m_spoof) },
227 { VIDEODB_TYPE_STRINGARRAY, my_offsetof(CVideoInfoTag,m_genre) },
228 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strOriginalTitle)},
229 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strEpisodeGuide)},
230 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_fanart.m_xml)},
231 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strIMDBNumber)},
232 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strMPAARating)},
233 { VIDEODB_TYPE_STRINGARRAY, my_offsetof(CVideoInfoTag,m_studio)},
234 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strSortTitle)},
235 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_basePath) },
236 { VIDEODB_TYPE_INT, my_offsetof(CVideoInfoTag,m_parentPathID) }
239 typedef enum // this enum MUST match the offset struct further down!! and make sure to keep min and max at -1 and sizeof(offsets)
241 VIDEODB_ID_EPISODE_MIN = -1,
242 VIDEODB_ID_EPISODE_TITLE = 0,
243 VIDEODB_ID_EPISODE_PLOT = 1,
244 VIDEODB_ID_EPISODE_VOTES = 2,
245 VIDEODB_ID_EPISODE_RATING = 3,
246 VIDEODB_ID_EPISODE_CREDITS = 4,
247 VIDEODB_ID_EPISODE_AIRED = 5,
248 VIDEODB_ID_EPISODE_THUMBURL = 6,
249 VIDEODB_ID_EPISODE_THUMBURL_SPOOF = 7,
250 VIDEODB_ID_EPISODE_PLAYCOUNT = 8, // unused - feel free to repurpose
251 VIDEODB_ID_EPISODE_RUNTIME = 9,
252 VIDEODB_ID_EPISODE_DIRECTOR = 10,
253 VIDEODB_ID_EPISODE_IDENT = 11,
254 VIDEODB_ID_EPISODE_SEASON = 12,
255 VIDEODB_ID_EPISODE_EPISODE = 13,
256 VIDEODB_ID_EPISODE_ORIGINALTITLE = 14,
257 VIDEODB_ID_EPISODE_SORTSEASON = 15,
258 VIDEODB_ID_EPISODE_SORTEPISODE = 16,
259 VIDEODB_ID_EPISODE_BOOKMARK = 17,
260 VIDEODB_ID_EPISODE_BASEPATH = 18,
261 VIDEODB_ID_EPISODE_PARENTPATHID = 19,
262 VIDEODB_ID_EPISODE_UNIQUEID = 20,
263 VIDEODB_ID_EPISODE_MAX
264 } VIDEODB_EPISODE_IDS;
266 const struct SDbTableOffsets DbEpisodeOffsets[] =
268 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strTitle) },
269 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strPlot) },
270 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strVotes) },
271 { VIDEODB_TYPE_FLOAT, my_offsetof(CVideoInfoTag,m_fRating) },
272 { VIDEODB_TYPE_STRINGARRAY, my_offsetof(CVideoInfoTag,m_writingCredits) },
273 { VIDEODB_TYPE_DATE, my_offsetof(CVideoInfoTag,m_firstAired) },
274 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strPictureURL.m_xml) },
275 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strPictureURL.m_spoof) },
276 { VIDEODB_TYPE_COUNT, my_offsetof(CVideoInfoTag,m_playCount) }, // unused
277 { VIDEODB_TYPE_INT, my_offsetof(CVideoInfoTag,m_duration) },
278 { VIDEODB_TYPE_STRINGARRAY, my_offsetof(CVideoInfoTag,m_director) },
279 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strProductionCode) },
280 { VIDEODB_TYPE_INT, my_offsetof(CVideoInfoTag,m_iSeason) },
281 { VIDEODB_TYPE_INT, my_offsetof(CVideoInfoTag,m_iEpisode) },
282 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strOriginalTitle)},
283 { VIDEODB_TYPE_INT, my_offsetof(CVideoInfoTag,m_iSpecialSortSeason) },
284 { VIDEODB_TYPE_INT, my_offsetof(CVideoInfoTag,m_iSpecialSortEpisode) },
285 { VIDEODB_TYPE_INT, my_offsetof(CVideoInfoTag,m_iBookmarkId) },
286 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_basePath) },
287 { VIDEODB_TYPE_INT, my_offsetof(CVideoInfoTag,m_parentPathID) },
288 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strUniqueId) }
291 typedef enum // this enum MUST match the offset struct further down!! and make sure to keep min and max at -1 and sizeof(offsets)
293 VIDEODB_ID_MUSICVIDEO_MIN = -1,
294 VIDEODB_ID_MUSICVIDEO_TITLE = 0,
295 VIDEODB_ID_MUSICVIDEO_THUMBURL = 1,
296 VIDEODB_ID_MUSICVIDEO_THUMBURL_SPOOF = 2,
297 VIDEODB_ID_MUSICVIDEO_PLAYCOUNT = 3, // unused - feel free to repurpose
298 VIDEODB_ID_MUSICVIDEO_RUNTIME = 4,
299 VIDEODB_ID_MUSICVIDEO_DIRECTOR = 5,
300 VIDEODB_ID_MUSICVIDEO_STUDIOS = 6,
301 VIDEODB_ID_MUSICVIDEO_YEAR = 7,
302 VIDEODB_ID_MUSICVIDEO_PLOT = 8,
303 VIDEODB_ID_MUSICVIDEO_ALBUM = 9,
304 VIDEODB_ID_MUSICVIDEO_ARTIST = 10,
305 VIDEODB_ID_MUSICVIDEO_GENRE = 11,
306 VIDEODB_ID_MUSICVIDEO_TRACK = 12,
307 VIDEODB_ID_MUSICVIDEO_BASEPATH = 13,
308 VIDEODB_ID_MUSICVIDEO_PARENTPATHID = 14,
309 VIDEODB_ID_MUSICVIDEO_MAX
310 } VIDEODB_MUSICVIDEO_IDS;
312 const struct SDbTableOffsets DbMusicVideoOffsets[] =
314 { VIDEODB_TYPE_STRING, my_offsetof(class CVideoInfoTag,m_strTitle) },
315 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strPictureURL.m_xml) },
316 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strPictureURL.m_spoof) },
317 { VIDEODB_TYPE_COUNT, my_offsetof(CVideoInfoTag,m_playCount) }, // unused
318 { VIDEODB_TYPE_INT, my_offsetof(CVideoInfoTag,m_duration) },
319 { VIDEODB_TYPE_STRINGARRAY, my_offsetof(CVideoInfoTag,m_director) },
320 { VIDEODB_TYPE_STRINGARRAY, my_offsetof(CVideoInfoTag,m_studio) },
321 { VIDEODB_TYPE_INT, my_offsetof(CVideoInfoTag,m_iYear) },
322 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strPlot) },
323 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_strAlbum) },
324 { VIDEODB_TYPE_STRINGARRAY, my_offsetof(CVideoInfoTag,m_artist) },
325 { VIDEODB_TYPE_STRINGARRAY, my_offsetof(CVideoInfoTag,m_genre) },
326 { VIDEODB_TYPE_INT, my_offsetof(CVideoInfoTag,m_iTrack) },
327 { VIDEODB_TYPE_STRING, my_offsetof(CVideoInfoTag,m_basePath) },
328 { VIDEODB_TYPE_INT, my_offsetof(CVideoInfoTag,m_parentPathID) }
331 #define COMPARE_PERCENTAGE 0.90f // 90%
332 #define COMPARE_PERCENTAGE_MIN 0.50f // 50%
334 class CVideoDatabase : public CDatabase
338 class CActor // used for actor retrieval for non-master users
346 class CSeason // used for season retrieval for non-master users
350 std::vector<std::string> genre;
361 DatabaseResults results;
364 CVideoDatabase(void);
365 virtual ~CVideoDatabase(void);
368 virtual bool CommitTransaction();
370 int AddMovie(const CStdString& strFilenameAndPath);
371 int AddEpisode(int idShow, const CStdString& strFilenameAndPath);
374 /*! \brief Set the playcount of an item
375 Sets the playcount and last played date to a given value
376 \param item CFileItem to set the playcount for
377 \param count The playcount to set.
378 \param date The date the file was last viewed (does not denote the video was watched to completion). If empty we current datetime (if count > 0) or never viewed (if count = 0).
379 \sa GetPlayCount, IncrementPlayCount, UpdateLastPlayed
381 void SetPlayCount(const CFileItem &item, int count, const CDateTime &date = CDateTime());
383 /*! \brief Increment the playcount of an item
384 Increments the playcount and updates the last played date
385 \param item CFileItem to increment the playcount for
386 \sa GetPlayCount, SetPlayCount, GetPlayCounts
388 void IncrementPlayCount(const CFileItem &item);
390 /*! \brief Get the playcount of an item
391 \param item CFileItem to get the playcount for
392 \return the playcount of the item, or -1 on error
393 \sa SetPlayCount, IncrementPlayCount, GetPlayCounts
395 int GetPlayCount(const CFileItem &item);
397 /*! \brief Update the last played time of an item
398 Updates the last played date
399 \param item CFileItem to update the last played time for
400 \sa GetPlayCount, SetPlayCount, IncrementPlayCount, GetPlayCounts
402 void UpdateLastPlayed(const CFileItem &item);
404 /*! \brief Get the playcount and resume point of a list of items
405 Note that if the resume point is already set on an item, it won't be overridden.
406 \param path the path to fetch videos from
407 \param items CFileItemList to fetch the playcounts for
408 \sa GetPlayCount, SetPlayCount, IncrementPlayCount
410 bool GetPlayCounts(const CStdString &path, CFileItemList &items);
412 void UpdateMovieTitle(int idMovie, const CStdString& strNewMovieTitle, VIDEODB_CONTENT_TYPE iType=VIDEODB_CONTENT_MOVIES);
414 bool HasMovieInfo(const CStdString& strFilenameAndPath);
415 bool HasTvShowInfo(const CStdString& strFilenameAndPath);
416 bool HasEpisodeInfo(const CStdString& strFilenameAndPath);
417 bool HasMusicVideoInfo(const CStdString& strFilenameAndPath);
419 void GetFilePathById(int idMovie, CStdString &filePath, VIDEODB_CONTENT_TYPE iType);
420 CStdString GetGenreById(int id);
421 CStdString GetCountryById(int id);
422 CStdString GetSetById(int id);
423 CStdString GetTagById(int id);
424 CStdString GetPersonById(int id);
425 CStdString GetStudioById(int id);
426 CStdString GetTvShowTitleById(int id);
427 CStdString GetMusicVideoAlbumById(int id);
428 int GetTvShowForEpisode(int idEpisode);
429 int GetSeasonForEpisode(int idEpisode);
431 bool LoadVideoInfo(const CStdString& strFilenameAndPath, CVideoInfoTag& details);
432 bool GetMovieInfo(const CStdString& strFilenameAndPath, CVideoInfoTag& details, int idMovie = -1);
433 bool GetTvShowInfo(const CStdString& strPath, CVideoInfoTag& details, int idTvShow = -1);
434 bool GetEpisodeInfo(const CStdString& strFilenameAndPath, CVideoInfoTag& details, int idEpisode = -1);
435 bool GetMusicVideoInfo(const CStdString& strFilenameAndPath, CVideoInfoTag& details, int idMVideo=-1);
436 bool GetSetInfo(int idSet, CVideoInfoTag& details);
437 bool GetFileInfo(const CStdString& strFilenameAndPath, CVideoInfoTag& details, int idFile = -1);
439 int GetPathId(const CStdString& strPath);
440 int GetTvShowId(const CStdString& strPath);
441 int GetEpisodeId(const CStdString& strFilenameAndPath, int idEpisode=-1, int idSeason=-1); // idEpisode, idSeason are used for multipart episodes as hints
442 int GetSeasonId(int idShow, int season);
444 void GetEpisodesByFile(const CStdString& strFilenameAndPath, std::vector<CVideoInfoTag>& episodes);
446 int SetDetailsForMovie(const CStdString& strFilenameAndPath, const CVideoInfoTag& details, const std::map<std::string, std::string> &artwork, int idMovie = -1);
447 int SetDetailsForTvShow(const CStdString& strPath, const CVideoInfoTag& details, const std::map<std::string, std::string> &artwork, const std::map<int, std::map<std::string, std::string> > &seasonArt, int idTvShow = -1);
448 int SetDetailsForEpisode(const CStdString& strFilenameAndPath, const CVideoInfoTag& details, const std::map<std::string, std::string> &artwork, int idShow, int idEpisode=-1);
449 int SetDetailsForMusicVideo(const CStdString& strFilenameAndPath, const CVideoInfoTag& details, const std::map<std::string, std::string> &artwork, int idMVideo = -1);
450 void SetStreamDetailsForFile(const CStreamDetails& details, const CStdString &strFileNameAndPath);
451 void SetStreamDetailsForFileId(const CStreamDetails& details, int idFile);
452 void SetDetail(const CStdString& strDetail, int id, int field, VIDEODB_CONTENT_TYPE type);
454 void DeleteMovie(int idMovie, bool bKeepId = false);
455 void DeleteMovie(const CStdString& strFilenameAndPath, bool bKeepId = false, int idMovie = -1);
456 void DeleteTvShow(int idTvShow, bool bKeepId = false);
457 void DeleteTvShow(const CStdString& strPath, bool bKeepId = false, int idTvShow = -1);
458 void DeleteEpisode(int idEpisode, bool bKeepId = false);
459 void DeleteEpisode(const CStdString& strFilenameAndPath, int idEpisode = -1, bool bKeepId = false);
460 void DeleteMusicVideo(int idMusicVideo, bool bKeepId = false);
461 void DeleteMusicVideo(const CStdString& strFilenameAndPath, bool bKeepId = false, int idMVideo = -1);
462 void DeleteDetailsForTvShow(const CStdString& strPath, int idTvShow = -1);
463 void RemoveContentForPath(const CStdString& strPath,CGUIDialogProgress *progress = NULL);
464 void UpdateFanart(const CFileItem &item, VIDEODB_CONTENT_TYPE type);
465 void DeleteSet(int idSet);
466 void DeleteTag(int idTag, VIDEODB_CONTENT_TYPE mediaType);
468 // per-file video settings
469 bool GetVideoSettings(const CStdString &strFilenameAndPath, CVideoSettings &settings);
470 void SetVideoSettings(const CStdString &strFilenameAndPath, const CVideoSettings &settings);
471 void EraseVideoSettings();
473 bool GetStackTimes(const CStdString &filePath, std::vector<int> ×);
474 void SetStackTimes(const CStdString &filePath, std::vector<int> ×);
476 void GetBookMarksForFile(const CStdString& strFilenameAndPath, VECBOOKMARKS& bookmarks, CBookmark::EType type = CBookmark::STANDARD, bool bAppend=false, long partNumber=0);
477 void AddBookMarkToFile(const CStdString& strFilenameAndPath, const CBookmark &bookmark, CBookmark::EType type = CBookmark::STANDARD);
478 bool GetResumeBookMark(const CStdString& strFilenameAndPath, CBookmark &bookmark);
479 void DeleteResumeBookMark(const CStdString &strFilenameAndPath);
480 void ClearBookMarkOfFile(const CStdString& strFilenameAndPath, CBookmark& bookmark, CBookmark::EType type = CBookmark::STANDARD);
481 void ClearBookMarksOfFile(const CStdString& strFilenameAndPath, CBookmark::EType type = CBookmark::STANDARD);
482 bool GetBookMarkForEpisode(const CVideoInfoTag& tag, CBookmark& bookmark);
483 void AddBookMarkForEpisode(const CVideoInfoTag& tag, const CBookmark& bookmark);
484 void DeleteBookMarkForEpisode(const CVideoInfoTag& tag);
485 bool GetResumePoint(CVideoInfoTag& tag);
486 bool GetStreamDetails(CVideoInfoTag& tag) const;
489 void SetScraperForPath(const CStdString& filePath, const ADDON::ScraperPtr& info, const VIDEO::SScanSettings& settings);
490 ADDON::ScraperPtr GetScraperForPath(const CStdString& strPath);
491 ADDON::ScraperPtr GetScraperForPath(const CStdString& strPath, VIDEO::SScanSettings& settings);
493 /*! \brief Retrieve the scraper and settings we should use for the specified path
494 If the scraper is not set on this particular path, we'll recursively check parent folders.
495 \param strPath path to start searching in.
496 \param settings [out] scan settings for this folder.
497 \param foundDirectly [out] true if a scraper was found directly for strPath, false if it was in a parent path.
498 \return A ScraperPtr containing the scraper information. Returns NULL if a trivial (Content == CONTENT_NONE)
499 scraper or no scraper is found.
501 ADDON::ScraperPtr GetScraperForPath(const CStdString& strPath, VIDEO::SScanSettings& settings, bool& foundDirectly);
503 /*! \brief Retrieve the content type of videos in the given path
504 If content is set on the folder, we return the given content type, except in the case of tvshows,
505 where we first check for whether we have episodes directly in the path (thus return episodes) or whether
506 we've found a scraper directly (shows). Any folders inbetween are treated as seasons (regardless of whether
507 they actually are seasons). Note that any subfolders in movies will be treated as movies.
508 \param strPath path to start searching in.
509 \return A content type string for the current path.
511 CStdString GetContentForPath(const CStdString& strPath);
513 /*! \brief Get videos of the given content type from the given path
514 \param content the content type to fetch.
515 \param path the path to fetch videos from.
516 \param items the returned items
517 \return true if items are found, false otherwise.
519 bool GetItemsForPath(const CStdString &content, const CStdString &path, CFileItemList &items);
521 /*! \brief Check whether a given scraper is in use.
522 \param scraperID the scraper to check for.
523 \return true if the scraper is in use, false otherwise.
525 bool ScraperInUse(const CStdString &scraperID) const;
527 // scanning hashes and paths scanned
528 bool SetPathHash(const CStdString &path, const CStdString &hash);
529 bool GetPathHash(const CStdString &path, CStdString &hash);
530 bool GetPaths(std::set<CStdString> &paths);
531 bool GetPathsForTvShow(int idShow, std::set<int>& paths);
533 /*! \brief retrieve subpaths of a given path. Assumes a heirarchical folder structure
534 \param basepath the root path to retrieve subpaths for
535 \param subpaths the returned subpaths
536 \return true if we successfully retrieve subpaths (may be zero), false on error
538 bool GetSubPaths(const CStdString& basepath, std::vector< std::pair<int, std::string> >& subpaths);
540 // for music + musicvideo linkups - if no album and title given it will return the artist id, else the id of the matching video
541 int GetMatchingMusicVideo(const CStdString& strArtist, const CStdString& strAlbum = "", const CStdString& strTitle = "");
543 // searching functions
544 void GetMoviesByActor(const CStdString& strActor, CFileItemList& items);
545 void GetTvShowsByActor(const CStdString& strActor, CFileItemList& items);
546 void GetEpisodesByActor(const CStdString& strActor, CFileItemList& items);
548 void GetMusicVideosByArtist(const CStdString& strArtist, CFileItemList& items);
549 void GetMusicVideosByAlbum(const CStdString& strAlbum, CFileItemList& items);
551 void GetMovieGenresByName(const CStdString& strSearch, CFileItemList& items);
552 void GetTvShowGenresByName(const CStdString& strSearch, CFileItemList& items);
553 void GetMusicVideoGenresByName(const CStdString& strSearch, CFileItemList& items);
555 void GetMovieCountriesByName(const CStdString& strSearch, CFileItemList& items);
557 void GetMusicVideoAlbumsByName(const CStdString& strSearch, CFileItemList& items);
559 void GetMovieActorsByName(const CStdString& strSearch, CFileItemList& items);
560 void GetTvShowsActorsByName(const CStdString& strSearch, CFileItemList& items);
561 void GetMusicVideoArtistsByName(const CStdString& strSearch, CFileItemList& items);
563 void GetMovieDirectorsByName(const CStdString& strSearch, CFileItemList& items);
564 void GetTvShowsDirectorsByName(const CStdString& strSearch, CFileItemList& items);
565 void GetMusicVideoDirectorsByName(const CStdString& strSearch, CFileItemList& items);
567 void GetMoviesByName(const CStdString& strSearch, CFileItemList& items);
568 void GetTvShowsByName(const CStdString& strSearch, CFileItemList& items);
569 void GetEpisodesByName(const CStdString& strSearch, CFileItemList& items);
570 void GetMusicVideosByName(const CStdString& strSearch, CFileItemList& items);
572 void GetEpisodesByPlot(const CStdString& strSearch, CFileItemList& items);
573 void GetMoviesByPlot(const CStdString& strSearch, CFileItemList& items);
575 bool LinkMovieToTvshow(int idMovie, int idShow, bool bRemove);
576 bool IsLinkedToTvshow(int idMovie);
577 bool GetLinksToTvShow(int idMovie, std::vector<int>& ids);
580 bool GetGenresNav(const CStdString& strBaseDir, CFileItemList& items, int idContent=-1, const Filter &filter = Filter(), bool countOnly = false);
581 bool GetCountriesNav(const CStdString& strBaseDir, CFileItemList& items, int idContent=-1, const Filter &filter = Filter(), bool countOnly = false);
582 bool GetStudiosNav(const CStdString& strBaseDir, CFileItemList& items, int idContent=-1, const Filter &filter = Filter(), bool countOnly = false);
583 bool GetYearsNav(const CStdString& strBaseDir, CFileItemList& items, int idContent=-1, const Filter &filter = Filter());
584 bool GetActorsNav(const CStdString& strBaseDir, CFileItemList& items, int idContent=-1, const Filter &filter = Filter(), bool countOnly = false);
585 bool GetDirectorsNav(const CStdString& strBaseDir, CFileItemList& items, int idContent=-1, const Filter &filter = Filter(), bool countOnly = false);
586 bool GetWritersNav(const CStdString& strBaseDir, CFileItemList& items, int idContent=-1, const Filter &filter = Filter(), bool countOnly = false);
587 bool GetSetsNav(const CStdString& strBaseDir, CFileItemList& items, int idContent=-1, bool ignoreSingleMovieSets = false);
588 bool GetTagsNav(const CStdString& strBaseDir, CFileItemList& items, int idContent=-1, const Filter &filter = Filter(), bool countOnly = false);
589 bool GetMusicVideoAlbumsNav(const CStdString& strBaseDir, CFileItemList& items, int idArtist, const Filter &filter = Filter(), bool countOnly = false);
591 bool GetMoviesNav(const CStdString& strBaseDir, CFileItemList& items, int idGenre=-1, int idYear=-1, int idActor=-1, int idDirector=-1, int idStudio=-1, int idCountry=-1, int idSet=-1, int idTag=-1, const SortDescription &sortDescription = SortDescription());
592 bool GetTvShowsNav(const CStdString& strBaseDir, CFileItemList& items, int idGenre=-1, int idYear=-1, int idActor=-1, int idDirector=-1, int idStudio=-1, int idTag=-1, const SortDescription &sortDescription = SortDescription());
593 bool GetSeasonsNav(const CStdString& strBaseDir, CFileItemList& items, int idActor=-1, int idDirector=-1, int idGenre=-1, int idYear=-1, int idShow=-1, bool getLinkedMovies = true);
594 bool GetEpisodesNav(const CStdString& strBaseDir, CFileItemList& items, int idGenre=-1, int idYear=-1, int idActor=-1, int idDirector=-1, int idShow=-1, int idSeason=-1, const SortDescription &sortDescription = SortDescription());
595 bool GetMusicVideosNav(const CStdString& strBaseDir, CFileItemList& items, int idGenre=-1, int idYear=-1, int idArtist=-1, int idDirector=-1, int idStudio=-1, int idAlbum=-1, int idTag=-1, const SortDescription &sortDescription = SortDescription());
597 bool GetRecentlyAddedMoviesNav(const CStdString& strBaseDir, CFileItemList& items, unsigned int limit=0);
598 bool GetRecentlyAddedEpisodesNav(const CStdString& strBaseDir, CFileItemList& items, unsigned int limit=0);
599 bool GetRecentlyAddedMusicVideosNav(const CStdString& strBaseDir, CFileItemList& items, unsigned int limit=0);
602 bool HasContent(VIDEODB_CONTENT_TYPE type);
603 bool HasSets() const;
605 void CleanDatabase(CGUIDialogProgressBarHandle* handle=NULL, const std::set<int>* paths=NULL, bool showProgress=true);
607 /*! \brief Add a file to the database, if necessary
608 If the file is already in the database, we simply return its id.
609 \param url - full path of the file to add.
610 \return id of the file, -1 if it could not be added.
612 int AddFile(const CStdString& url);
614 /*! \brief Add a file to the database, if necessary
615 Works for both videodb:// items and normal fileitems
616 \param item CFileItem to add.
617 \return id of the file, -1 if it could not be added.
619 int AddFile(const CFileItem& item);
621 /*! \brief Add a path to the database, if necessary
622 If the path is already in the database, we simply return its id.
623 \param strPath the path to add
624 \param strDateAdded datetime when the path was added to the filesystem/database
625 \return id of the file, -1 if it could not be added.
627 int AddPath(const CStdString& strPath, const CStdString &strDateAdded = "");
629 /*! \brief Updates the dateAdded field in the files table for the file
630 with the given idFile and the given path based on the files modification date
631 \param idFile id of the file in the files table
632 \param strFileNameAndPath path to the file
634 void UpdateFileDateAdded(int idFile, const CStdString& strFileNameAndPath);
636 void ExportToXML(const CStdString &path, bool singleFiles = false, bool images=false, bool actorThumbs=false, bool overwrite=false);
637 bool ExportSkipEntry(const CStdString &nfoFile);
638 void ExportActorThumbs(const CStdString &path, const CVideoInfoTag& tag, bool singleFiles, bool overwrite=false);
639 void ImportFromXML(const CStdString &path);
640 void DumpToDummyFiles(const CStdString &path);
641 bool ImportArtFromXML(const TiXmlNode *node, std::map<std::string, std::string> &artwork);
643 // smart playlists and main retrieval work in these functions
644 bool GetMoviesByWhere(const CStdString& strBaseDir, const Filter &filter, CFileItemList& items, const SortDescription &sortDescription = SortDescription());
645 bool GetSetsByWhere(const CStdString& strBaseDir, const Filter &filter, CFileItemList& items, bool ignoreSingleMovieSets = false);
646 bool GetTvShowsByWhere(const CStdString& strBaseDir, const Filter &filter, CFileItemList& items, const SortDescription &sortDescription = SortDescription());
647 bool GetEpisodesByWhere(const CStdString& strBaseDir, const Filter &filter, CFileItemList& items, bool appendFullShowPath = true, const SortDescription &sortDescription = SortDescription());
648 bool GetMusicVideosByWhere(const CStdString &baseDir, const Filter &filter, CFileItemList& items, bool checkLocks = true, const SortDescription &sortDescription = SortDescription());
650 // retrieve sorted and limited items
651 bool GetSortedVideos(MediaType mediaType, const CStdString& strBaseDir, const SortDescription &sortDescription, CFileItemList& items, const Filter &filter = Filter());
654 int GetMusicVideoCount(const CStdString& strWhere);
655 unsigned int GetMusicVideoIDs(const CStdString& strWhere, std::vector<std::pair<int,int> > &songIDs);
656 bool GetRandomMusicVideo(CFileItem* item, int& idSong, const CStdString& strWhere);
658 static void VideoContentTypeToString(VIDEODB_CONTENT_TYPE type, CStdString& out)
662 case VIDEODB_CONTENT_MOVIES:
665 case VIDEODB_CONTENT_TVSHOWS:
668 case VIDEODB_CONTENT_EPISODES:
671 case VIDEODB_CONTENT_MUSICVIDEOS:
679 void SetArtForItem(int mediaId, const std::string &mediaType, const std::string &artType, const std::string &url);
680 void SetArtForItem(int mediaId, const std::string &mediaType, const std::map<std::string, std::string> &art);
681 bool GetArtForItem(int mediaId, const std::string &mediaType, std::map<std::string, std::string> &art);
682 std::string GetArtForItem(int mediaId, const std::string &mediaType, const std::string &artType);
683 bool GetTvShowSeasonArt(int mediaId, std::map<int, std::map<std::string, std::string> > &seasonArt);
685 int AddTag(const std::string &tag);
686 void AddTagToItem(int idItem, int idTag, const std::string &type);
687 void RemoveTagFromItem(int idItem, int idTag, const std::string &type);
688 void RemoveTagsFromItem(int idItem, const std::string &type);
690 virtual bool GetFilter(CDbUrl &videoUrl, Filter &filter, SortDescription &sorting);
693 friend class CEdenVideoArtUpdater;
694 int GetMovieId(const CStdString& strFilenameAndPath);
695 int GetMusicVideoId(const CStdString& strFilenameAndPath);
697 /*! \brief Get the id of this fileitem
698 Works for both videodb:// items and normal fileitems
699 \param item CFileItem to grab the fileid of
700 \return id of the file, -1 if it is not in the db.
702 int GetFileId(const CFileItem &item);
704 /*! \brief Get the id of a file from path
705 \param url full path to the file
706 \return id of the file, -1 if it is not in the db.
708 int GetFileId(const CStdString& url);
710 int AddToTable(const CStdString& table, const CStdString& firstField, const CStdString& secondField, const CStdString& value);
711 int AddGenre(const CStdString& strGenre1);
712 int AddActor(const CStdString& strActor, const CStdString& thumbURL, const CStdString &thumb = "");
713 int AddCountry(const CStdString& strCountry);
714 int AddSet(const CStdString& strSet);
715 int AddStudio(const CStdString& strStudio1);
717 int AddTvShow(const CStdString& strPath);
718 int AddMusicVideo(const CStdString& strFilenameAndPath);
719 int AddSeason(int showID, int season);
721 // link functions - these two do all the work
722 void AddLinkToActor(const char *table, int actorID, const char *secondField, int secondID, const CStdString &role, int order);
723 void AddToLinkTable(const char *table, const char *firstField, int firstID, const char *secondField, int secondID, const char *typeField = NULL, const char *type = NULL);
724 void RemoveFromLinkTable(const char *table, const char *firstField, int firstID, const char *secondField, int secondID, const char *typeField = NULL, const char *type = NULL);
726 void AddActorToMovie(int idMovie, int idActor, const CStdString& strRole, int order);
727 void AddActorToTvShow(int idTvShow, int idActor, const CStdString& strRole, int order);
728 void AddActorToEpisode(int idEpisode, int idActor, const CStdString& strRole, int order);
729 void AddArtistToMusicVideo(int lMVideo, int idArtist);
731 void AddDirectorToMovie(int idMovie, int idDirector);
732 void AddDirectorToTvShow(int idTvShow, int idDirector);
733 void AddDirectorToEpisode(int idEpisode, int idDirector);
734 void AddDirectorToMusicVideo(int lMVideo, int idDirector);
735 void AddWriterToEpisode(int idEpisode, int idWriter);
736 void AddWriterToMovie(int idMovie, int idWriter);
738 void AddGenreToMovie(int idMovie, int idGenre);
739 void AddGenreToTvShow(int idTvShow, int idGenre);
740 void AddGenreToMusicVideo(int idMVideo, int idGenre);
742 void AddStudioToMovie(int idMovie, int idStudio);
743 void AddStudioToTvShow(int idTvShow, int idStudio);
744 void AddStudioToMusicVideo(int idMVideo, int idStudio);
746 void AddCountryToMovie(int idMovie, int idCountry);
748 void AddGenreAndDirectorsAndStudios(const CVideoInfoTag& details, std::vector<int>& vecDirectors, std::vector<int>& vecGenres, std::vector<int>& vecStudios);
750 void DeleteStreamDetails(int idFile);
751 CVideoInfoTag GetDetailsByTypeAndId(VIDEODB_CONTENT_TYPE type, int id);
752 CVideoInfoTag GetDetailsForMovie(std::auto_ptr<dbiplus::Dataset> &pDS, bool getDetails = false);
753 CVideoInfoTag GetDetailsForMovie(const dbiplus::sql_record* const record, bool getDetails = false);
754 CVideoInfoTag GetDetailsForTvShow(std::auto_ptr<dbiplus::Dataset> &pDS, bool getDetails = false);
755 CVideoInfoTag GetDetailsForTvShow(const dbiplus::sql_record* const record, bool getDetails = false);
756 CVideoInfoTag GetDetailsForEpisode(std::auto_ptr<dbiplus::Dataset> &pDS, bool getDetails = false);
757 CVideoInfoTag GetDetailsForEpisode(const dbiplus::sql_record* const record, bool getDetails = false);
758 CVideoInfoTag GetDetailsForMusicVideo(std::auto_ptr<dbiplus::Dataset> &pDS, bool getDetails = false);
759 CVideoInfoTag GetDetailsForMusicVideo(const dbiplus::sql_record* const record, bool getDetails = false);
760 bool GetPeopleNav(const CStdString& strBaseDir, CFileItemList& items, const CStdString& type, int idContent=-1, const Filter &filter = Filter(), bool countOnly = false);
761 bool GetNavCommon(const CStdString& strBaseDir, CFileItemList& items, const CStdString& type, int idContent=-1, const Filter &filter = Filter(), bool countOnly = false);
762 void GetCast(const CStdString &table, const CStdString &table_id, int type_id, std::vector<SActorInfo> &cast);
764 void GetDetailsFromDB(std::auto_ptr<dbiplus::Dataset> &pDS, int min, int max, const SDbTableOffsets *offsets, CVideoInfoTag &details, int idxOffset = 2);
765 void GetDetailsFromDB(const dbiplus::sql_record* const record, int min, int max, const SDbTableOffsets *offsets, CVideoInfoTag &details, int idxOffset = 2);
766 CStdString GetValueString(const CVideoInfoTag &details, int min, int max, const SDbTableOffsets *offsets) const;
769 virtual bool CreateTables();
770 virtual bool UpdateOldVersion(int version);
772 /*! \brief (Re)Create the generic database views for movies, tvshows,
773 episodes and music videos
775 virtual void CreateViews();
777 /*! \brief Run a query on the main dataset and return the number of rows
778 If no rows are found we close the dataset and return 0.
779 \param sql the sql query to run
780 \return the number of rows, -1 for an error.
782 int RunQuery(const CStdString &sql);
784 /*! \brief Update routine for base path of videos
785 Only required for videodb version < 59
786 \param table the table to update
787 \param id the primary id in the given table
788 \param column the basepath column to update
789 \param shows whether we're fetching shows (defaults to false)
790 \param where restrict updating of items that match the where clause
792 void UpdateBasePath(const char *table, const char *id, int column, bool shows = false, const CStdString &where = "");
794 /*! \brief Update routine for base path id of videos
795 Only required for videodb version < 59
796 \param table the table to update
797 \param id the primary id in the given table
798 \param column the column of the basepath
799 \param idColumn the column of the parent path id to update
801 void UpdateBasePathID(const char *table, const char *id, int column, int idColumn);
803 /*! \brief Determine whether the path is using lookup using folders
804 \param path the path to check
805 \param shows whether this path is from a tvshow (defaults to false)
807 bool LookupByFolders(const CStdString &path, bool shows = false);
809 virtual int GetMinVersion() const;
810 virtual int GetExportVersion() const { return 1; };
811 const char *GetBaseDBName() const { return "MyVideos"; };
813 void ConstructPath(CStdString& strDest, const CStdString& strPath, const CStdString& strFileName);
814 void SplitPath(const CStdString& strFileNameAndPath, CStdString& strPath, CStdString& strFileName);
815 void InvalidatePathHash(const CStdString& strPath);
817 bool GetStackedTvShowList(int idShow, CStdString& strIn) const;
818 void Stack(CFileItemList& items, VIDEODB_CONTENT_TYPE type, bool maintainSortOrder = false);
820 /*! \brief Get a safe filename from a given string
821 \param dir directory to use for the file
822 \param name movie, show name, or actor to get a safe filename for
823 \return safe filename based on this title
825 CStdString GetSafeFile(const CStdString &dir, const CStdString &name) const;
827 void AnnounceRemove(std::string content, int id);
828 void AnnounceUpdate(std::string content, int id);