Log length increase and score update

This commit is contained in:
2018-03-10 01:20:54 +01:00
parent 1f2a8a3eda
commit 9626204f15
3 changed files with 16 additions and 10 deletions

View File

@ -15,11 +15,15 @@ func Get(ctx *aero.Context) string {
return ctx.Redirect("/")
}
ignoreDifferences := arn.FilterIgnoreAnimeDifferences(func(entry *arn.IgnoreAnimeDifference) bool {
return entry.CreatedBy == user.ID
})
logEntries := arn.FilterEditLogEntries(func(entry *arn.EditLogEntry) bool {
return entry.UserID == user.ID
})
score := 0
score := len(ignoreDifferences)
for _, entry := range logEntries {
switch entry.Action {
@ -29,6 +33,10 @@ func Get(ctx *aero.Context) string {
case "edit":
score += 2
if entry.ObjectType == "Anime" && (entry.Key == "Summary" || entry.Key == "Synopsis") {
score += 2
}
case "delete", "arrayRemove":
score++