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:
skier233
2022-11-15 17:31:44 -05:00
committed by GitHub
parent f66333bac9
commit 7eae751d1c
133 changed files with 2192 additions and 761 deletions

View File

@@ -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;
}
});