Skip to content

Commit

Permalink
Fixed #53, separate usernames with commas
Browse files Browse the repository at this point in the history
  • Loading branch information
YamiOdymel committed Mar 22, 2024
1 parent 9400591 commit acb1dff
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 21 deletions.
18 changes: 9 additions & 9 deletions README_DEV.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
Compile for 64-bit Windows, macOS, Linux:
Compile All at once:

```
GOOS=windows GOARCH=amd64 go build -o bin/windows/chatubrate-dvr.exe &&
GOOS=darwin GOARCH=amd64 go build -o bin/darwin/chatubrate-dvr &&
GOOS=linux GOARCH=amd64 go build -o bin/linux/chatubrate-dvr
```

Compile for arm64 Windows, macOS, Linux:

```
GOOS=linux GOARCH=amd64 go build -o bin/linux/chatubrate-dvr &&
GOOS=windows GOARCH=arm64 go build -o bin/arm64/windows/chatubrate-dvr.exe &&
GOOS=darwin GOARCH=arm64 go build -o bin/arm64/darwin/chatubrate-dvr &&
GOOS=linux GOARCH=arm64 go build -o bin/arm64/linux/chatubrate-dvr
```

or Compile All at once:
or Compile for 64-bit Windows, macOS, Linux:

```
GOOS=windows GOARCH=amd64 go build -o bin/windows/chatubrate-dvr.exe &&
GOOS=darwin GOARCH=amd64 go build -o bin/darwin/chatubrate-dvr &&
GOOS=linux GOARCH=amd64 go build -o bin/linux/chatubrate-dvr &&
GOOS=linux GOARCH=amd64 go build -o bin/linux/chatubrate-dvr
```

or for arm64 Windows, macOS, Linux:

```
GOOS=windows GOARCH=arm64 go build -o bin/arm64/windows/chatubrate-dvr.exe &&
GOOS=darwin GOARCH=arm64 go build -o bin/arm64/darwin/chatubrate-dvr &&
GOOS=linux GOARCH=arm64 go build -o bin/arm64/linux/chatubrate-dvr
Expand Down
Binary file modified bin/arm64/darwin/chatubrate-dvr
Binary file not shown.
Binary file modified bin/arm64/linux/chatubrate-dvr
Binary file not shown.
Binary file modified bin/arm64/windows/chatubrate-dvr.exe
Binary file not shown.
Binary file modified bin/darwin/chatubrate-dvr
Binary file not shown.
Binary file modified bin/linux/chatubrate-dvr
Binary file not shown.
Binary file modified bin/windows/chatubrate-dvr.exe
Binary file not shown.
26 changes: 15 additions & 11 deletions handler/create_channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package handler

import (
"net/http"
"strings"

"github.com/gin-gonic/gin"
"github.com/teacat/chaturbate-dvr/chaturbate"
Expand Down Expand Up @@ -48,17 +49,20 @@ func (h *CreateChannelHandler) Handle(c *gin.Context) {
c.AbortWithError(http.StatusBadRequest, err)
return
}
if err := h.chaturbate.CreateChannel(&chaturbate.Config{
Username: req.Username,
Framerate: req.Framerate,
Resolution: req.Resolution,
ResolutionFallback: req.ResolutionFallback,
FilenamePattern: req.FilenamePattern,
SplitDuration: req.SplitDuration,
SplitFilesize: req.SplitFilesize,
}); err != nil {
c.AbortWithError(http.StatusInternalServerError, err)
return
usernames := strings.Split(req.Username, ",")
for _, username := range usernames {
if err := h.chaturbate.CreateChannel(&chaturbate.Config{
Username: strings.TrimSpace(username),
Framerate: req.Framerate,
Resolution: req.Resolution,
ResolutionFallback: req.ResolutionFallback,
FilenamePattern: req.FilenamePattern,
SplitDuration: req.SplitDuration,
SplitFilesize: req.SplitFilesize,
}); err != nil {
c.AbortWithError(http.StatusInternalServerError, err)
return
}
}
if err := h.chaturbate.SaveChannels(); err != nil {
c.AbortWithError(http.StatusInternalServerError, err)
Expand Down
1 change: 1 addition & 0 deletions handler/view/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
<div class="label">chaturbate.com/</div>
<input type="text" autofocus x-model="form_data.username" />
</div>
<div class="ts-text is-description has-top-spaced-small">Use commas to separate multiple channel names. For example, "channel1,channel2,channel3".</div>
</div>
</div>
<!-- / Field: Channel Username -->
Expand Down
Loading

0 comments on commit acb1dff

Please sign in to comment.