Cleanup fixes (#1422)

* cleanup: remove dead code

removing some code that does nothing

* cleanup: fixing usage of deprecated gqlgen/graphql api in api/changeset_translator

* cleanup: changing to recommended comparison methods

Changing byte and case-insensitive string comparison to the recommended methods.

* cleanup: making staticcheck happy
This commit is contained in:
EnameEtavir
2021-05-25 03:03:09 +02:00
committed by GitHub
parent d326d4380f
commit 5c4351f338
9 changed files with 8 additions and 24 deletions

View File

@@ -12,8 +12,8 @@ import (
const updateInputField = "input"
func getArgumentMap(ctx context.Context) map[string]interface{} {
rctx := graphql.GetResolverContext(ctx)
reqCtx := graphql.GetRequestContext(ctx)
rctx := graphql.GetFieldContext(ctx)
reqCtx := graphql.GetOperationContext(ctx)
return rctx.Field.ArgumentMap(reqCtx.Variables)
}

View File

@@ -208,13 +208,10 @@ func (r *queryResolver) SceneMarkerTags(ctx context.Context, scene_id string) ([
return err
}
_, hasKey := tags[markerPrimaryTag.ID]
var sceneMarkerTag *models.SceneMarkerTag
if !hasKey {
sceneMarkerTag = &models.SceneMarkerTag{Tag: markerPrimaryTag}
sceneMarkerTag := &models.SceneMarkerTag{Tag: markerPrimaryTag}
tags[markerPrimaryTag.ID] = sceneMarkerTag
keys = append(keys, markerPrimaryTag.ID)
} else {
sceneMarkerTag = tags[markerPrimaryTag.ID]
}
tags[markerPrimaryTag.ID].SceneMarkers = append(tags[markerPrimaryTag.ID].SceneMarkers, sceneMarker)
}

View File

@@ -161,8 +161,7 @@ func (r *sceneResolver) Movies(ctx context.Context, obj *models.Scene) (ret []*m
}
if sceneIdx.Valid {
var idx int
idx = int(sceneIdx.Int64)
idx := int(sceneIdx.Int64)
sceneMovie.SceneIndex = &idx
}