mirror of
https://github.com/truewhile/MeBox.git
synced 2026-10-12 00:06:37 +08:00
初始化
初始化项目
This commit is contained in:
@@ -19,7 +19,6 @@ import (
|
||||
|
||||
"github.com/ShukeBta/MediaStationGo/internal/config"
|
||||
"github.com/ShukeBta/MediaStationGo/internal/repository"
|
||||
"github.com/ShukeBta/MediaStationGo/internal/service/cloud"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
@@ -47,8 +46,6 @@ type EmbyService struct {
|
||||
cfg *config.Config
|
||||
log *zap.Logger
|
||||
repo *repository.Container
|
||||
storage cloudPlaybackResolver
|
||||
probe cloudPlaybackProber
|
||||
cache *RuntimeCacheService
|
||||
subtitle *SubtitleService
|
||||
|
||||
@@ -60,21 +57,10 @@ type EmbyService struct {
|
||||
visibilityMu sync.RWMutex
|
||||
visibilityCache map[string]embyVisibilityCacheEntry
|
||||
|
||||
cloudProbeMu sync.Mutex
|
||||
cloudProbeInFlight map[string]struct{}
|
||||
|
||||
libraryCoverMu sync.Mutex
|
||||
libraryCoverCache map[string]embyArtworkCacheEntry
|
||||
}
|
||||
|
||||
type cloudPlaybackResolver interface {
|
||||
CloudResolve(ctx context.Context, typ, fileRef, clientUA string) (*cloud.DirectLink, error)
|
||||
}
|
||||
|
||||
type cloudPlaybackProber interface {
|
||||
ProbeHTTP(ctx context.Context, rawURL string, headers map[string]string) (*ProbeResult, error)
|
||||
}
|
||||
|
||||
// NewEmbyService is the constructor.
|
||||
func NewEmbyService(cfg *config.Config, log *zap.Logger, repo *repository.Container) *EmbyService {
|
||||
return &EmbyService{cfg: cfg, log: log, repo: repo}
|
||||
@@ -87,14 +73,6 @@ func (e *EmbyService) SetRuntimeCache(cache *RuntimeCacheService) *EmbyService {
|
||||
return e
|
||||
}
|
||||
|
||||
func (e *EmbyService) SetCloudProbe(storage cloudPlaybackResolver, probe cloudPlaybackProber) {
|
||||
if e == nil {
|
||||
return
|
||||
}
|
||||
e.storage = storage
|
||||
e.probe = probe
|
||||
}
|
||||
|
||||
// SetSubtitleService wires the external-subtitle discovery service into the
|
||||
// Emby shim so MediaStreams can advertise sideloaded subtitle tracks. It is
|
||||
// nil-safe: when subtitle is nil, mediaStreams simply emits no subtitle
|
||||
|
||||
Reference in New Issue
Block a user