fixed module path; added translate endpoint to chat API
This commit is contained in:
@@ -2,9 +2,9 @@ package csgo
|
||||
|
||||
import (
|
||||
"context"
|
||||
"csgowtfd/ent"
|
||||
"csgowtfd/utils"
|
||||
"fmt"
|
||||
"git.harting.dev/csgowtf/csgowtfd/ent"
|
||||
"git.harting.dev/csgowtf/csgowtfd/utils"
|
||||
"github.com/an0nfunc/go-steam/v3"
|
||||
"github.com/an0nfunc/go-steam/v3/csgo/protocol/protobuf"
|
||||
"github.com/an0nfunc/go-steam/v3/netutil"
|
||||
@@ -356,16 +356,11 @@ func (dml *DemoMatchLoader) gcWorker(apiKey string, rl ratelimit.Limiter) {
|
||||
}
|
||||
|
||||
iMatch, err := dml.db.Match.Get(context.Background(), matchId)
|
||||
if err != nil {
|
||||
switch e := err.(type) {
|
||||
case *ent.NotFoundError:
|
||||
break
|
||||
default:
|
||||
log.Errorf("[DL] Failure trying to lookup match %d in db: %v", matchId, e)
|
||||
dml.unlockDemo(demo)
|
||||
continue
|
||||
}
|
||||
} else {
|
||||
if err != nil && !ent.IsNotFound(err) {
|
||||
log.Errorf("[DL] Failure trying to lookup match %d in db: %v", matchId, err)
|
||||
dml.unlockDemo(demo)
|
||||
continue
|
||||
} else if err == nil {
|
||||
if iMatch.DemoParsed == false && iMatch.Date.After(time.Now().UTC().AddDate(0, 0, -30)) {
|
||||
log.Infof("[DL] Match %d is loaded, but not parsed. Try parsing.", iMatch.ID)
|
||||
demo.MatchId = matchId
|
||||
|
@@ -4,12 +4,12 @@ import (
|
||||
"bytes"
|
||||
"compress/bzip2"
|
||||
"context"
|
||||
"csgowtfd/ent"
|
||||
"csgowtfd/ent/match"
|
||||
"csgowtfd/ent/matchplayer"
|
||||
"csgowtfd/ent/player"
|
||||
"encoding/gob"
|
||||
"fmt"
|
||||
"git.harting.dev/csgowtf/csgowtfd/ent"
|
||||
"git.harting.dev/csgowtf/csgowtfd/ent/match"
|
||||
"git.harting.dev/csgowtf/csgowtfd/ent/matchplayer"
|
||||
"git.harting.dev/csgowtf/csgowtfd/ent/player"
|
||||
"github.com/golang/geo/r2"
|
||||
"github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs"
|
||||
"github.com/markus-wa/demoinfocs-golang/v2/pkg/demoinfocs/common"
|
||||
@@ -157,7 +157,7 @@ func (dp *DemoParser) MatchPlayerBySteamID(stats []*ent.MatchPlayer, steamId uin
|
||||
for _, tStats := range stats {
|
||||
tPLayer, err := tStats.Edges.PlayersOrErr()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Unbale to get Stats from statList: %v", err)
|
||||
return nil, fmt.Errorf("unable to get stats from statList: %w", err)
|
||||
}
|
||||
if tPLayer.ID == steamId {
|
||||
return tStats, nil
|
||||
|
Reference in New Issue
Block a user