Compare commits

...

2 Commits

Author SHA1 Message Date
cc6a562e9e code refactoring 2025-02-03 10:25:20 +01:00
Marco Piovanello
67b01f9e0b fixed postprocessor args (#256)
* fixed postprocessor args

* updated node builder version

* temporary fix for https://github.com/nodejs/corepack/issues/612
2025-02-03 10:24:48 +01:00
5 changed files with 15 additions and 14 deletions

View File

@@ -1,8 +1,8 @@
# Node (pnpm) ------------------------------------------------------------------ # Node (pnpm) ------------------------------------------------------------------
FROM node:20-slim AS ui FROM node:22-slim AS ui
ENV PNPM_HOME="/pnpm" ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH" ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable RUN corepack prepare pnpm@10.0.0 --activate && corepack enable
COPY . /usr/src/yt-dlp-webui COPY . /usr/src/yt-dlp-webui
WORKDIR /usr/src/yt-dlp-webui/frontend WORKDIR /usr/src/yt-dlp-webui/frontend

View File

@@ -41,10 +41,10 @@ export class RPCClient {
}) })
} }
private argsSanitizer(args: string) { private argsSanitizer(args: string): string[] {
return args return args
.split(' ') .split(' ')
.map(a => a.trim().replaceAll("'", '').replaceAll('"', '')) .map(a => a.trim().replaceAll('"', ''))
.filter(Boolean) .filter(Boolean)
} }

View File

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

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/handlers" "github.com/marcopiovanello/yt-dlp-web-ui/v3/server/filebrowser"
"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,6 +32,7 @@ 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"
) )
@@ -187,11 +188,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", handlers.ListDownloaded) r.Post("/downloaded", filebrowser.ListDownloaded)
r.Post("/delete", handlers.DeleteFile) r.Post("/delete", filebrowser.DeleteFile)
r.Get("/d/{id}", handlers.DownloadFile) r.Get("/d/{id}", filebrowser.DownloadFile)
r.Get("/v/{id}", handlers.SendFile) r.Get("/v/{id}", filebrowser.SendFile)
r.Get("/bulk", handlers.BulkDownload(c.mdb)) r.Get("/bulk", filebrowser.BulkDownload(c.mdb))
}) })
// Archive routes // Archive routes
@@ -199,8 +200,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", handlers.Login) r.Post("/login", user.Login)
r.Get("/logout", handlers.Logout) r.Get("/logout", user.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)

View File

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