diff --git a/app/query/caller.go b/app/query/caller.go index 37b2a3e7..0154f334 100644 --- a/app/query/caller.go +++ b/app/query/caller.go @@ -159,8 +159,10 @@ func (c *Caller) addDefaultHooks() { c.AddPreflightHook(MethodGet, preflightHookGet, builtinHookName) c.AddPreflightHook(MethodClaimSearch, preflightHookClaimSearch, builtinHookName) - c.AddPostflightHook(MethodClaimSearch, postClaimSearchArfleetThumbs, builtinHookName) - c.AddPostflightHook(MethodResolve, postResolveArfleetThumbs, builtinHookName) + if config.GetArfleetEnabled() { + c.AddPostflightHook(MethodClaimSearch, postClaimSearchArfleetThumbs, builtinHookName) + c.AddPostflightHook(MethodResolve, postResolveArfleetThumbs, builtinHookName) + } } func (c *Caller) CloneWithoutHook(endpoint, method, name string) *Caller { diff --git a/app/query/processors.go b/app/query/processors.go index 1799cef7..6b98d3f8 100644 --- a/app/query/processors.go +++ b/app/query/processors.go @@ -264,14 +264,15 @@ func preflightHookGet(caller *Caller, ctx context.Context) (*jsonrpc.RPCResponse contentURL = "https://" + stConfig["host"] + fmt.Sprintf(stConfig["startpath"], claim.ClaimID, sdHash) } - // Inject Arfleet URL - arUrl, err := arweave.GetClaimUrl(config.GetArfleetCDN(), claim.ClaimID) - if err != nil || arUrl == "" { - responseResult[ParamStreamingUrl] = contentURL - } else { - responseResult[ParamStreamingUrl] = arUrl + if config.GetArfleetEnabled() { + // Inject Arfleet URL + arUrl, err := arweave.GetClaimUrl(config.GetArfleetCDN(), claim.ClaimID) + if err != nil || arUrl == "" { + responseResult[ParamStreamingUrl] = contentURL + } else { + responseResult[ParamStreamingUrl] = arUrl + } } - response.Result = responseResult return response, nil } diff --git a/apps/lbrytv/config/config.go b/apps/lbrytv/config/config.go index dce86926..f606c153 100644 --- a/apps/lbrytv/config/config.go +++ b/apps/lbrytv/config/config.go @@ -143,6 +143,10 @@ func GetArfleetCDN() string { return Config.Viper.GetString("ArfleetCDN") } +func GetArfleetEnabled() bool { + return Config.Viper.GetBool("ArfleetEnabled") +} + // GetReflectorUpstream returns config map for publish reflector server. func GetReflectorUpstream() map[string]string { return Config.Viper.GetStringMapString("ReflectorUpstream")