diff --git a/api/album.go b/api/album.go index 780d861..9187401 100644 --- a/api/album.go +++ b/api/album.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "codeberg.org/video-prize-ranch/go-rimgu/types" + "codeberg.org/video-prize-ranch/rimgo/types" "github.com/spf13/viper" "github.com/tidwall/gjson" ) @@ -33,11 +33,11 @@ func FetchAlbum(albumID string) (types.Album, error) { url = strings.ReplaceAll(url, "https://i.imgur.com", "/media") media = append(media, types.Media{ - Id: value.Get("id").String(), - Name: value.Get("name").String(), - Title: value.Get("metadata.title").String(), + Id: value.Get("id").String(), + Name: value.Get("name").String(), + Title: value.Get("metadata.title").String(), Description: value.Get("metadata.description").String(), - Url: url, + Url: url, }) return true @@ -50,10 +50,10 @@ func FetchAlbum(albumID string) (types.Album, error) { } return types.Album{ - Id: data.Get("id").String(), - Title: data.Get("title").String(), - Views: data.Get("view_count").Int(), - CreatedAt: createdAt.Format("January 2, 2006 3:04 PM"), - Media: media, + Id: data.Get("id").String(), + Title: data.Get("title").String(), + Views: data.Get("view_count").Int(), + CreatedAt: createdAt.Format("January 2, 2006 3:04 PM"), + Media: media, }, nil -} \ No newline at end of file +} diff --git a/go.mod b/go.mod index b05f7cd..bc3afdc 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module codeberg.org/video-prize-ranch/go-rimgu +module codeberg.org/video-prize-ranch/rimgo go 1.17 diff --git a/main.go b/main.go index c253ac1..dfe2200 100644 --- a/main.go +++ b/main.go @@ -4,9 +4,9 @@ import ( "log" "net/http" - "codeberg.org/video-prize-ranch/go-rimgu/pages" - "codeberg.org/video-prize-ranch/go-rimgu/static" - "codeberg.org/video-prize-ranch/go-rimgu/views" + "codeberg.org/video-prize-ranch/rimgo/pages" + "codeberg.org/video-prize-ranch/rimgo/static" + "codeberg.org/video-prize-ranch/rimgo/views" "github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2/middleware/filesystem" "github.com/gofiber/template/handlebars" @@ -30,12 +30,12 @@ func main() { if err != nil { log.Fatal(err) } - + engine := handlebars.NewFileSystem(http.FS(views.GetFiles()), ".hbs") app := fiber.New(fiber.Config{ - Views: engine, - Prefork: viper.GetBool("FIBER_PREFORK"), - UnescapePath: true, + Views: engine, + Prefork: viper.GetBool("FIBER_PREFORK"), + UnescapePath: true, StreamRequestBody: true, }) @@ -51,4 +51,4 @@ func main() { app.Get("/gallery/:galleryID", pages.HandleGallery)*/ app.Listen(":" + viper.GetString("RIMGU_PORT")) -} \ No newline at end of file +} diff --git a/pages/album.go b/pages/album.go index aec0be0..f00f7f5 100644 --- a/pages/album.go +++ b/pages/album.go @@ -1,9 +1,8 @@ package pages import ( - "codeberg.org/video-prize-ranch/go-rimgu/api" + "codeberg.org/video-prize-ranch/rimgo/api" "github.com/gofiber/fiber/v2" - ) func HandleAlbum(c *fiber.Ctx) error {