summaryrefslogtreecommitdiff
path: root/logic/cartridge/streaming.rb
diff options
context:
space:
mode:
Diffstat (limited to 'logic/cartridge/streaming.rb')
-rw-r--r--logic/cartridge/streaming.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/logic/cartridge/streaming.rb b/logic/cartridge/streaming.rb
new file mode 100644
index 0000000..a0f8700
--- /dev/null
+++ b/logic/cartridge/streaming.rb
@@ -0,0 +1,25 @@
+# frozen_string_literal: true
+
+require_relative '../helpers/hash'
+
+module NanoBot
+ module Logic
+ module Cartridge
+ module Streaming
+ def self.enabled?(cartridge, interface)
+ return false if Helpers::Hash.fetch(cartridge, %i[provider settings stream]) == false
+
+ specific_interface = Helpers::Hash.fetch(cartridge, [:interfaces, interface, :output, :stream])
+
+ return specific_interface unless specific_interface.nil?
+
+ interface = Helpers::Hash.fetch(cartridge, %i[interfaces output stream])
+
+ return interface unless interface.nil?
+
+ true
+ end
+ end
+ end
+ end
+end