feat: add deferred playback data context helpers
This commit is contained in:
@@ -6,6 +6,16 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type playbackSourceRefreshKey struct{}
|
type playbackSourceRefreshKey struct{}
|
||||||
|
type deferredPlaybackDataKey struct{}
|
||||||
|
|
||||||
|
func WithDeferredPlaybackData(ctx context.Context) context.Context {
|
||||||
|
return context.WithValue(ctx, deferredPlaybackDataKey{}, true)
|
||||||
|
}
|
||||||
|
|
||||||
|
func PlaybackDataDeferred(ctx context.Context) bool {
|
||||||
|
deferred, _ := ctx.Value(deferredPlaybackDataKey{}).(bool)
|
||||||
|
return deferred
|
||||||
|
}
|
||||||
|
|
||||||
func WithPlaybackSourceRefresh(ctx context.Context) context.Context {
|
func WithPlaybackSourceRefresh(ctx context.Context) context.Context {
|
||||||
return context.WithValue(ctx, playbackSourceRefreshKey{}, true)
|
return context.WithValue(ctx, playbackSourceRefreshKey{}, true)
|
||||||
|
|||||||
Reference in New Issue
Block a user