From bdea76024bfad2d7c23e51e7a406b37cc1659df6 Mon Sep 17 00:00:00 2001 From: Abe Jellinek Date: Thu, 24 Aug 2023 03:06:33 -0400 Subject: [PATCH] Add EPUB to Attachment File Type in Advanced Search (#3360) --- chrome/content/zotero/xpcom/schema.js | 9 ++++++++- chrome/locale/en-US/zotero/zotero.properties | 1 + resource/schema/system.sql | 4 ++++ resource/schema/userdata.sql | 2 +- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/schema.js b/chrome/content/zotero/xpcom/schema.js index 65c9547967..c1a394bddf 100644 --- a/chrome/content/zotero/xpcom/schema.js +++ b/chrome/content/zotero/xpcom/schema.js @@ -3450,7 +3450,14 @@ Zotero.Schema = new function(){ } } - // TEMP: When adding 122, check whether IA.authorName fix in items.js::_loadAnnotations() + else if (i == 122) { + await Zotero.DB.queryAsync("INSERT INTO fileTypes VALUES(8, 'ebook')"); + await Zotero.DB.queryAsync("INSERT INTO fileTypeMIMETypes VALUES(8, 'application/epub+zip')"); + // Incorrect, for compatibility + await Zotero.DB.queryAsync("INSERT INTO fileTypeMIMETypes VALUES(8, 'application/epub')"); + } + + // TEMP: When adding 123, check whether IA.authorName fix in items.js::_loadAnnotations() // can be updated due to update steps being indempodent // If breaking compatibility or doing anything dangerous, clear minorUpdateFrom diff --git a/chrome/locale/en-US/zotero/zotero.properties b/chrome/locale/en-US/zotero/zotero.properties index 9d741cb1b4..62d5026163 100644 --- a/chrome/locale/en-US/zotero/zotero.properties +++ b/chrome/locale/en-US/zotero/zotero.properties @@ -668,6 +668,7 @@ fileTypes.audio = Audio fileTypes.video = Video fileTypes.presentation = Presentation fileTypes.document = Document +fileTypes.ebook = Ebook save.error.cannotMakeChangesToCollection = You cannot make changes to the currently selected collection. save.error.cannotAddFilesToCollection = You cannot add files to the currently selected collection. diff --git a/resource/schema/system.sql b/resource/schema/system.sql index 498f94f0fa..e4208c7ed8 100644 --- a/resource/schema/system.sql +++ b/resource/schema/system.sql @@ -117,6 +117,7 @@ INSERT INTO "fileTypes" VALUES(4, 'audio'); INSERT INTO "fileTypes" VALUES(5, 'video'); INSERT INTO "fileTypes" VALUES(6, 'document'); INSERT INTO "fileTypes" VALUES(7, 'presentation'); +INSERT INTO "fileTypes" VALUES(8, 'ebook'); -- webpage INSERT INTO "fileTypeMIMETypes" VALUES(1, 'text/html'); @@ -156,6 +157,9 @@ INSERT INTO "fileTypeMIMETypes" VALUES(7, 'application/powerpoint'); INSERT INTO "fileTypeMIMETypes" VALUES(7, 'application/vnd.oasis.opendocument.presentation'); INSERT INTO "fileTypeMIMETypes" VALUES(7, 'application/x-kpresenter'); INSERT INTO "fileTypeMIMETypes" VALUES(7, 'application/vnd.ms-powerpoint'); +-- ebook +INSERT INTO "fileTypeMIMETypes" VALUES(8, 'application/epub+zip'); +INSERT INTO "fileTypeMIMETypes" VALUES(8, 'application/epub'); -- incorrect, for compatibility INSERT INTO "syncObjectTypes" VALUES(1, 'collection'); INSERT INTO "syncObjectTypes" VALUES(2, 'creator'); diff --git a/resource/schema/userdata.sql b/resource/schema/userdata.sql index da748e36f1..b589aa7656 100644 --- a/resource/schema/userdata.sql +++ b/resource/schema/userdata.sql @@ -1,4 +1,4 @@ --- 121 +-- 122 -- Copyright (c) 2009 Center for History and New Media -- George Mason University, Fairfax, Virginia, USA