Permalink
Browse files

remove unused arbitrary (dangerous) query/exec functions in music and…

… video libraries now that http-api is no longer
  • Loading branch information...
1 parent 7125e47 commit a359e1cc7376f05038ec78f92c696292d36becf5 Jonathan Marshall committed Oct 14, 2012
Showing with 0 additions and 139 deletions.
  1. +0 −67 xbmc/music/MusicDatabase.cpp
  2. +0 −4 xbmc/music/MusicDatabase.h
  3. +0 −64 xbmc/video/VideoDatabase.cpp
  4. +0 −4 xbmc/video/VideoDatabase.h
@@ -1172,73 +1172,6 @@ bool CMusicDatabase::SearchArtists(const CStdString& search, CFileItemList &arti
return false;
}
-bool CMusicDatabase::GetArbitraryQuery(const CStdString& strQuery, const CStdString& strOpenRecordSet, const CStdString& strCloseRecordSet,
- const CStdString& strOpenRecord, const CStdString& strCloseRecord, const CStdString& strOpenField,
- const CStdString& strCloseField, CStdString& strResult)
-{
- try
- {
- strResult = "";
- if (NULL == m_pDB.get()) return false;
- if (NULL == m_pDS.get()) return false;
- CStdString strSQL=strQuery;
- if (!m_pDS->query(strSQL.c_str()))
- {
- strResult = m_pDB->getErrorMsg();
- return false;
- }
- strResult=strOpenRecordSet;
- while (!m_pDS->eof())
- {
- strResult += strOpenRecord;
- for (int i=0; i<m_pDS->fieldCount(); i++)
- {
- strResult += strOpenField;
- strResult += m_pDS->fv(i).get_asString();
- strResult += strCloseField;
- }
- strResult += strCloseRecord;
- m_pDS->next();
- }
- strResult += strCloseRecordSet;
- m_pDS->close();
- return true;
- }
- catch (...)
- {
- CLog::Log(LOGERROR, "%s(%s) failed", __FUNCTION__, strQuery.c_str());
- }
- try
- {
- if (NULL == m_pDB.get()) return false;
- strResult = m_pDB->getErrorMsg();
- }
- catch (...)
- {
-
- }
-
- return false;
-}
-
-bool CMusicDatabase::ArbitraryExec(const CStdString& strExec)
-{
- try
- {
- if (NULL == m_pDB.get()) return false;
- if (NULL == m_pDS.get()) return false;
- CStdString strSQL = strExec;
- m_pDS->exec(strSQL.c_str());
- m_pDS->close();
- return true;
- }
- catch (...)
- {
- CLog::Log(LOGERROR, "%s failed", __FUNCTION__);
- }
- return false;
-}
-
bool CMusicDatabase::GetAlbumInfo(int idAlbum, CAlbum &info, VECSONGS* songs)
{
try
@@ -133,10 +133,6 @@ class CMusicDatabase : public CDatabase
bool GetSongsByArtist(int idArtist, bool includeFeatured, std::vector<long>& songs);
bool GetArtistsBySong(int idSong, bool includeFeatured, std::vector<long>& artists);
- bool GetArbitraryQuery(const CStdString& strQuery, const CStdString& strOpenRecordSet, const CStdString& strCloseRecordSet,
- const CStdString& strOpenRecord, const CStdString& strCloseRecord, const CStdString& strOpenField, const CStdString& strCloseField, CStdString& strResult);
- bool ArbitraryExec(const CStdString& strExec);
-
bool GetTop100(const CStdString& strBaseDir, CFileItemList& items);
bool GetTop100Albums(VECALBUMS& albums);
bool GetTop100AlbumSongs(const CStdString& strBaseDir, CFileItemList& item);
@@ -8772,70 +8772,6 @@ bool CVideoDatabase::ImportArtFromXML(const TiXmlNode *node, map<string, string>
return !artwork.empty();
}
-bool CVideoDatabase::GetArbitraryQuery(const CStdString& strQuery, const CStdString& strOpenRecordSet, const CStdString& strCloseRecordSet,
- const CStdString& strOpenRecord, const CStdString& strCloseRecord, const CStdString& strOpenField, const CStdString& strCloseField, CStdString& strResult)
-{
- try
- {
- strResult = "";
- if (NULL == m_pDB.get()) return false;
- if (NULL == m_pDS.get()) return false;
- CStdString strSQL=strQuery;
- if (!m_pDS->query(strSQL.c_str()))
- {
- strResult = m_pDB->getErrorMsg();
- return false;
- }
- strResult=strOpenRecordSet;
- while (!m_pDS->eof())
- {
- strResult += strOpenRecord;
- for (int i=0; i<m_pDS->fieldCount(); i++)
- {
- strResult += strOpenField + CStdString(m_pDS->fv(i).get_asString()) + strCloseField;
- }
- strResult += strCloseRecord;
- m_pDS->next();
- }
- strResult += strCloseRecordSet;
- m_pDS->close();
- return true;
- }
- catch (...)
- {
- CLog::Log(LOGERROR, "%s failed", __FUNCTION__);
- }
- try
- {
- if (NULL == m_pDB.get()) return false;
- strResult = m_pDB->getErrorMsg();
- }
- catch (...)
- {
-
- }
-
- return false;
-}
-
-bool CVideoDatabase::ArbitraryExec(const CStdString& strExec)
-{
- try
- {
- if (NULL == m_pDB.get()) return false;
- if (NULL == m_pDS.get()) return false;
- CStdString strSQL = strExec;
- m_pDS->exec(strSQL.c_str());
- m_pDS->close();
- return true;
- }
- catch (...)
- {
- CLog::Log(LOGERROR, "%s failed", __FUNCTION__);
- }
- return false;
-}
-
void CVideoDatabase::ConstructPath(CStdString& strDest, const CStdString& strPath, const CStdString& strFileName)
{
if (URIUtils::IsStack(strFileName) ||
@@ -575,10 +575,6 @@ class CVideoDatabase : public CDatabase
bool IsLinkedToTvshow(int idMovie);
bool GetLinksToTvShow(int idMovie, std::vector<int>& ids);
- bool GetArbitraryQuery(const CStdString& strQuery, const CStdString& strOpenRecordSet, const CStdString& strCloseRecordSet,
- const CStdString& strOpenRecord, const CStdString& strCloseRecord, const CStdString& strOpenField, const CStdString& strCloseField, CStdString& strResult);
- bool ArbitraryExec(const CStdString& strExec);
-
// general browsing
bool GetGenresNav(const CStdString& strBaseDir, CFileItemList& items, int idContent=-1, const Filter &filter = Filter(), bool countOnly = false);
bool GetCountriesNav(const CStdString& strBaseDir, CFileItemList& items, int idContent=-1, const Filter &filter = Filter(), bool countOnly = false);

0 comments on commit a359e1c

Please sign in to comment.