Use a CDN for faster AMV delivery

This commit is contained in:
2019-08-28 10:07:50 +09:00
parent 1b0bb6fdbd
commit bc4e67f718
9 changed files with 91 additions and 90 deletions

View File

@ -3,8 +3,6 @@ package arn
import (
"errors"
"fmt"
"os"
"path"
"reflect"
"github.com/aerogo/aero"
@ -104,8 +102,8 @@ func (amv *AMV) Delete() error {
}
// Remove file
if amv.File != "" {
err := os.Remove(path.Join(Root, "videos", "amvs", amv.File))
if amv.File != "" && Spaces != nil {
err := Spaces.RemoveObject("arn", fmt.Sprintf("videos/amvs/%s", amv.File))
if err != nil {
return err