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,13 +1,11 @@
package episode
import (
"fmt"
"net/http"
"github.com/aerogo/aero"
"github.com/animenotifier/notify.moe/arn"
"github.com/animenotifier/notify.moe/components"
minio "github.com/minio/minio-go/v7"
)
// Get renders the anime episode.
@ -32,10 +30,10 @@ func Get(ctx aero.Context) error {
// Does the episode exist?
uploaded := false
if arn.Spaces != nil {
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)
}
// if arn.Spaces != nil {
// 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)
// }
_, episodeIndex := anime.Episodes().Find(episode.Number)