Merge pull request #4630 from Red-F/gotham-resume-pvr-lastplayedposition
[vuplus_xbmc] / xbmc / TextureDatabase.cpp
index d6544bc..6916b60 100644 (file)
@@ -186,7 +186,7 @@ void CTextureDatabase::CreateAnalytics()
   m_pDS->exec("CREATE TRIGGER textureDelete AFTER delete ON texture FOR EACH ROW BEGIN delete from sizes where sizes.idtexture=old.id; END");
 }
 
-bool CTextureDatabase::UpdateOldVersion(int version)
+void CTextureDatabase::UpdateTables(int version)
 {
   if (version < 7)
   { // update all old thumb://foo urls to image://foo?size=thumb
@@ -214,12 +214,12 @@ bool CTextureDatabase::UpdateOldVersion(int version)
   }
   if (version < 9)
   { // get rid of the old path table and add the type column
-    m_pDS->exec("DROP TABLE path");
+    m_pDS->exec("DROP TABLE IF EXISTS path");
     m_pDS->exec("CREATE TABLE path (id integer primary key, urlhash integer, url text, type text, texture text)\n");
   }
   if (version < 10)
   { // get rid of urlhash in both tables...
-    m_pDS->exec("DROP TABLE path");
+    m_pDS->exec("DROP TABLE IF EXISTS path");
     m_pDS->exec("CREATE TABLE path (id integer primary key, url text, type text, texture text)\n");
 
     m_pDS->exec("CREATE TEMPORARY TABLE texture_backup(id,url,cachedurl,usecount,lastusetime,imagehash,lasthashcheck)");
@@ -235,11 +235,10 @@ bool CTextureDatabase::UpdateOldVersion(int version)
   }
   if (version < 12)
   { // create new sizes table and move usecount info to it.
-    m_pDS->exec("DROP TABLE texture");
+    m_pDS->exec("DROP TABLE IF EXISTS texture");
     m_pDS->exec("CREATE TABLE texture (id integer primary key, url text, cachedurl text, imagehash text, lasthashcheck text)");
     m_pDS->exec("CREATE TABLE sizes (idtexture integer, size integer, width integer, height integer, usecount integer, lastusetime text)");
   }
-  return true;
 }
 
 bool CTextureDatabase::IncrementUseCount(const CTextureDetails &details)