1
0
mirror of https://github.com/koloml/furbooru-tagging-assistant.git synced 2025-12-23 23:02:58 +00:00

Add $site property to identify what site entity was created for

This commit is contained in:
2025-08-08 19:46:20 +04:00
parent ae3c77031f
commit 83d27cc966
3 changed files with 7 additions and 0 deletions

View File

@@ -45,6 +45,7 @@ export default class BulkEntitiesTransporter {
exportToJSON(entities: StorageEntity[]): string {
return JSON.stringify({
$type: 'list',
$site: __CURRENT_SITE__,
elements: entities
.map(entity => {
switch (true) {

View File

@@ -11,6 +11,7 @@ const entitiesExporters: ExportersMap = {
profiles: entity => {
return {
$type: "profiles",
$site: __CURRENT_SITE__,
v: 2,
id: entity.id,
name: entity.settings.name,
@@ -22,6 +23,7 @@ const entitiesExporters: ExportersMap = {
groups: entity => {
return {
$type: "groups",
$site: __CURRENT_SITE__,
v: 2,
id: entity.id,
name: entity.settings.name,

View File

@@ -5,6 +5,10 @@ export interface ImportableElement<Type extends string = string> {
* Type of importable. Should be unique to properly import everything.
*/
$type: Type;
/**
* Identifier of the site this element is built for.
*/
$site?: string;
}
export interface ImportableElementsList<ElementsType extends ImportableElement = ImportableElement> extends ImportableElement<"list"> {