Removed Spaces CDN

This commit is contained in:
2024-08-09 12:09:51 +02:00
parent aa87e8c65f
commit f1697323fc
11 changed files with 106 additions and 150 deletions

View File

@ -1,14 +1,14 @@
package arn
import (
"context"
"errors"
"fmt"
"os"
"path/filepath"
"reflect"
"github.com/aerogo/aero"
"github.com/aerogo/api"
"github.com/minio/minio-go/v7"
)
// Force interface implementations
@ -104,8 +104,8 @@ func (amv *AMV) Delete() error {
}
// Remove file
if amv.File != "" && Spaces != nil {
err := Spaces.RemoveObject(context.TODO(), "arn", fmt.Sprintf("videos/amvs/%s", amv.File), minio.RemoveObjectOptions{})
if amv.File != "" {
err := os.Remove(filepath.Join(Root, "videos", "amvs", amv.File))
if err != nil {
return err