lib/sorenson/services/asset.rb in 360_services-0.0.2 vs lib/sorenson/services/asset.rb in 360_services-0.0.3

- old
+ new

@@ -9,11 +9,11 @@ attr_accessor :encode_date, :frame_rate, :height, :date_last_modified, :video_bitrate_mode, :media_type, :id, :account_id, :number_of_views, :application, :audio_codec, :permalink_location, :status, :description, :video_duration, :abstract_file_id, :version_id, :date_retrieved, :audio_data_rate, :audio_bitrate_mode, :video_codec, :display_name, :name, :video_data_rate, :author_id, :width, :file_size, :thumbnail_image_url, :direct_asset_url, - :password, :metadata, :groups, :embed_list + :password, :metadata, :groups, :embed_list, :group_id # Get all of the assets as a list of guids. Use offset and quantity to return subsets. # Sorenson::Services::Account.login('username', 'password') # assets = Sorenson::Services::Asset.all # names = assets.collect {|asset| asset.name} @@ -23,15 +23,16 @@ list.collect {|a| new(a) } end # Get a list of asset guids by passing a tag name def self.find_all_by_tag(tag_name) - get_from("/tags/#{tag_name}/assets") + p account_id + get_from("/tags/#{tag_name}/assets", :account_id => account_id) end def self.find_all_by_flag(flag_name) - get_from("/flags/#{flag_name}/assets") + get_from("/flags/#{flag_name}/assets?account_id=#{account_id}") end def tags Base.get_from("/assets/#{id}/tags") end @@ -112,10 +113,11 @@ def metadata Base.get_from("/assets/#{id}/metadata") end def group - Group.new(Base.get_from("/groups/#{@group_id}")) if @group_id + return nil if @group_id.nil? + Group.new(Base.get_from("/groups/#{group_id}")['group']) end def initialize(data) @encode_date = data['encode_date'] @frame_rate = data['frame_rate'] \ No newline at end of file