Skip to content

Commit

Permalink
Testing if the thumb contains the CDN endpoint and skipping
Browse files Browse the repository at this point in the history
  • Loading branch information
COMTOP1 committed Jan 27, 2025
1 parent a4cc682 commit 333d254
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion services/creator/playout/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"fmt"
"regexp"
"strings"

"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/s3"
Expand Down Expand Up @@ -77,7 +78,7 @@ func (s *Store) UpdateChannel(ctx context.Context, ch playout.Channel) error {
return fmt.Errorf("failed to find channel to update: %w", err)
}

if ch.Thumbnail != "" {
if ch.Thumbnail != "" && !strings.Contains(ch.Thumbnail, s.cdn.Endpoint) {

Check failure on line 81 in services/creator/playout/channel.go

View workflow job for this annotation

GitHub Actions / nilaway

s.cdn.Endpoint undefined (type *s3.Client has no field or method Endpoint)

Check failure on line 81 in services/creator/playout/channel.go

View workflow job for this annotation

GitHub Actions / lint

s.cdn.Endpoint undefined (type *s3.Client has no field or method Endpoint) (typecheck)

Check failure on line 81 in services/creator/playout/channel.go

View workflow job for this annotation

GitHub Actions / lint

s.cdn.Endpoint undefined (type *s3.Client has no field or method Endpoint)) (typecheck)
reg := regexp.MustCompile(`.*/`)
res := reg.ReplaceAllString(ch.Thumbnail, "${1}")

Expand Down

0 comments on commit 333d254

Please sign in to comment.