Compare commits
No commits in common. "408e7cb701990b0242a7e12e3571ee53e47cbecf" and "f88861a50d69b6bd40771ef0afa53bd7aae70704" have entirely different histories.
408e7cb701
...
f88861a50d
|
@ -760,7 +760,6 @@ func fetchLatestStreamStatus(ctx context.Context, conn db.ConnOrTx, twitchID str
|
|||
twitchID,
|
||||
)
|
||||
if err == db.NotFound {
|
||||
twitchLog(ctx, conn, models.TwitchLogTypeOther, twitchLogin, "Creating new streamer", fmt.Sprintf("twitchID: %s", twitchID))
|
||||
_, err = conn.Exec(ctx,
|
||||
`
|
||||
INSERT INTO twitch_latest_status (twitch_id, twitch_login)
|
||||
|
@ -775,6 +774,7 @@ func fetchLatestStreamStatus(ctx context.Context, conn db.ConnOrTx, twitchID str
|
|||
result = &models.TwitchLatestStatus{
|
||||
TwitchID: twitchID,
|
||||
TwitchLogin: twitchLogin,
|
||||
Tags: make([]string, 0),
|
||||
}
|
||||
} else if err != nil {
|
||||
return nil, oops.New(err, "failed to fetch existing twitch status")
|
||||
|
@ -815,10 +815,6 @@ func saveLatestStreamStatus(ctx context.Context, conn db.ConnOrTx, latest *model
|
|||
return err
|
||||
}
|
||||
|
||||
if latest.Tags == nil {
|
||||
latest.Tags = make([]string, 0)
|
||||
}
|
||||
|
||||
_, err = conn.Exec(ctx,
|
||||
`
|
||||
UPDATE twitch_latest_status
|
||||
|
@ -878,6 +874,7 @@ func updateStreamHistory(ctx context.Context, dbConn db.ConnOrTx, status *models
|
|||
|
||||
if err == db.NotFound {
|
||||
history = &models.TwitchStreamHistory{}
|
||||
history.Tags = make([]string, 0)
|
||||
history.StreamID = status.StreamID
|
||||
history.TwitchID = status.TwitchID
|
||||
history.TwitchLogin = status.TwitchLogin
|
||||
|
@ -897,10 +894,6 @@ func updateStreamHistory(ctx context.Context, dbConn db.ConnOrTx, status *models
|
|||
history.CategoryID = status.CategoryID
|
||||
history.Tags = status.Tags
|
||||
|
||||
if history.Tags == nil {
|
||||
history.Tags = make([]string, 0)
|
||||
}
|
||||
|
||||
_, err = tx.Exec(ctx,
|
||||
`
|
||||
INSERT INTO
|
||||
|
|
Loading…
Reference in New Issue