mirror of
https://github.com/truewhile/MeBox.git
synced 2026-09-29 03:26: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
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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) != "" {
|
||||
container = "strm"
|
||||
}
|
||||
isCloud := strings.TrimSpace(m.STRMURL) != ""
|
||||
src := map[string]any{
|
||||
"Id": m.ID,
|
||||
"Name": m.Title,
|
||||
@@ -1501,7 +1502,7 @@ func (e *EmbyService) mediaSource(m *model.Media, asEmbedded, directOnly bool) m
|
||||
"Size": m.SizeBytes,
|
||||
"Protocol": "Http",
|
||||
"Type": "Default",
|
||||
"IsRemote": false,
|
||||
"IsRemote": isCloud,
|
||||
"RequiresOpening": false,
|
||||
"RequiresClosing": false,
|
||||
"ReadAtNativeFramerate": false,
|
||||
@@ -1670,3 +1671,5 @@ func intToStr(v int) string {
|
||||
}
|
||||
return strconv.Itoa(v)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -73,8 +73,7 @@ type Container struct {
|
||||
Device *DeviceService
|
||||
|
||||
stopCtx context.Context
|
||||
stopCancel context.CancelFunc
|
||||
}
|
||||
stopCancel context.CancelFunc}
|
||||
|
||||
// New 构建服务容器。
|
||||
func New(cfg *config.Config, log *zap.Logger, repos *repository.Container) *Container {
|
||||
@@ -339,3 +338,5 @@ func (c *Container) Close() {
|
||||
// unused guard
|
||||
var _ = time.Now
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user