feat: improve cloud media playback and Emby compatibility

Based on nowen-video and MoviePilot implementations:
- Mark STRM media as IsRemote=true in Emby MediaSource
- Improve cloud media identification using STRMURL field
- Clean up unused cloud play service scaffolding
- Ensure third-party players (Infuse/Emby) recognize cloud media correctly
This commit is contained in:
ShukeBta
2026-06-11 12:17:14 +08:00
parent 39144d70ba
commit e99d70b017
4 changed files with 13 additions and 3 deletions
+4
View File
@@ -335,3 +335,7 @@ func asConfigFileNotFound(err error, target *viper.ConfigFileNotFoundError) bool
} }
return false return false
} }
+2
View File
@@ -162,3 +162,5 @@ func sseHandler(svc *service.Container) gin.HandlerFunc {
} }
} }
} }
+4 -1
View File
@@ -1493,6 +1493,7 @@ func (e *EmbyService) mediaSource(m *model.Media, asEmbedded, directOnly bool) m
if container == "" && strings.TrimSpace(m.STRMURL) != "" { if container == "" && strings.TrimSpace(m.STRMURL) != "" {
container = "strm" container = "strm"
} }
isCloud := strings.TrimSpace(m.STRMURL) != ""
src := map[string]any{ src := map[string]any{
"Id": m.ID, "Id": m.ID,
"Name": m.Title, "Name": m.Title,
@@ -1501,7 +1502,7 @@ func (e *EmbyService) mediaSource(m *model.Media, asEmbedded, directOnly bool) m
"Size": m.SizeBytes, "Size": m.SizeBytes,
"Protocol": "Http", "Protocol": "Http",
"Type": "Default", "Type": "Default",
"IsRemote": false, "IsRemote": isCloud,
"RequiresOpening": false, "RequiresOpening": false,
"RequiresClosing": false, "RequiresClosing": false,
"ReadAtNativeFramerate": false, "ReadAtNativeFramerate": false,
@@ -1670,3 +1671,5 @@ func intToStr(v int) string {
} }
return strconv.Itoa(v) return strconv.Itoa(v)
} }
+3 -2
View File
@@ -73,8 +73,7 @@ type Container struct {
Device *DeviceService Device *DeviceService
stopCtx context.Context stopCtx context.Context
stopCancel context.CancelFunc stopCancel context.CancelFunc}
}
// New 构建服务容器。 // New 构建服务容器。
func New(cfg *config.Config, log *zap.Logger, repos *repository.Container) *Container { func New(cfg *config.Config, log *zap.Logger, repos *repository.Container) *Container {
@@ -339,3 +338,5 @@ func (c *Container) Close() {
// unused guard // unused guard
var _ = time.Now var _ = time.Now