mirror of
https://github.com/truewhile/MeBox.git
synced 2026-10-03 20:26:36 +08:00
优化,现有bug处理
This commit is contained in:
@@ -47,10 +47,20 @@ func (e *EmbyService) embyItemsCacheKey(kind string, p ItemsParams) string {
|
||||
p.SortOrder,
|
||||
strconv.Itoa(p.StartIndex),
|
||||
strconv.Itoa(p.Limit),
|
||||
formatSeasonIndexCacheKeyPart(p.SeasonIndex),
|
||||
}, "|")))
|
||||
return "media:emby:" + hex.EncodeToString(sum[:])
|
||||
}
|
||||
|
||||
// formatSeasonIndexCacheKeyPart keeps "no season filter" distinct from "season 0"
|
||||
// so a client's Season=0 (specials) request never reuses an unfiltered response.
|
||||
func formatSeasonIndexCacheKeyPart(seasonIndex *int) string {
|
||||
if seasonIndex == nil {
|
||||
return "season:*"
|
||||
}
|
||||
return "season:" + strconv.Itoa(*seasonIndex)
|
||||
}
|
||||
|
||||
func (e *EmbyService) embyLatestCacheKey(userID, parentID string, limit int) string {
|
||||
// v2: payload tags for virtual artwork changed so clients drop cached placeholders.
|
||||
sum := sha256.Sum256([]byte(strings.Join([]string{"latest-v2", userID, parentID, strconv.Itoa(limit)}, "|")))
|
||||
|
||||
Reference in New Issue
Block a user