generated from obsidianmd/obsidian-sample-plugin
-
-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(plugin/workflowInbox): experiment with batch processing
feat: basic logging checkpoint feat: other weird checkpoint new back on track broken checkpoint kinda working feat: cleanup feat: update empty state
- Loading branch information
1 parent
b58c719
commit 0a71592
Showing
23 changed files
with
2,151 additions
and
560 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { Notice } from "obsidian"; | ||
|
||
export const VALID_IMAGE_EXTENSIONS = ["png", "jpg", "jpeg", "gif", "svg", "webp"]; | ||
|
||
export const VALID_AUDIO_EXTENSIONS = [ | ||
"mp3", | ||
"mp4", | ||
"mpeg", | ||
"mpga", | ||
"m4a", | ||
"wav", | ||
"webm", | ||
]; | ||
|
||
export const VALID_MEDIA_EXTENSIONS = [ | ||
...VALID_IMAGE_EXTENSIONS, | ||
...VALID_AUDIO_EXTENSIONS, | ||
]; | ||
|
||
export const VALID_TEXT_EXTENSIONS = ["md", "txt"]; | ||
|
||
export const VALID_EXTENSIONS = [ | ||
...VALID_MEDIA_EXTENSIONS, | ||
...VALID_TEXT_EXTENSIONS, | ||
"pdf", | ||
]; | ||
|
||
/** | ||
* Validates if a given file extension is supported by FileOrganizer | ||
* @param extension - The file extension to validate (without the dot) | ||
* @returns boolean indicating if the extension is supported | ||
*/ | ||
export const isValidExtension = (extension: string): boolean => { | ||
const isSupported = VALID_EXTENSIONS.includes(extension); | ||
if (!isSupported) { | ||
new Notice("Sorry, FileOrganizer does not support this file type."); | ||
} | ||
return isSupported; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
export const VALID_MEDIA_EXTENSIONS = [ | ||
"png", | ||
"jpg", | ||
"jpeg", | ||
"gif", | ||
"bmp", | ||
"svg", | ||
"mp3", | ||
"wav", | ||
"mp4", | ||
"mov", | ||
"wmv", | ||
]; | ||
|
||
export const CHUNK_SIZE = 1024 * 1024; // 1MB | ||
export const MAX_CONCURRENT_TASKS = 100; | ||
export const BATCH_DELAY = 100; // ms | ||
export const MAX_BATCH_SIZE = 10; | ||
export const CACHE_TTL = 1000 * 60 * 60 * 24; // 24 hours | ||
export const MAX_LOG_SIZE = 100; | ||
export const ERROR_FOLDER = "_FileOrganizer2000/Error"; | ||
|
||
export const NOTIFICATION_DURATIONS = { | ||
CRITICAL: 10000, // 10 seconds | ||
HIGH: 5000, // 5 seconds | ||
MEDIUM: 3000, // 3 seconds | ||
LOW: 2000, // 2 seconds | ||
}; | ||
|
||
export const FILE_PRIORITIES = { | ||
SMALL: 3, // Small files (<100KB) | ||
MARKDOWN: 2, // Markdown files | ||
DEFAULT: 1, // Default priority | ||
}; | ||
|
||
export const SIZE_THRESHOLDS = { | ||
SMALL: 1024 * 100, // 100KB | ||
}; |
Oops, something went wrong.