Skip to content

Commit

Permalink
feat: improve ai filter
Browse files Browse the repository at this point in the history
  • Loading branch information
MaikoTan committed Mar 4, 2024
1 parent 7548c54 commit fe780f6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/pixiv/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +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,
sort: 'date_desc', // TODO: Pixiv member could use 'popular_desc'
filter: 'for_ios',
}
Expand Down
6 changes: 5 additions & 1 deletion packages/pixiv/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Filtered = 0,
All = 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
Expand Down

0 comments on commit fe780f6

Please sign in to comment.