mirror of
https://github.com/truewhile/MeBox.git
synced 2026-09-28 11:16:37 +08:00
67b85840dc
* Add favourite buttons to library list and series detail pages Co-authored-by: truewhile <truewhile@users.noreply.github.com> * Fix favourites list for remote Emby mounted media Co-authored-by: truewhile <truewhile@users.noreply.github.com> * Route favourites to library series detail when appropriate Co-authored-by: truewhile <truewhile@users.noreply.github.com> * Fix favourites link to library series for remote anime paths Co-authored-by: truewhile <truewhile@users.noreply.github.com> * Fix remote Emby playback history and continue watching - Preserve duration_ms when web player reports duration=0 - Add GET /playback/:id/resume for reliable per-item resume - Switch home continue watching to /watch-history/continue API - Set library_id on remote media for play-profile visibility - Keep continue-watching rows when remote metadata hydration fails Co-authored-by: truewhile <truewhile@users.noreply.github.com> * Fix mobile sort dropdown overflowing off-screen Align dropdown to button left edge on small screens and cap width to viewport so sort options stay fully visible on mobile. Co-authored-by: truewhile <truewhile@users.noreply.github.com> * Remove stale Windows binary backup files Co-authored-by: truewhile <truewhile@users.noreply.github.com> * Fix STRM account edit form not echoing saved config Return config_preview from account API for server/url/username and secret flags. Merge partial config updates so empty password/token fields do not wipe stored credentials. Co-authored-by: truewhile <truewhile@users.noreply.github.com> * perf(strm): speed up OpenList metadata downloads with provider-aware concurrency - Split download semaphore: 115 stays capped at 3 for WAF safety; OpenList/CloudDrive2 WebDAV metadata uses strm.download_threads (default raised to 6, max 16) - Scope 115 WAF cooldown to 115 tasks only so OpenList downloads are not paused - Requeue claimed tasks back to pending when slot acquisition fails or 115 is cooling - Add tests for separate semaphores and requeue behavior Co-authored-by: truewhile <truewhile@users.noreply.github.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: truewhile <truewhile@users.noreply.github.com>
80 lines
3.6 KiB
Go
80 lines
3.6 KiB
Go
package handler
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
|
|
"github.com/ShukeBta/MMTL/internal/service"
|
|
)
|
|
|
|
func registerAuthedUISurfaceRoutes(authed *gin.RouterGroup, svc *service.Container) {
|
|
authed.GET("/media/recent", recentMediaHandler(svc))
|
|
authed.GET("/media/stats", mediaStatsHandler(svc))
|
|
|
|
authed.GET("/danmaku/:id", getDanmakuHandler(svc))
|
|
authed.GET("/danmaku/config", getDanmakuConfigHandler(svc))
|
|
|
|
authed.GET("/watch-history", historyListHandler(svc))
|
|
authed.GET("/watch-history/stats", historyStatsHandler(svc))
|
|
authed.GET("/watch-history/continue", historyContinueHandler(svc))
|
|
authed.DELETE("/watch-history", historyDeleteHandler(svc))
|
|
authed.DELETE("/watch-history/:id", historyDeleteOneHandler(svc))
|
|
|
|
authed.GET("/system/info", systemInfoHandler(svc))
|
|
authed.GET("/system/status", systemStatusHandler(svc))
|
|
|
|
authed.GET("/play-profiles", listPlayProfilesHandler(svc))
|
|
authed.POST("/play-profiles", createPlayProfileHandler(svc))
|
|
authed.PUT("/play-profiles/:id", updatePlayProfileHandler(svc))
|
|
authed.POST("/play-profiles/:id/verify-pin", verifyPlayProfilePINHandler(svc))
|
|
authed.DELETE("/play-profiles/:id", deletePlayProfileHandler(svc))
|
|
}
|
|
|
|
func registerAuthedSearchRoutes(authed *gin.RouterGroup, svc *service.Container) {
|
|
authed.GET("/search", searchUnifiedHandler(svc))
|
|
authed.GET("/search/advanced", searchAdvancedHandler(svc))
|
|
authed.GET("/search/tmdb", searchTMDbHandler(svc))
|
|
}
|
|
|
|
func registerAuthedSystemExtraRoutes(authed *gin.RouterGroup, svc *service.Container) {
|
|
authed.GET("/system/config", listSystemConfigHandler(svc))
|
|
authed.GET("/settings/schema", schemaHandler(svc))
|
|
authed.GET("/system/events/ticket", systemEventsTicketHandler(svc))
|
|
}
|
|
|
|
func registerAuthedStatsExtraRoutes(authed *gin.RouterGroup, svc *service.Container) {
|
|
authed.GET("/stats/user/:id", statsUserHandler(svc))
|
|
authed.GET("/stats/top-users", statsTopUsersHandler(svc))
|
|
authed.POST("/stats/play", statsPlayHandler(svc))
|
|
}
|
|
|
|
func registerAuthedPlaylistExtraRoutes(authed *gin.RouterGroup, svc *service.Container) {
|
|
authed.POST("/playlists/:id/reorder", reorderPlaylistHandler(svc))
|
|
authed.DELETE("/playlists/:id/items/by-id/:item_id", deletePlaylistItemByIDHandler(svc))
|
|
}
|
|
|
|
func registerAuthedDLNAControlRoutes(authed *gin.RouterGroup, svc *service.Container) {
|
|
authed.POST("/dlna/:uuid/play", dlnaPlayHandler(svc))
|
|
authed.POST("/dlna/:uuid/pause", dlnaPauseHandler(svc))
|
|
authed.POST("/dlna/:uuid/stop", dlnaStopHandler(svc))
|
|
authed.GET("/dlna/:uuid/status", dlnaStatusHandler(svc))
|
|
}
|
|
|
|
func registerAuthedFavoriteAndMediaActionRoutes(authed *gin.RouterGroup, svc *service.Container) {
|
|
authed.GET("/favorites", listFavoritesAliasHandler(svc))
|
|
authed.POST("/media/:id/favorite", addMediaFavoriteHandler(svc))
|
|
authed.DELETE("/media/:id/favorite", removeMediaFavoriteHandler(svc))
|
|
authed.GET("/media/:id/favorite/status", getMediaFavoriteStatusHandler(svc))
|
|
authed.POST("/media/:id/ai-scrape", requirePermission(svc, "can_rescrape"), aiScrapeMediaHandler(svc))
|
|
authed.POST("/media/scrape/test", requirePermission(svc, "can_rescrape"), scrapeTestHandler(svc))
|
|
authed.POST("/media/organize", requirePermission(svc, "can_manage_files"), organizeBulkHandler(svc))
|
|
}
|
|
|
|
func registerAuthedPlaybackExtraRoutes(authed *gin.RouterGroup, svc *service.Container) {
|
|
authed.GET("/playback/:id/info", playbackInfoHandler(svc))
|
|
authed.GET("/playback/:id/resume", playbackResumeHandler(svc))
|
|
authed.POST("/playback/:id/progress", playbackProgressHandler(svc))
|
|
authed.GET("/playback/:id/external-players", externalPlayersHandler(svc))
|
|
authed.GET("/playback/:id/external-url", externalURLHandler(svc))
|
|
authed.GET("/playback/transcode/:job_id/status", transcodeStatusHandler(svc))
|
|
}
|