mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 21:04:37 +03:00
Stash rating system (#2830)
* add rating100 fields to represent rating range 1-100 * deprecate existing (1-5) rating fields * add half- and quarter-star options for rating system * add decimal rating system option Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
This commit is contained in:
@@ -2,7 +2,7 @@ import * as GQL from "src/core/generated-graphql";
|
||||
import isEqual from "lodash-es/isEqual";
|
||||
|
||||
interface IHasRating {
|
||||
rating?: GQL.Maybe<number> | undefined;
|
||||
rating100?: GQL.Maybe<number> | undefined;
|
||||
}
|
||||
|
||||
export function getAggregateRating(state: IHasRating[]) {
|
||||
@@ -11,9 +11,9 @@ export function getAggregateRating(state: IHasRating[]) {
|
||||
|
||||
state.forEach((o) => {
|
||||
if (first) {
|
||||
ret = o.rating ?? undefined;
|
||||
ret = o.rating100 ?? undefined;
|
||||
first = false;
|
||||
} else if (ret !== o.rating) {
|
||||
} else if (ret !== o.rating100) {
|
||||
ret = undefined;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user