diff --git a/packages/pixiv/src/index.ts b/packages/pixiv/src/index.ts index 1826a7dac..a49b90351 100644 --- a/packages/pixiv/src/index.ts +++ b/packages/pixiv/src/index.ts @@ -29,6 +29,7 @@ class PixivImageSource extends ImageSource { const params: PixivAppApi.SearchParams = { word: query.tags.join(' '), search_target: 'partial_match_for_tags', + search_ai_type: this.config.ai === 2 ? PixivAppApi.SearchAIType.SHOW_AI : PixivAppApi.SearchAIType.HIDE_AI, sort: 'date_desc', // TODO: Pixiv member could use 'popular_desc' filter: 'for_ios', } @@ -165,10 +166,9 @@ namespace PixivImageSource { Schema.const(2).description('R18G') ]).description('年龄分级').default(0), ai: Schema.union([ - Schema.const(0).description('不允许AI作品'), - Schema.const(1).description('允许未知(旧画作或字段未更新)'), + Schema.const(1).description('不允许AI作品'), Schema.const(2).description('允许AI作品') - ]).description('是否允许搜索AI作品').default(0) + ]).description('是否允许搜索AI作品').default(1) }).description('搜索设置'), ]) } diff --git a/packages/pixiv/src/types.ts b/packages/pixiv/src/types.ts index cf726876b..248501d4b 100644 --- a/packages/pixiv/src/types.ts +++ b/packages/pixiv/src/types.ts @@ -20,13 +20,17 @@ export namespace PixivAppApi { | 'week_r18g' export type SearchTarget = 'partial_match_for_tags' | 'exact_match_for_tags' | 'title_and_caption' | 'keyword' - + export enum SearchAIType { + SHOW_AI = 0, + HIDE_AI = 1, + } export type Sort = 'date_desc' | 'date_asc' | 'popular_desc' export type Duration = 'within_last_day' | 'within_last_week' | 'within_last_month' export interface SearchParams { word: string search_target: SearchTarget + search_ai_type?: SearchAIType sort?: Sort filter: Filter duration?: Duration