mirror of
https://github.com/truewhile/MeBox.git
synced 2026-09-29 11:36:36 +08:00
优化客户端封面获取逻辑
修改emby客户端获取封面逻辑,修复没有设置封面导致封面为空的问题
This commit is contained in:
@@ -47,6 +47,13 @@ func embyVirtualFoldersHandler(svc *service.Container) gin.HandlerFunc {
|
||||
case "music":
|
||||
collectionType = "music"
|
||||
}
|
||||
// 库封面广告:能解析出封面时才填 ImageTags.Primary,让客户端去请求
|
||||
// /Items/{libID}/Images/Primary(MediaFolders 是老式端点,客户端主要
|
||||
// 靠 ImageTags 判断有无主图)。
|
||||
imageTags := map[string]string{}
|
||||
if svc.Emby.LibraryHasCover(c.Request.Context(), lib.ID) {
|
||||
imageTags["Primary"] = lib.ID
|
||||
}
|
||||
out = append(out, gin.H{
|
||||
"Name": lib.Name,
|
||||
"Locations": []string{lib.Path},
|
||||
@@ -54,6 +61,7 @@ func embyVirtualFoldersHandler(svc *service.Container) gin.HandlerFunc {
|
||||
"ItemId": lib.ID,
|
||||
"Id": lib.ID,
|
||||
"PrimaryImageItemId": lib.ID,
|
||||
"ImageTags": imageTags,
|
||||
"RefreshStatus": "Idle",
|
||||
"LibraryOptions": gin.H{},
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user