Cleanup
This commit is contained in:
@ -7,7 +7,7 @@ import (
|
||||
"github.com/aerogo/aero"
|
||||
"github.com/animenotifier/notify.moe/arn"
|
||||
"github.com/animenotifier/notify.moe/components"
|
||||
minio "github.com/minio/minio-go/v6"
|
||||
minio "github.com/minio/minio-go/v7"
|
||||
)
|
||||
|
||||
// Get renders the anime episode.
|
||||
@ -33,7 +33,7 @@ func Get(ctx aero.Context) error {
|
||||
uploaded := false
|
||||
|
||||
if arn.Spaces != nil {
|
||||
stat, err := arn.Spaces.StatObject("arn", fmt.Sprintf("videos/anime/%s/%d.webm", anime.ID, episode.Number), minio.StatObjectOptions{})
|
||||
stat, err := arn.Spaces.StatObject(ctx.Request().Context(), "arn", fmt.Sprintf("videos/anime/%s/%d.webm", anime.ID, episode.Number), minio.StatObjectOptions{})
|
||||
uploaded = (err == nil) && (stat.Size > 0)
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
|
||||
"github.com/aerogo/aero"
|
||||
"github.com/animenotifier/notify.moe/arn"
|
||||
minio "github.com/minio/minio-go/v6"
|
||||
minio "github.com/minio/minio-go/v7"
|
||||
)
|
||||
|
||||
// Subtitles returns the subtitles.
|
||||
@ -31,7 +31,7 @@ func Subtitles(ctx aero.Context) error {
|
||||
ctx.Response().SetHeader("Access-Control-Allow-Origin", "*")
|
||||
ctx.Response().SetHeader("Content-Type", "text/vtt; charset=utf-8")
|
||||
|
||||
obj, err := arn.Spaces.GetObject("arn", fmt.Sprintf("videos/anime/%s/%d.%s.vtt", anime.ID, episode.Number, language), minio.GetObjectOptions{})
|
||||
obj, err := arn.Spaces.GetObject(ctx.Request().Context(), "arn", fmt.Sprintf("videos/anime/%s/%d.%s.vtt", anime.ID, episode.Number, language), minio.GetObjectOptions{})
|
||||
|
||||
if err != nil {
|
||||
return ctx.Error(http.StatusInternalServerError, err)
|
||||
|
Reference in New Issue
Block a user