Publish current app and server
This commit is contained in:
@@ -56,7 +56,7 @@ func (s *Server) cachedRecommendations(ctx context.Context, userID string) []rec
|
||||
|
||||
// buildRecommendations computes and caches rows for one user.
|
||||
func (s *Server) buildRecommendations(ctx context.Context, sess store.Session) ([]recommend.Row, error) {
|
||||
rows, err := s.recommender.BuildRows(ctx, credentials(sess))
|
||||
rows, err := s.recommender.BuildRowsForUser(ctx, credentials(sess), sess.Username)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -135,6 +135,9 @@ func (s *Server) handleForYou(w http.ResponseWriter, r *http.Request, sess store
|
||||
s.log.Warn("prepared For You read failed; using live fallback",
|
||||
"user", sess.EmbyUserID, "error", err)
|
||||
} else if hit {
|
||||
rows = s.filterRecommendationPermissions(r.Context(), sess, rows)
|
||||
rows = s.personalizeTitles(r.Context(), sess, rows)
|
||||
rows = deduplicateRows(personalizeRowsByTitleScores(selectPersonalizedRows(rows)))
|
||||
w.Header().Set("X-Memby-For-You", "prepared")
|
||||
if stale {
|
||||
s.forYou.MarkDirty(r.Context(), sess)
|
||||
@@ -160,6 +163,9 @@ func (s *Server) handleForYou(w http.ResponseWriter, r *http.Request, sess store
|
||||
s.writeUpstreamError(w, err, "could not build For You recommendations")
|
||||
return
|
||||
}
|
||||
rows = s.filterRecommendationPermissions(r.Context(), sess, rows)
|
||||
rows = s.personalizeTitles(r.Context(), sess, rows)
|
||||
rows = deduplicateRows(personalizeRowsByTitleScores(selectPersonalizedRows(rows)))
|
||||
w.Header().Set("X-Memby-For-You", "live-fallback")
|
||||
writeJSON(w, http.StatusOK, map[string]any{"rows": nonNilRows(rows)})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user