mirror of
https://github.com/onlyworlds/obsidian-plugin.git
synced 2026-07-22 11:00:31 +00:00
25 lines
No EOL
822 B
TypeScript
25 lines
No EOL
822 B
TypeScript
import { App, Notice } from 'obsidian';
|
|
import { WorldService } from '../Scripts/WorldService';
|
|
|
|
export class UpdateCategoryCountsCommand {
|
|
app: App;
|
|
manifest: any;
|
|
private worldService: WorldService;
|
|
|
|
constructor(app: App, manifest: any) {
|
|
this.app = app;
|
|
this.manifest = manifest;
|
|
this.worldService = new WorldService(app);
|
|
}
|
|
|
|
async execute(): Promise<void> {
|
|
try {
|
|
const worldName = await this.worldService.getWorldName();
|
|
await this.worldService.updateAllCategoryFolderNames(worldName);
|
|
new Notice('Category folder counts updated successfully!');
|
|
} catch (error) {
|
|
console.error('Error updating category counts:', error);
|
|
new Notice('Failed to update category folder counts');
|
|
}
|
|
}
|
|
} |