mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +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:
@@ -823,7 +823,7 @@ func getSceneTitle(index int) string {
|
||||
|
||||
func getRating(index int) sql.NullInt64 {
|
||||
rating := index % 6
|
||||
return sql.NullInt64{Int64: int64(rating), Valid: rating > 0}
|
||||
return sql.NullInt64{Int64: int64(rating * 20), Valid: rating > 0}
|
||||
}
|
||||
|
||||
func getIntPtr(r sql.NullInt64) *int {
|
||||
@@ -967,11 +967,13 @@ func makeScene(i int) *models.Scene {
|
||||
}
|
||||
}
|
||||
|
||||
rating := getRating(i)
|
||||
|
||||
return &models.Scene{
|
||||
Title: title,
|
||||
Details: details,
|
||||
URL: getSceneEmptyString(i, urlField),
|
||||
Rating: getIntPtr(getRating(i)),
|
||||
Rating: getIntPtr(rating),
|
||||
OCounter: getOCounter(i),
|
||||
Date: getObjectDateObject(i),
|
||||
StudioID: studioID,
|
||||
|
||||
Reference in New Issue
Block a user