return false;
}
+bool CVideoDatabase::GetSeasonInfo(int idSeason, CVideoInfoTag& details)
+{
+ if (idSeason < 0)
+ return false;
+
+ try
+ {
+ if (!m_pDB.get() || !m_pDS.get())
+ return false;
+
+ CStdString sql = PrepareSQL("SELECT idShow FROM seasons WHERE idSeason=%i", idSeason);
+ if (!m_pDS->query(sql.c_str()))
+ return false;
+
+ int idShow = -1;
+ if (m_pDS->num_rows() == 1)
+ idShow = m_pDS->fv(0).get_asInt();
+
+ m_pDS->close();
+
+ if (idShow < 0)
+ return false;
+
+ CFileItemList seasons;
+ if (!GetSeasonsNav(StringUtils::Format("videodb://tvshows/titles/%ld/", idShow), seasons, -1, -1, -1, -1, idShow, false) || seasons.Size() <= 0)
+ return false;
+
+ for (int index = 0; index < seasons.Size(); index++)
+ {
+ const CFileItemPtr season = seasons.Get(index);
+ if (season->HasVideoInfoTag() && season->GetVideoInfoTag()->m_iDbId == idSeason && season->GetVideoInfoTag()->m_iIdShow == idShow)
+ {
+ details = *season->GetVideoInfoTag();
+ return true;
+ }
+ }
+ }
+ catch (...)
+ {
+ CLog::Log(LOGERROR, "%s (%i) failed", __FUNCTION__, idSeason);
+ }
+ return false;
+}
+
bool CVideoDatabase::GetEpisodeInfo(const CStdString& strFilenameAndPath, CVideoInfoTag& details, int idEpisode /* = -1 */)
{
try
bool LoadVideoInfo(const CStdString& strFilenameAndPath, CVideoInfoTag& details);
bool GetMovieInfo(const CStdString& strFilenameAndPath, CVideoInfoTag& details, int idMovie = -1);
bool GetTvShowInfo(const CStdString& strPath, CVideoInfoTag& details, int idTvShow = -1);
+ bool GetSeasonInfo(int idSeason, CVideoInfoTag& details);
bool GetEpisodeInfo(const CStdString& strFilenameAndPath, CVideoInfoTag& details, int idEpisode = -1);
bool GetMusicVideoInfo(const CStdString& strFilenameAndPath, CVideoInfoTag& details, int idMVideo=-1);
bool GetSetInfo(int idSet, CVideoInfoTag& details);