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:
@@ -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) {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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"> {
|
||||
|
||||
Reference in New Issue
Block a user