Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/azatoth/minidlna.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/sql.c
diff options
context:
space:
mode:
authorJustin Maggard <jmaggard@users.sourceforce.net>2012-02-14 22:43:35 +0400
committerJustin Maggard <jmaggard@users.sourceforce.net>2012-02-14 22:43:35 +0400
commite4d33102eb2b31f1d8aeab5f57bde9b3b6dd579b (patch)
tree01ae4b31f14cc16451ee4c8c118d70f18fe49ba3 /sql.c
parentf1fb0bfc683177860d6fcd97c81e72655e9c6735 (diff)
* Add DLNA.ORG_FLAGS support, and clean up transferMode support.
Diffstat (limited to 'sql.c')
-rw-r--r--sql.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sql.c b/sql.c
index 3b85404..df69158 100644
--- a/sql.c
+++ b/sql.c
@@ -210,12 +210,15 @@ db_upgrade(sqlite3 *db)
if (db_vers == DB_VERSION)
return 0;
+ if (db_vers > DB_VERSION)
+ return -2;
if (db_vers < 1)
return -1;
if (db_vers < 5)
return 5;
if (db_vers < 6)
{
+ DPRINTF(E_WARN, L_DB_SQL, "Updating DB version to v%d.\n", 6);
ret = sql_exec(db, "CREATE TABLE BOOKMARKS ("
"ID INTEGER PRIMARY KEY, "
"SEC INTEGER)");
@@ -224,11 +227,18 @@ db_upgrade(sqlite3 *db)
}
if (db_vers < 7)
{
- DPRINTF(E_WARN, L_DB_SQL, "Updating DB version to v%d.\n", DB_VERSION);
+ DPRINTF(E_WARN, L_DB_SQL, "Updating DB version to v%d.\n", 7);
ret = sql_exec(db, "ALTER TABLE DETAILS ADD rotation INTEGER");
if( ret != SQLITE_OK )
return 7;
}
+ if (db_vers < 8)
+ {
+ DPRINTF(E_WARN, L_DB_SQL, "Updating DB version to v%d.\n", 8);
+ ret = sql_exec(db, "UPDATE DETAILS set DLNA_PN = replace(DLNA_PN, ';DLNA.ORG_OP=01;DLNA.ORG_CI=0', '')");
+ if( ret != SQLITE_OK )
+ return 8;
+ }
sql_exec(db, "PRAGMA user_version = %d", DB_VERSION);
return 0;