25 Components.utils.import(
"resource://gre/modules/XPCOMUtils.jsm");
26 Components.utils.import(
"resource://app/jsmodules/ArrayConverter.jsm");
27 Components.utils.import(
"resource://app/jsmodules/sbLocalDatabaseMigrationUtils.jsm");
28 Components.utils.import(
"resource://app/jsmodules/SBJobUtils.jsm");
29 Components.utils.import(
"resource://app/jsmodules/sbProperties.jsm");
31 const Cc = Components.classes;
32 const Ci = Components.interfaces;
33 const Cr = Components.results;
39 dump(
"----++++----++++sbLibraryMigration " +
42 "\n----++++----++++\n");
47 SBLocalDatabaseMigrationUtils.BaseMigrationHandler.call(
this);
55 __proto__: SBLocalDatabaseMigrationUtils.BaseMigrationHandler.prototype,
58 classID: Components.ID(
"{73b78226-1dd2-11b2-92ba-c4ba81af8fc1}"),
59 contractID: SBLocalDatabaseMigrationUtils.baseHandlerContractID +
64 migrate:
function sbLibraryMigration_migrate(aLibrary) {
66 this.startNotificationTimer();
67 this._databaseGUID = aLibrary.databaseGuid;
68 this._databaseLocation = aLibrary.databaseLocation;
71 query = this.createMigrationQuery(aLibrary);
73 CREATE INDEX idx_media_items_content_mime_type
74 ON media_items(content_mime_type);
78 SET content_mime_type =
"audio"
79 WHERE content_mime_type IS NULL
80 OR NOT content_mime_type IN (
"audio",
"video")
82 query.addQuery(
"commit");
83 query.setAsyncQuery(
false);
84 if (query.execute() != 0) {
85 throw(
"Query failed: " + query.getLastError());
89 LOG(
"Exception occured: " + e);
93 this.stopNotificationTimer();
98 get status()
Ci.sbIJobProgress.STATUS_RUNNING,
102 getErrorMessages: ArrayConverter.stringEnumerator([]),
105 get canCancel()
false,
106 cancel:
function sbLibMig21to22_cancel() {
throw Cr.NS_ERROR_NOT_IMPLEMENTED }
113 return XPCOMUtils.generateModule([
function sbLibraryMigration()
sbDeviceFirmwareAutoCheckForUpdate prototype contractID
sbDeviceFirmwareAutoCheckForUpdate prototype classDescription
sbDeviceFirmwareAutoCheckForUpdate prototype classID
function NSGetModule(compMgr, fileSpec)