mirror of
https://github.com/teacat/chaturbate-dvr.git
synced 2025-10-29 16:59:59 +00:00
Fixed #55
This commit is contained in:
@@ -21,6 +21,7 @@ type CreateChannelRequest struct {
|
||||
ResolutionFallback string `json:"resolution_fallback"`
|
||||
SplitDuration int `json:"split_duration"`
|
||||
SplitFilesize int `json:"split_filesize"`
|
||||
Interval int `json:"interval"`
|
||||
}
|
||||
|
||||
type CreateChannelResponse struct {
|
||||
@@ -59,6 +60,7 @@ func (h *CreateChannelHandler) Handle(c *gin.Context) {
|
||||
FilenamePattern: req.FilenamePattern,
|
||||
SplitDuration: req.SplitDuration,
|
||||
SplitFilesize: req.SplitFilesize,
|
||||
Interval: req.Interval,
|
||||
}); err != nil {
|
||||
c.AbortWithError(http.StatusInternalServerError, err)
|
||||
return
|
||||
|
||||
@@ -22,6 +22,7 @@ type GetSettingsHandlerResponse struct {
|
||||
FilenamePattern string `json:"filename_pattern"`
|
||||
SplitDuration int `json:"split_duration"`
|
||||
SplitFilesize int `json:"split_filesize"`
|
||||
Interval int `json:"interval"`
|
||||
LogLevel string `json:"log_level"`
|
||||
Port string `json:"port"`
|
||||
GUI string `json:"gui"`
|
||||
@@ -57,6 +58,7 @@ func (h *GetSettingsHandler) Handle(c *gin.Context) {
|
||||
FilenamePattern: h.cli.String("filename-pattern"),
|
||||
SplitDuration: h.cli.Int("split-duration"),
|
||||
SplitFilesize: h.cli.Int("split-filesize"),
|
||||
Interval: h.cli.Int("interval"),
|
||||
LogLevel: h.cli.String("log-level"),
|
||||
Port: h.cli.String("port"),
|
||||
GUI: h.cli.String("gui"),
|
||||
|
||||
@@ -28,6 +28,7 @@ type ListChannelsResponseChannel struct {
|
||||
SplitDuration string `json:"split_duration"`
|
||||
SegmentFilesize string `json:"segment_filesize"`
|
||||
SplitFilesize string `json:"split_filesize"`
|
||||
Interval int `json:"interval"`
|
||||
IsOnline bool `json:"is_online"`
|
||||
IsPaused bool `json:"is_paused"`
|
||||
Logs []string `json:"logs"`
|
||||
@@ -74,6 +75,7 @@ func (h *ListChannelsHandler) Handle(c *gin.Context) {
|
||||
SplitDuration: channel.SplitDurationStr(),
|
||||
SegmentFilesize: channel.SegmentFilesizeStr(),
|
||||
SplitFilesize: channel.SplitFilesizeStr(),
|
||||
Interval: channel.Interval,
|
||||
IsOnline: channel.IsOnline,
|
||||
IsPaused: channel.IsPaused,
|
||||
Logs: channel.Logs,
|
||||
|
||||
@@ -122,6 +122,10 @@
|
||||
</div>
|
||||
<!-- / Field: Filename Pattern -->
|
||||
|
||||
<!-- Field: Check Interval -->
|
||||
<input type="hidden" x-model="form_data.interval" />
|
||||
<!-- / Field: Check Interval -->
|
||||
|
||||
<div class="ts-divider has-vertically-spaced-large"></div>
|
||||
|
||||
<!-- Field: Splitting Options -->
|
||||
|
||||
@@ -11,6 +11,7 @@ function data() {
|
||||
filename_pattern: "{{.Username}}_{{.Year}}-{{.Month}}-{{.Day}}_{{.Hour}}-{{.Minute}}-{{.Second}}{{if .Sequence}}_{{.Sequence}}{{end}}",
|
||||
split_filesize: 0,
|
||||
split_duration: 0,
|
||||
interval: 1,
|
||||
},
|
||||
|
||||
// openCreateDialog
|
||||
@@ -46,7 +47,7 @@ function data() {
|
||||
this.error()
|
||||
return [null, true]
|
||||
}
|
||||
return [(await resp.json()), false]
|
||||
return [await resp.json(), false]
|
||||
} catch {
|
||||
this.error()
|
||||
return [null, true]
|
||||
@@ -83,6 +84,7 @@ function data() {
|
||||
filename_pattern: this.settings.filename_pattern,
|
||||
split_filesize: this.settings.split_filesize.toString(),
|
||||
split_duration: this.settings.split_duration.toString(),
|
||||
interval: this.settings.interval.toString(),
|
||||
}
|
||||
},
|
||||
|
||||
@@ -96,6 +98,7 @@ function data() {
|
||||
filename_pattern: this.form_data.filename_pattern,
|
||||
split_filesize: parseInt(this.form_data.split_filesize),
|
||||
split_duration: parseInt(this.form_data.split_duration),
|
||||
interval: parseInt(this.form_data.interval),
|
||||
})
|
||||
},
|
||||
|
||||
@@ -121,7 +124,6 @@ function data() {
|
||||
alert("The program is terminated, any error messages are safe to ignore.")
|
||||
await this.call("terminate_program", {})
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
// resumeChannel
|
||||
@@ -184,12 +186,14 @@ function data() {
|
||||
},
|
||||
|
||||
downloadLogs(username) {
|
||||
var a = window.document.createElement('a');
|
||||
a.href = window.URL.createObjectURL(new Blob([this.channels[this.channels.findIndex(ch => ch.username === username)].logs.join('\n')], { type: 'text/plain', oneTimeOnly: true }));
|
||||
var a = window.document.createElement("a")
|
||||
a.href = window.URL.createObjectURL(
|
||||
new Blob([this.channels[this.channels.findIndex(ch => ch.username === username)].logs.join("\n")], { type: "text/plain", oneTimeOnly: true })
|
||||
)
|
||||
a.download = `${username}_logs.txt`
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
document.body.removeChild(a);
|
||||
document.body.appendChild(a)
|
||||
a.click()
|
||||
document.body.removeChild(a)
|
||||
},
|
||||
|
||||
//
|
||||
@@ -205,4 +209,4 @@ function data() {
|
||||
}, 1)
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user