diff options
author | Jonathan Marshall <jmarshall@never.you.mind> | 2012-10-15 12:14:28 +1300 |
---|---|---|
committer | Jonathan Marshall <jmarshall@never.you.mind> | 2012-10-15 12:14:28 +1300 |
commit | a359e1cc7376f05038ec78f92c696292d36becf5 (patch) | |
tree | 2ba56e2dba37e4854e6f595181c959d8f9d177fe | |
parent | 7125e479aea50dbe276b1910780169c062b2248b (diff) |
remove unused arbitrary (dangerous) query/exec functions in music and video libraries now that http-api is no longer
-rw-r--r-- | xbmc/music/MusicDatabase.cpp | 67 | ||||
-rw-r--r-- | xbmc/music/MusicDatabase.h | 4 | ||||
-rw-r--r-- | xbmc/video/VideoDatabase.cpp | 64 | ||||
-rw-r--r-- | xbmc/video/VideoDatabase.h | 4 |
4 files changed, 0 insertions, 139 deletions
diff --git a/xbmc/music/MusicDatabase.cpp b/xbmc/music/MusicDatabase.cpp index 2617ab14c0..7d349deb3a 100644 --- a/xbmc/music/MusicDatabase.cpp +++ b/xbmc/music/MusicDatabase.cpp @@ -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 diff --git a/xbmc/music/MusicDatabase.h b/xbmc/music/MusicDatabase.h index d11c265af0..71e7c8c64b 100644 --- a/xbmc/music/MusicDatabase.h +++ b/xbmc/music/MusicDatabase.h @@ -133,10 +133,6 @@ public: 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); diff --git a/xbmc/video/VideoDatabase.cpp b/xbmc/video/VideoDatabase.cpp index 05ebd21c2d..7cbe05a159 100644 --- a/xbmc/video/VideoDatabase.cpp +++ b/xbmc/video/VideoDatabase.cpp @@ -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) || diff --git a/xbmc/video/VideoDatabase.h b/xbmc/video/VideoDatabase.h index ee8729224f..a7a094f08d 100644 --- a/xbmc/video/VideoDatabase.h +++ b/xbmc/video/VideoDatabase.h @@ -575,10 +575,6 @@ public: 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); |