Skip to content

Instantly share code, notes, and snippets.

@scherztc
Created September 6, 2016 13:29
Show Gist options
  • Save scherztc/2429d3a2bc6fdd9d4a09d1856030f7db to your computer and use it in GitHub Desktop.
Save scherztc/2429d3a2bc6fdd9d4a09d1856030f7db to your computer and use it in GitHub Desktop.
module BrowseEverything
module Driver
class Kaltura < Base
require 'kaltura'
def icon
'kaltura'
end
def validate_config
unless [:partner_id,:administrator_secret,:service_url].all? { |key| config[key].present? }
raise BrowseEverything::InitializationError, "Kaltura driver requires :partner_id, :administrator_secret, and :service_url"
end
end
def contents(path='')
result = []
@session = ::Kaltura::Session.start
@entries = ::Kaltura::MediaEntry.list
@entries.each do |item|
item.location = item.downloadUrl
item.mtime = Time.at(item.updatedAt.to_i)
result.push(item)
end
result
end
def link_for(path)
byebug
end
def details(path)
byebug
contents(path).first
end
def authorized?
true
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment