Skip to content

Commit

Permalink
feat: Add Ability to sort Actors by Scene Count (xbapps#1439)
Browse files Browse the repository at this point in the history
  • Loading branch information
toshski authored Nov 5, 2023
1 parent da4773f commit eb8cd13
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/models/model_actor.go
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,12 @@ func QueryActors(r RequestActorList, enablePreload bool) ResponseActorList {
} else {
tx = tx.Order("random()")
}
case "scene_count_desc":
tx = tx.
Order("actors.`count` desc, actors.name")
case "scene_available_desc":
tx = tx.
Order("actors.`avail_count` desc, actors.name")
default:
tx = tx.Order("name asc")
}
Expand Down
2 changes: 2 additions & 0 deletions ui/src/locales/en-GB.json
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@
"Clear":"Clear",
"No matching country":"No matching country",
"Scene Released Date":"Scene Released Date",
"Available Scene Count":"Available Scene Count",
"Scene Count":"Scene Count",
"Cast":"Cast",
"Allows searching a variety of attributes such as: Possible Aka actors, Cup Size, Eye/Hair Color, Has Tattoo, Has Piercing, Breast Type, Nationailty, Ethnicity, Aka, Has Images":"Allows searching a variety of attributes such as: Possible Aka actors, Cup Size, Eye/Hair Color, Has Tattoo, Has Piercing, Breast Type, Nationailty, Ethnicity, Aka, Has Images",
"New Aka Group. Select 2 or more actors in the Cast filter":"New Aka Group. Select 2 or more actors in the Cast filter",
Expand Down
2 changes: 2 additions & 0 deletions ui/src/views/actors/Filters.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
<option value="scene_release_desc">↓ {{ $t("Scene Released Date") }}</option>
<option value="scene_added_desc">↓ {{ $t("Scene Added Date") }}</option>
<option value="file_added_desc">↓ {{ $t("File Added Date") }}</option>
<option value="scene_available_desc">↓ {{ $t("Available Scene Count") }}</option>
<option value="scene_count_desc">↓ {{ $t("Scene Count") }}</option>
<option value="random">↯ {{ $t("Random") }}</option>
</select>
</div>
Expand Down

0 comments on commit eb8cd13

Please sign in to comment.