Commit 60d03b46 authored by nanahira's avatar nanahira

rename

parent 96490bd2
...@@ -24,7 +24,7 @@ export interface PicSourceInfo { ...@@ -24,7 +24,7 @@ export interface PicSourceInfo {
weight?: number; weight?: number;
name: string; name: string;
description?: string; description?: string;
default?: boolean; isDefault?: boolean;
} }
export class PicSourceConfig implements PicSourceInfo { export class PicSourceConfig implements PicSourceInfo {
...@@ -37,7 +37,7 @@ export class PicSourceConfig implements PicSourceInfo { ...@@ -37,7 +37,7 @@ export class PicSourceConfig implements PicSourceInfo {
@DefineSchema({ description: '图源描述' }) @DefineSchema({ description: '图源描述' })
description?: string; description?: string;
@DefineSchema({ description: '是否为默认图源' }) @DefineSchema({ description: '是否为默认图源' })
default?: boolean; isDefault?: boolean;
// 给目标对象注入上述对象。 // 给目标对象注入上述对象。
applyTo(target: PicSourceInfo) { applyTo(target: PicSourceInfo) {
...@@ -45,7 +45,7 @@ export class PicSourceConfig implements PicSourceInfo { ...@@ -45,7 +45,7 @@ export class PicSourceConfig implements PicSourceInfo {
target.weight = this.weight; target.weight = this.weight;
target.name = this.name; target.name = this.name;
target.description = this.description; target.description = this.description;
target.default = this.default; target.isDefault = this.isDefault;
} }
} }
......
...@@ -28,7 +28,7 @@ export class PicSource implements PicSourceInfo { ...@@ -28,7 +28,7 @@ export class PicSource implements PicSourceInfo {
weight = 1; weight = 1;
name = 'default'; name = 'default';
description = ''; description = '';
default = false; isDefault = false;
randomPic(picTags: string[]): Awaitable<PicResult> { randomPic(picTags: string[]): Awaitable<PicResult> {
// For override // For override
throw new Error(`Not implemented`); throw new Error(`Not implemented`);
...@@ -95,7 +95,7 @@ export class PicsContainer { ...@@ -95,7 +95,7 @@ export class PicsContainer {
sourceTags.every((t) => s.tags.includes(t)), sourceTags.every((t) => s.tags.includes(t)),
); );
} else if (!includeNonDefault) { } else if (!includeNonDefault) {
sources = sources.filter((s) => s.default); sources = sources.filter((s) => s.isDefault);
} }
return sources; 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