27 Components.utils.import(
"resource://gre/modules/XPCOMUtils.jsm");
28 Components.utils.import(
"resource://app/jsmodules/ArrayConverter.jsm");
29 Components.utils.import(
"resource://app/jsmodules/sbLocalDatabaseMigrationUtils.jsm");
30 Components.utils.import(
"resource://app/jsmodules/SBJobUtils.jsm");
32 const Cc = Components.classes;
33 const Ci = Components.interfaces;
34 const Cr = Components.results;
37 dump(
"----++++----++++sbLibraryMigration " +
40 "\n----++++----++++\n");
45 SBLocalDatabaseMigrationUtils.BaseMigrationHandler.call(
this);
47 this.fromVersion = 13;
49 this.versionString = this.fromVersion +
" to " +
58 __proto__: SBLocalDatabaseMigrationUtils.BaseMigrationHandler.prototype,
60 classID: Components.ID(
"{cd3b44bf-1f72-4006-aa06-2f00fc0948bb}"),
61 contractID: SBLocalDatabaseMigrationUtils.baseHandlerContractID +
' 13 to 14',
63 _databaseLocation:
null,
66 migrate:
function sbLibraryMigration_migrate(aLibrary) {
69 this._databaseGUID = aLibrary.databaseGuid;
70 this._databaseLocation = aLibrary.databaseLocation;
72 var query = this._createQuery();
75 query.addQuery(
"update library_metadata set value = '"
76 + this.toVersion +
"' where name = 'version'");
77 query.addQuery(
"commit");
80 query.addQuery(
"VACUUM");
83 query.setAsyncQuery(
true);
84 query.execute(retval);
90 var
prefs =
Cc[
"@mozilla.org/preferences-service;1"]
91 .getService(
Ci.nsIPrefBranch);
92 prefs.setBoolPref(
"songbird.propertycache." +
93 this._databaseGUID +
".invalidSortData",
true);
94 prefs.QueryInterface(
Ci.nsIPrefService).savePrefFile(
null);
97 dump(
"Exception occured: " + e);
102 _createQuery:
function sbLibraryMigration_createQuery() {
103 var query =
Cc[
"@songbirdnest.com/Songbird/DatabaseQuery;1"]
104 .createInstance(
Ci.sbIDatabaseQuery);
105 query.databaseLocation = this._databaseLocation;
106 query.setDatabaseGUID(this._databaseGUID);
117 return XPCOMUtils.generateModule([
function NSGetModule(compMgr, fileSpec)
sbDeviceFirmwareAutoCheckForUpdate prototype contractID
sbDeviceFirmwareAutoCheckForUpdate prototype classDescription
function sbLibraryMigration()
sbDeviceFirmwareAutoCheckForUpdate prototype classID