Add optional MDBList movie ratings

This commit is contained in:
ponzischeme89
2026-08-03 08:55:52 +12:00
parent b6b2a9c25a
commit 666da9c5d3
18 changed files with 840 additions and 4 deletions
+6
View File
@@ -27,6 +27,7 @@ import (
"github.com/ponzischeme89/memby/server/internal/emby"
"github.com/ponzischeme89/memby/server/internal/foryou"
serverlogging "github.com/ponzischeme89/memby/server/internal/logging"
"github.com/ponzischeme89/memby/server/internal/mdblist"
"github.com/ponzischeme89/memby/server/internal/radarr"
"github.com/ponzischeme89/memby/server/internal/recommend"
"github.com/ponzischeme89/memby/server/internal/sonarr"
@@ -42,11 +43,13 @@ type Server struct {
forYou *foryou.Service
sonarr *sonarr.Client
radarr *radarr.Client
mdblist *mdblist.Client
syncer syncerHandle
log *slog.Logger
events *serverlogging.Buffer
sonarrMu sync.Mutex
radarrMu sync.Mutex
mdblistMu sync.Mutex
// alertMu serialises the read-modify-write of the shared alert list. Its producers
// are events — a webhook, a finished sync, a health probe — none of them paced by
// this server, so two can land at once.
@@ -67,6 +70,7 @@ type Deps struct {
ForYou *foryou.Service
Sonarr *sonarr.Client
Radarr *radarr.Client
MDBList *mdblist.Client
Syncer syncerHandle
Log *slog.Logger
Events *serverlogging.Buffer
@@ -82,6 +86,7 @@ func New(cfg config.Config, deps Deps) *Server {
forYou: deps.ForYou,
sonarr: deps.Sonarr,
radarr: deps.Radarr,
mdblist: deps.MDBList,
syncer: deps.Syncer,
log: deps.Log,
events: deps.Events,
@@ -123,6 +128,7 @@ func (s *Server) Routes() http.Handler {
v1.Handle("GET /v1/features", s.authed(s.handleFeatures))
v1.Handle("GET /v1/items/{id}", s.authed(s.handleItem))
v1.Handle("GET /v1/items/{id}/ratings", s.authed(s.handleMovieRatings))
v1.Handle("GET /v1/items/{id}/season-finale", s.authed(s.handleSeasonFinale))
v1.Handle("GET /v1/items/{id}/episodes", s.authed(s.handleSeriesEpisodes))
v1.Handle("GET /v1/items/{id}/related", s.authed(s.handleRelated))