mirror of
https://github.com/truewhile/MeBox.git
synced 2026-10-07 13:56:37 +08:00
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:
@@ -335,3 +335,7 @@ func asConfigFileNotFound(err error, target *viper.ConfigFileNotFoundError) bool
|
|||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -162,3 +162,5 @@ func sseHandler(svc *service.Container) gin.HandlerFunc {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user