fix videodb updating of old encoded URLs (rar etc.) which was a noop atm due to a...
authorJonathan Marshall <jmarshall@never.you.mind>
Mon, 17 Dec 2012 22:25:40 +0000 (11:25 +1300)
committerJonathan Marshall <jmarshall@never.you.mind>
Mon, 17 Dec 2012 22:26:14 +0000 (11:26 +1300)
xbmc/video/VideoDatabase.cpp

index ccf432e..de55be2 100644 (file)
@@ -4208,11 +4208,11 @@ bool CVideoDatabase::UpdateOldVersion(int iVersion)
     {
       std::string filename = i->second;
       bool update = URIUtils::UpdateUrlEncoding(filename) &&
-                    (!m_pDS->query(PrepareSQL("SELECT idFile FROM files WHERE strFilename = '%s'", i->second.c_str())) || m_pDS->num_rows() <= 0);
+                    (!m_pDS->query(PrepareSQL("SELECT idFile FROM files WHERE strFilename = '%s'", filename.c_str())) || m_pDS->num_rows() <= 0);
       m_pDS->close();
 
       if (update)
-        m_pDS->exec(PrepareSQL("UPDATE files SET strFilename='%s' WHERE idFile=%d", i->second.c_str(), i->first));
+        m_pDS->exec(PrepareSQL("UPDATE files SET strFilename='%s' WHERE idFile=%d", filename.c_str(), i->first));
     }
   }
   if (iVersion < 72)