Skip to content

Commit

Permalink
added: versioning to single file videodb exports
Browse files Browse the repository at this point in the history
  • Loading branch information
vdrfan committed Mar 15, 2011
1 parent 57aa0b7 commit b56094b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions xbmc/video/VideoDatabase.cpp
Expand Up @@ -6830,6 +6830,7 @@ void CVideoDatabase::ExportToXML(const CStdString &path, bool singleFiles /* = f
{
TiXmlElement xmlMainElement("videodb");
pMain = xmlDoc.InsertEndChild(xmlMainElement);
XMLUtils::SetInt(pMain,"version", GetExportVersion());
}

while (!m_pDS->eof())
Expand Down Expand Up @@ -7356,6 +7357,11 @@ void CVideoDatabase::ImportFromXML(const CStdString &path)
progress->ShowProgressBar(true);
}

int iVersion = 0;
XMLUtils::GetInt(root, "version", iVersion);

CLog::Log(LOGDEBUG, "%s: Starting import (export version = %i)", __FUNCTION__, iVersion);

TiXmlElement *movie = root->FirstChildElement();
int current = 0;
int total = 0;
Expand Down
1 change: 1 addition & 0 deletions xbmc/video/VideoDatabase.h
Expand Up @@ -673,6 +673,7 @@ class CVideoDatabase : public CDatabase
void UpdateBasePath(const char *table, const char *id, int column, bool shows = false);

virtual int GetMinVersion() const { return 46; };
virtual int GetExportVersion() const { return 1; };
const char *GetBaseDBName() const { return "MyVideos"; };

void ConstructPath(CStdString& strDest, const CStdString& strPath, const CStdString& strFileName);
Expand Down

0 comments on commit b56094b

Please sign in to comment.