Skip to content

Commit fa4eb9a

Browse files
committed
fix: update Slack file upload context and correct file size handling
1 parent 354253f commit fa4eb9a

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Onvif-Cam-Poll
22

3-
[![Go](https://github.com/isaric/onvif-cam-poll/actions/workflows/go.yml/badge.svg?branch=master)](https://github.com/isaric/onvif-cam-poll/actions/workflows/go.yml)
3+
[![Go](https://github.com/isaric/onvif-cam-poll/actions/workflows/go.yml/badge.svg?branch=main)](https://github.com/isaric/onvif-cam-poll/actions/workflows/go.yml)
44

55
Four golang scripts that provide ONVIF motion event polling and time/date setting. The scripts were created to allow
66
the use of IP cameras without using a cloud service as a middle man between the user and the camera(s).

cmd/onvif-motion-poll/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ func getAndUploadSnapshot(url, channelID string, slackClient slack.Client) {
9494
return
9595
}
9696

97-
_, err := slackClient.UploadFileV2Context(slack.UploadFileV2Parameters{
97+
_, err := slackClient.UploadFileV2Context(context.Background(), slack.UploadFileV2Parameters{
9898
Reader: r.Body,
99-
FileSize: r.ContentLength,
99+
FileSize: int(r.ContentLength),
100100
Filename: fmt.Sprintf("%s.png", time.Now().Format("20060102150405")),
101101
Channel: channelID,
102102
})

0 commit comments

Comments
 (0)