Commit 60d03b46 authored by nanahira's avatar nanahira

rename

parent 96490bd2
......@@ -24,7 +24,7 @@ export interface PicSourceInfo {
weight?: number;
name: string;
description?: string;
default?: boolean;
isDefault?: boolean;
}
export class PicSourceConfig implements PicSourceInfo {
......@@ -37,7 +37,7 @@ export class PicSourceConfig implements PicSourceInfo {
@DefineSchema({ description: '图源描述' })
description?: string;
@DefineSchema({ description: '是否为默认图源' })
default?: boolean;
isDefault?: boolean;
// 给目标对象注入上述对象。
applyTo(target: PicSourceInfo) {
......@@ -45,7 +45,7 @@ export class PicSourceConfig implements PicSourceInfo {
target.weight = this.weight;
target.name = this.name;
target.description = this.description;
target.default = this.default;
target.isDefault = this.isDefault;
}
}
......
......@@ -28,7 +28,7 @@ export class PicSource implements PicSourceInfo {
weight = 1;
name = 'default';
description = '';
default = false;
isDefault = false;
randomPic(picTags: string[]): Awaitable<PicResult> {
// For override
throw new Error(`Not implemented`);
......@@ -95,7 +95,7 @@ export class PicsContainer {
sourceTags.every((t) => s.tags.includes(t)),
);
} else if (!includeNonDefault) {
sources = sources.filter((s) => s.default);
sources = sources.filter((s) => s.isDefault);
}
return sources;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment