Commit 2919d392 authored by nanahira's avatar nanahira

use sample as default

parent b1527e37
Pipeline #9446 failed with stages
in 1 minute and 19 seconds
......@@ -23,6 +23,9 @@ export class InstanceConfig implements PicSourceInfo {
@DefineSchema({ description: '页数上限。', default: 200 })
pageLimit: number;
@DefineSchema({ description: '使用原始图而不是 sample 图。', default: false })
useOriginal: boolean;
// 给目标对象注入上述对象。
applyTo(target: PicSourceInfo) {
target.tags = this.tags;
......
......@@ -49,7 +49,7 @@ export class PicSourceInstance extends PicSource {
}
const pic = Random.pick(data);
return {
url: pic.file_url,
url: this.config.useOriginal ? pic.file_url : pic.sample_url,
description: `#${pic.id} ${pic.tags} by ${pic.author}`,
};
}
......
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