Compare commits

..

3 Commits

3 changed files with 10 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
package filebrowser package handlers
import ( import (
"archive/zip" "archive/zip"

View File

@@ -1,4 +1,4 @@
package user package handlers
import ( import (
"encoding/json" "encoding/json"

View File

@@ -23,7 +23,7 @@ import (
"github.com/marcopiovanello/yt-dlp-web-ui/v3/server/archiver" "github.com/marcopiovanello/yt-dlp-web-ui/v3/server/archiver"
"github.com/marcopiovanello/yt-dlp-web-ui/v3/server/config" "github.com/marcopiovanello/yt-dlp-web-ui/v3/server/config"
"github.com/marcopiovanello/yt-dlp-web-ui/v3/server/dbutil" "github.com/marcopiovanello/yt-dlp-web-ui/v3/server/dbutil"
"github.com/marcopiovanello/yt-dlp-web-ui/v3/server/filebrowser" "github.com/marcopiovanello/yt-dlp-web-ui/v3/server/handlers"
"github.com/marcopiovanello/yt-dlp-web-ui/v3/server/internal" "github.com/marcopiovanello/yt-dlp-web-ui/v3/server/internal"
"github.com/marcopiovanello/yt-dlp-web-ui/v3/server/internal/livestream" "github.com/marcopiovanello/yt-dlp-web-ui/v3/server/internal/livestream"
"github.com/marcopiovanello/yt-dlp-web-ui/v3/server/logging" "github.com/marcopiovanello/yt-dlp-web-ui/v3/server/logging"
@@ -32,7 +32,6 @@ import (
"github.com/marcopiovanello/yt-dlp-web-ui/v3/server/rest" "github.com/marcopiovanello/yt-dlp-web-ui/v3/server/rest"
ytdlpRPC "github.com/marcopiovanello/yt-dlp-web-ui/v3/server/rpc" ytdlpRPC "github.com/marcopiovanello/yt-dlp-web-ui/v3/server/rpc"
"github.com/marcopiovanello/yt-dlp-web-ui/v3/server/status" "github.com/marcopiovanello/yt-dlp-web-ui/v3/server/status"
"github.com/marcopiovanello/yt-dlp-web-ui/v3/server/user"
_ "modernc.org/sqlite" _ "modernc.org/sqlite"
) )
@@ -188,11 +187,11 @@ func newServer(c serverConfig) *http.Server {
if config.Instance().UseOpenId { if config.Instance().UseOpenId {
r.Use(openid.Middleware) r.Use(openid.Middleware)
} }
r.Post("/downloaded", filebrowser.ListDownloaded) r.Post("/downloaded", handlers.ListDownloaded)
r.Post("/delete", filebrowser.DeleteFile) r.Post("/delete", handlers.DeleteFile)
r.Get("/d/{id}", filebrowser.DownloadFile) r.Get("/d/{id}", handlers.DownloadFile)
r.Get("/v/{id}", filebrowser.SendFile) r.Get("/v/{id}", handlers.SendFile)
r.Get("/bulk", filebrowser.BulkDownload(c.mdb)) r.Get("/bulk", handlers.BulkDownload(c.mdb))
}) })
// Archive routes // Archive routes
@@ -200,8 +199,8 @@ func newServer(c serverConfig) *http.Server {
// Authentication routes // Authentication routes
r.Route("/auth", func(r chi.Router) { r.Route("/auth", func(r chi.Router) {
r.Post("/login", user.Login) r.Post("/login", handlers.Login)
r.Get("/logout", user.Logout) r.Get("/logout", handlers.Logout)
r.Route("/openid", func(r chi.Router) { r.Route("/openid", func(r chi.Router) {
r.Get("/login", openid.Login) r.Get("/login", openid.Login)