Skip to content

Commit

Permalink
solve categories and upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Allan-Nava authored Nov 16, 2023
1 parent 4c56b5f commit efcf716
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
5 changes: 4 additions & 1 deletion compress/api_category.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ import (
* @returns list of categories of the customer
*/

func (o *compress) GetCategories(requestBody categoriesRequest) ([]Category, error) {
func (o *compress) GetCategories() ([]Category, error) {
requestBody := &categoriesRequest{
BaseModel: BaseModel{ClientId: o.GetCliendId(), ApiKey: o.apiKey},
}
//
if errs := validator.Validate(requestBody); errs != nil {
// values not valid, deal with errors here
Expand Down
14 changes: 11 additions & 3 deletions compress/api_upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (o *compress) GetUploads(uploadsPaginated UploadsPaginated) ([]VideoUploadI
*/

func (o *compress) GetSingleUpload( jobid int ) (*VideoUploadInfo, error) {
requestBody := jobidProgressRequest{
requestBody := &jobidProgressRequest{
BaseModel: BaseModel{ClientId: o.GetCliendId(), ApiKey: o.apiKey},
JobId: jobid,
}
Expand Down Expand Up @@ -81,7 +81,7 @@ func (o *compress) GetSingleUpload( jobid int ) (*VideoUploadInfo, error) {
* @returns progressStateResponse
*/
func (o *compress) GetJobidProgress( jobid int ) (*VideoUploadInfo, error) {
requestBody := jobidProgressRequest{
requestBody := &jobidProgressRequest{
BaseModel: BaseModel{ClientId: o.GetCliendId(), ApiKey: o.apiKey},
JobId: jobid,
}
Expand Down Expand Up @@ -111,7 +111,15 @@ func (o *compress) GetJobidProgress( jobid int ) (*VideoUploadInfo, error) {
* @param {string} api_key
* @param {number} jobid
*/
func (o *compress) SetPublishedUpload(requestBody publishedUploadRequest) (*VideoUploadInfo, error) {
func (o *compress) SetPublishedUpload( jobid, published int ) (*VideoUploadInfo, error) {
if published > 1 && published < 0{
return fmt.Errorf("published need to be 0 or 1")
}
requestBody := &publishedUploadRequest{
BaseModel: BaseModel{ClientId: o.GetCliendId(), ApiKey: o.apiKey},
JobId: jobid,
Published: published

Check failure on line 121 in compress/api_upload.go

View workflow job for this annotation

GitHub Actions / build (1.19.x)

syntax error: unexpected newline in composite literal; possibly missing comma or }

Check failure on line 121 in compress/api_upload.go

View workflow job for this annotation

GitHub Actions / build (1.19.x)

syntax error: unexpected newline in composite literal; possibly missing comma or }

Check failure on line 121 in compress/api_upload.go

View workflow job for this annotation

GitHub Actions / build (1.21.x)

syntax error: unexpected newline in composite literal; possibly missing comma or }

Check failure on line 121 in compress/api_upload.go

View workflow job for this annotation

GitHub Actions / build (1.21.x)

syntax error: unexpected newline in composite literal; possibly missing comma or }
}
//
if errs := validator.Validate(requestBody); errs != nil {
// values not valid, deal with errors here
Expand Down
4 changes: 2 additions & 2 deletions compress/compress.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ type ICompress interface {
GetUploads(uploadsPaginated UploadsPaginated) ([]VideoUploadInfo, error) // need to change it with args
GetSingleUpload( jobid int ) (*VideoUploadInfo, error)
GetJobidProgress( jobid int ) (*VideoUploadInfo, error)
SetPublishedUpload(requestBody publishedUploadRequest) (*VideoUploadInfo, error)
SetPublishedUpload( jobid, published int ) (*VideoUploadInfo, error)
UploadS3(destinationFolder string, filename string) error
GetCategories(requestBody categoriesRequest) ([]Category, error)
GetCategories() ([]Category, error)
CreateCategory(requestBody createCategoryRequest) (*Category, error)
GetRestreamers( startFrom, amount int ) ([]Restreamer, error)
GetSingleRestreamer( instanceName string ) (*Restreamer, error)
Expand Down

0 comments on commit efcf716

Please sign in to comment.