Skip to content

Commit

Permalink
Properly generate sort modifiers for Philomena (fix #1732)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bionus committed Sep 29, 2020
1 parent c940448 commit e0f4981
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/sites/Philomena/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,18 @@ function searchToArg(search: string): string {
return ret;
}

// Build all "order:XXX" possible modifiers
const sorts = ["id", "updated_at", "first_seen_at", "aspect_ratio", "faves", "upvotes", "downvotes", "score", "wilson_score", "_score", "width", "height", "comment_count", "tag_count", "pixels", "size", "duration"];
const sortModifiers = [];
for (const sort of sorts) {
sortModifiers.push("order:" + sort);
sortModifiers.push("order:" + sort + "_asc");
sortModifiers.push("order:" + sort + "_desc");
}

export const source: ISource = {
name: "Philomena",
modifiers: ["faved_by:", "width:", "height:", "uploader:", "source_url:", "description:", "sha512_hash:", "aspect_ratio:"],
modifiers: ["faved_by:", "width:", "height:", "uploader:", "source_url:", "description:", "sha512_hash:", "aspect_ratio:", ...sortModifiers],
forcedTokens: [],
tagFormat: {
case: "lower",
Expand Down

0 comments on commit e0f4981

Please sign in to comment.