1
0
mirror of https://github.com/koloml/furbooru-tagging-assistant.git synced 2025-12-24 07:12:57 +00:00

Added initial version of tag group entity with tags & prefixes

This commit is contained in:
2024-12-02 03:12:09 +04:00
parent d5f6ed1a3e
commit e523ce4468
3 changed files with 30 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
import StorageEntity from "$lib/extension/base/StorageEntity.ts";
export interface TagGroupSettings {
name: string;
tags: string[];
prefixes: string[];
}
export default class TagGroup extends StorageEntity<TagGroupSettings> {
constructor(id: string, settings: Partial<TagGroupSettings>) {
super(id, {
name: settings.name || '',
tags: settings.tags || [],
prefixes: settings.prefixes || [],
});
}
static _entityName = 'groups';
}

View File

@@ -13,6 +13,15 @@ const entitiesExporters: ExportersMap = {
tags: entity.settings.tags,
}
},
groups: entity => {
return {
v: 1,
id: entity.id,
name: entity.settings.name,
tags: entity.settings.tags,
prefixes: entity.settings.prefixes,
}
}
};
export function exportEntityToObject(entityInstance: StorageEntity<any>, entityName: string): Record<string, any> {