0.2.65 - End Credits wiring / Gateway: 0.1.45 - Credits

This commit is contained in:
ponzischeme89
2026-08-15 21:11:43 +12:00
parent d5d47473a2
commit e528d04b43
19 changed files with 574 additions and 65 deletions
+4
View File
@@ -51,6 +51,10 @@ func run(itemID string) error {
cfg.EmbyURL, cfg.EmbyPublicURL, cfg.ClientName, cfg.GatewayClientName,
cfg.UpstreamTimeout,
)
// The bench measures the path the service actually takes, so it must read bytes from the
// same address the service reads them from. Benchmarking the public route and deploying
// the internal one would report a number belonging to neither.
embyClient.SetMediaURL(cfg.EmbyMediaURL)
resolver := credits.NewEmbyResolver(embyClient, emby.Credentials{
UserID: cfg.SyncUserID, Token: cfg.SyncAPIKey,
DeviceID: "memby-credits-bench", DeviceName: "MbyGateway Credits", Gateway: true,
+7 -1
View File
@@ -116,6 +116,7 @@ func run(log *slog.Logger, events *logging.Buffer) error {
cfg.EmbyURL, cfg.EmbyPublicURL, cfg.ClientName, cfg.GatewayClientName,
cfg.UpstreamTimeout,
)
embyClient.SetMediaURL(cfg.EmbyMediaURL)
mdblistClient := mdblist.New(mdblist.DefaultBaseURL, cfg.UpstreamTimeout)
var sonarrClient *sonarr.Client
if cfg.SonarrURL != "" {
@@ -217,10 +218,15 @@ func run(log *slog.Logger, events *logging.Buffer) error {
Config: creditsConfig,
})
go creditsService.Run(ctx)
// media_url is on this line rather than the ready line because credits detection is
// the only thing that uses it, and because reading it back is the only way an
// operator can tell that a scan is taking the short path. Where it equals EmbyURL
// the scans go out the public way, which on a split host is the whole cost.
log.Info("credits detection enabled",
"prefetch", creditsConfig.PrefetchEpisodes,
"queue_limit", creditsConfig.QueueLimit,
"visual", detector != nil)
"visual", detector != nil,
"media_url", cfg.EmbyMediaURL)
}
// The administrative event bus, the integration dispatcher that subscribes to it and