This commit is contained in:
truewhile
2026-09-01 22:43:30 +08:00
parent 165eee7b36
commit d3233a62c0
6 changed files with 267 additions and 20 deletions
+11 -1
View File
@@ -153,7 +153,14 @@ func (e *EmbyService) Items(ctx context.Context, p ItemsParams) (map[string]any,
if mount == nil || acct == nil {
return emptyItemsEnvelope(p.StartIndex), nil
}
return e.remote.RemoteItems(ctx, mount, acct, p)
out, err := e.remote.RemoteItems(ctx, mount, acct, p)
if err != nil {
return nil, err
}
if err := e.mergeRemoteUserData(ctx, p.UserID, out); err != nil {
return nil, err
}
return out, nil
}
// 全局搜索:无 ParentId 且带搜索词 → 聚合本地 + 全部远程。
if p.ParentID == "" && p.SearchTerm != "" {
@@ -274,6 +281,9 @@ func (e *EmbyService) aggregatedSearch(ctx context.Context, p ItemsParams) (map[
}
continue
}
if err := e.mergeRemoteUserData(ctx, p.UserID, remote); err != nil {
return nil, err
}
if raw, ok := remote["Items"].([]any); ok {
results = append(results, remoteResult{items: raw})
} else if rawMap, ok := remote["Items"].([]map[string]any); ok {