This commit is contained in:
ponzischeme89
2026-08-20 15:06:00 +12:00
parent 549f9c5eed
commit f1164db2c5
52 changed files with 5441 additions and 158 deletions
+12 -1
View File
@@ -231,7 +231,18 @@ func (s *Server) decorateHomeRatings(ctx context.Context, out *homeResponse) {
}
collections = append(collections,
out.ContinueWatching, out.NextUp, out.Favorites, out.LatestMovies)
s.decorateItems(ctx, collections...)
}
// decorateItems is the one door items leave the gateway through.
//
// It attaches both of the things Memby knows about a title that Emby's payload does not
// carry: the stored review scores, and — for a shadow viewer — whose progress this is. The
// two are separate concerns and stayed separate functions, but every call site wanted both,
// and a decoration added at seven sites is a decoration missing from the eighth.
func (s *Server) decorateItems(ctx context.Context, collections ...[]json.RawMessage) {
s.decorateItemRatings(ctx, collections...)
s.decorateViewerState(ctx, collections...)
}
// decorateItemRatings rewrites each item in place with whatever the database already
@@ -293,7 +304,7 @@ func (s *Server) decorateRowRatings(ctx context.Context, rows []recommend.Row) {
for _, row := range rows {
collections = append(collections, row.Items)
}
s.decorateItemRatings(ctx, collections...)
s.decorateItems(ctx, collections...)
}
// ratingKeysForItems resolves Emby ids to external titles, preferring the index built by