Skip to content

Commit

Permalink
fix: update Upload function signature to change parameter order and a…
Browse files Browse the repository at this point in the history
…djust bucket folder destination path
  • Loading branch information
allan committed Jan 23, 2025
1 parent f1732b7 commit d4e0271
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions compress/api_upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,14 @@ func (o *compress) SetPublishedUpload(jobid int, published int) (*VideoUploadInf
* upload file to compress
* gets signed url from minio, uploads and finally creates the upload record.
* @param {string} file
* @param {string} filename
* @param {string} size
* @param {int} categoryId
* @param {string} title
* @param {string} tags
* @param {string} location
* @param {string} filename
* @param {string} targetFolder
*/
func (o *compress) Upload(file []byte, size int64, categoryId int, title string, tags string, location string, filename string) (*ResponseUpload, error) {
func (o *compress) Upload(file []byte, filename string, size int64, categoryId int, title string, tags string, location string) (*ResponseUpload, error) {
//
respCustomerS3, err := o.GetCustomerS3Zone()
if err != nil {
Expand All @@ -163,7 +162,7 @@ func (o *compress) Upload(file []byte, size int64, categoryId int, title string,
zone := respCustomerS3.Data.Zone
o.debugPrint("zone ", zone)
fmt.Println("bucketUpload: ", respCustomerS3.Data.BucketUpload, " zone ", zone)
bucketFolderDestination := NormalizeURL(respCustomerS3.Data.BucketUpload + filename)
bucketFolderDestination := NormalizeURL(respCustomerS3.Data.BucketUpload + "/" + filename)
//o.debugPrint("bucketFolderDestination " + respCustomerS3.Data.BucketUpload)
fmt.Println("bucketFolderDestination", bucketFolderDestination)
//
Expand Down
2 changes: 1 addition & 1 deletion compress/compress.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type ICompress interface {
GetSingleUpload(jobid int) (*VideoUploadInfo, error)
GetJobidProgress(jobid int) (*VideoUploadInfo, error)
SetPublishedUpload(jobid int, published int) (*VideoUploadInfo, error)
Upload(file []byte, size int64, categoryId int, title string, tags string, location string, filename string) (*ResponseUpload, error)
Upload(file []byte, filename string, size int64, categoryId int, title string, tags string, location string) (*ResponseUpload, error)
//UploadMultipart(reader io.Reader, size int64, categoryId int, title string, tags string, location string, filename string, targetFolder string) (*ResponseUpload, error) // need to add this feature
GetCategories() ([]Category, error)
CreateCategory(name string) (*Category, error)
Expand Down
2 changes: 1 addition & 1 deletion test/api_upload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ func TestUpload(t *testing.T) {

response, err := c.Upload(
fileContent,
stat.Name(),
stat.Size(),
60678,
"title",
"tag",
"",
filePath,
)
//fmt.Print(response)

Expand Down

0 comments on commit d4e0271

Please sign in to comment.