diff --git a/src/lib/misc/isLimitError.test.ts b/src/lib/misc/isLimitError.test.ts
index e3e23b7a..f11590bd 100644
--- a/src/lib/misc/isLimitError.test.ts
+++ b/src/lib/misc/isLimitError.test.ts
@@ -1,21 +1,22 @@
-import { PDF_EXCEEDS_MAX_PAGE_LIMIT } from '../parser/pdf/convertPDFToImages';
+import { PDF_EXCEEDS_MAX_PAGE_LIMIT } from '../pdf/convertPDFToImages';
import { isLimitError } from './isLimitError';
-const MOCK_MSG = "
Your request has hit the limit
- Split your request into multiple smaller ones (i.e.) make your upload size smaller.
Subscribe for only $2 per month to remove all the limits.
- Or Become a patron to support me.
If you already have an account, please login and try again. If you are still experiencing issues, please contact support@2anki.net.
";
+const MOCK_MSG =
+ 'Your request has hit the limit
- Split your request into multiple smaller ones (i.e.) make your upload size smaller.
Subscribe for only $2 per month to remove all the limits.
- Or Become a patron to support me.
If you already have an account, please login and try again. If you are still experiencing issues, please contact support@2anki.net.
';
describe('isLimitError', () => {
it('returns true ', () => {
- expect(isLimitError(new Error("File too large"))).toBe(true);
- expect(isLimitError(new Error("You can only add 100 cards"))).toBe(true);
+ expect(isLimitError(new Error('File too large'))).toBe(true);
+ expect(isLimitError(new Error('You can only add 100 cards'))).toBe(true);
expect(isLimitError(new Error(PDF_EXCEEDS_MAX_PAGE_LIMIT))).toBe(true);
});
it('returns true for html', () => {
expect(isLimitError(new Error(MOCK_MSG))).toBe(true);
- })
+ });
- it("returns false", () => {
- expect(isLimitError(new Error("File too small"))).toBe(false);
+ it('returns false', () => {
+ expect(isLimitError(new Error('File too small'))).toBe(false);
expect(isLimitError()).toBe(false);
- })
+ });
});
diff --git a/src/lib/misc/isLimitError.ts b/src/lib/misc/isLimitError.ts
index 997ed767..adbb6b5b 100644
--- a/src/lib/misc/isLimitError.ts
+++ b/src/lib/misc/isLimitError.ts
@@ -1,4 +1,4 @@
-import { PDF_EXCEEDS_MAX_PAGE_LIMIT } from '../parser/pdf/convertPDFToImages';
+import { PDF_EXCEEDS_MAX_PAGE_LIMIT } from '../pdf/convertPDFToImages';
const LIMIT_MESSAGES = [
'File too large',
diff --git a/src/lib/parser/PrepareDeck.ts b/src/lib/parser/PrepareDeck.ts
index 37bff7ed..f46a2da0 100644
--- a/src/lib/parser/PrepareDeck.ts
+++ b/src/lib/parser/PrepareDeck.ts
@@ -1,9 +1,10 @@
import getDeckFilename from '../anki/getDeckFilename';
import { DeckParser, DeckParserInput } from './DeckParser';
import Deck from './Deck';
-import { isPDFFile } from '../storage/checks';
+import { isPDFFile, isPPTFile } from '../storage/checks';
import { convertPDFToHTML } from './experimental/VertexAPI/convertPDFToHTML';
-import { convertPDFToImages } from './pdf/convertPDFToImages';
+import { convertPDFToImages } from '../pdf/convertPDFToImages';
+import { convertPPTToPDF } from '../pdf/ConvertPPTToPDF';
interface PrepareDeckResult {
name: string;
@@ -15,11 +16,24 @@ export async function PrepareDeck(
input: DeckParserInput
): Promise