Skip to content

Commit

Permalink
fix: AI parameters value
Browse files Browse the repository at this point in the history
  • Loading branch information
SaarChaffee committed Mar 5, 2024
1 parent 7534fd3 commit adf19ac
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions packages/pixiv/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class PixivImageSource extends ImageSource<PixivImageSource.Config> {
const params: PixivAppApi.SearchParams = {
word: query.tags.join(' '),
search_target: 'partial_match_for_tags',
search_ai_type: this.config.ai === 0 ? PixivAppApi.SearchAIType.Filtered : PixivAppApi.SearchAIType.All,
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',
}
Expand Down Expand Up @@ -166,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('搜索设置'),
])
}
Expand Down
4 changes: 2 additions & 2 deletions packages/pixiv/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ export namespace PixivAppApi {

export type SearchTarget = 'partial_match_for_tags' | 'exact_match_for_tags' | 'title_and_caption' | 'keyword'
export enum SearchAIType {
Filtered = 0,
All = 1,
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'
Expand Down

0 comments on commit adf19ac

Please sign in to comment.