Skip to content

Commit 333d254

Browse files
committed
Testing if the thumb contains the CDN endpoint and skipping
1 parent a4cc682 commit 333d254

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

services/creator/playout/channel.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55
"fmt"
66
"regexp"
7+
"strings"
78

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

80-
if ch.Thumbnail != "" {
81+
if ch.Thumbnail != "" && !strings.Contains(ch.Thumbnail, s.cdn.Endpoint) {
8182
reg := regexp.MustCompile(`.*/`)
8283
res := reg.ReplaceAllString(ch.Thumbnail, "${1}")
8384

0 commit comments

Comments
 (0)