}
//********************************************************************************************************************************
+bool CVideoDatabase::LoadVideoInfo(const CStdString& strFilenameAndPath, CVideoInfoTag& details)
+{
+ if (HasMovieInfo(strFilenameAndPath))
+ {
+ GetMovieInfo(strFilenameAndPath, details);
+ CLog::Log(LOGDEBUG,"%s, got movie info!", __FUNCTION__);
+ CLog::Log(LOGDEBUG," Title = %s", details.m_strTitle.c_str());
+ }
+ else if (HasEpisodeInfo(strFilenameAndPath))
+ {
+ GetEpisodeInfo(strFilenameAndPath, details);
+ CLog::Log(LOGDEBUG,"%s, got episode info!", __FUNCTION__);
+ CLog::Log(LOGDEBUG," Title = %s", details.m_strTitle.c_str());
+ }
+ else if (HasMusicVideoInfo(strFilenameAndPath))
+ {
+ GetMusicVideoInfo(strFilenameAndPath, details);
+ CLog::Log(LOGDEBUG,"%s, got music video info!", __FUNCTION__);
+ CLog::Log(LOGDEBUG," Title = %s", details.m_strTitle.c_str());
+ }
+
+ return !details.IsEmpty();
+}
+
bool CVideoDatabase::HasMovieInfo(const CStdString& strFilenameAndPath)
{
try
}
m_pDS->close();
+ // Add any files that don't have a valid idPath entry to the filesToDelete list.
+ sql = "select files.idFile from files where idPath not in (select idPath from path)";
+ m_pDS->exec(sql.c_str());
+ while (!m_pDS->eof())
+ {
+ filesToDelete += m_pDS->fv("files.idFile").get_asString() + ",";
+ m_pDS->next();
+ }
+ m_pDS->close();
+
if ( ! filesToDelete.IsEmpty() )
{
filesToDelete.TrimRight(",");
strIds.Format("%s %i,",strIds.Mid(0),m_pDS->fv("path.idPath").get_asInt()); // mid since we cannot format the same string
m_pDS->next();
}
+ m_pDS->close();
if (!strIds.IsEmpty())
{
strIds.TrimLeft(" ");
sql = PrepareSQL("delete from tvshowlinkpath where idPath in (%s)",strIds.c_str());
m_pDS->exec(sql.c_str());
}
+ sql = "delete from tvshowlinkpath where idPath not in (select idPath from path)";
+ m_pDS->exec(sql.c_str());
CLog::Log(LOGDEBUG, "%s: Cleaning tvshow table", __FUNCTION__);
sql = "delete from tvshow where idShow not in (select idShow from tvshowlinkpath)";
}
}
}
-
- xmlDoc.Clear();
- TiXmlDeclaration decl("1.0", "UTF-8", "yes");
- xmlDoc.InsertEndChild(decl);
}
+
+ xmlDoc.Clear();
+ TiXmlDeclaration decl("1.0", "UTF-8", "yes");
+ xmlDoc.InsertEndChild(decl);
}
if (images && !bSkip)
}
}
}
-
- xmlDoc.Clear();
- TiXmlDeclaration decl("1.0", "UTF-8", "yes");
- xmlDoc.InsertEndChild(decl);
}
+
+ xmlDoc.Clear();
+ TiXmlDeclaration decl("1.0", "UTF-8", "yes");
+ xmlDoc.InsertEndChild(decl);
}
if (images && !bSkip)
{
}
}
}
-
- xmlDoc.Clear();
- TiXmlDeclaration decl("1.0", "UTF-8", "yes");
- xmlDoc.InsertEndChild(decl);
}
+
+ xmlDoc.Clear();
+ TiXmlDeclaration decl("1.0", "UTF-8", "yes");
+ xmlDoc.InsertEndChild(decl);
}
if (images && !bSkip)
{
}
}
}
-
- xmlDoc.Clear();
- TiXmlDeclaration decl("1.0", "UTF-8", "yes");
- xmlDoc.InsertEndChild(decl);
}
+
+ xmlDoc.Clear();
+ TiXmlDeclaration decl("1.0", "UTF-8", "yes");
+ xmlDoc.InsertEndChild(decl);
}
if (images && !bSkip)