module TivoHMO::API::Metadata

Metadata abstraction for containing and displaying supplemental info about an Item

Constants

MPAA_RATINGS
TV_RATINGS

Attributes

actors[RW]
actual_showing[RW]
advisory[RW]
bookmark[RW]
channel[RW]
choreographers[RW]
color_code[RW]
description[RW]
directors[RW]
duration[RW]
episode_number[RW]
episode_title[RW]
executive_producers[RW]
guest_stars[RW]
hosts[RW]
is_episode[RW]
item[RW]
movie_year[RW]
mpaa_rating[RW]
original_air_date[RW]
part_count[RW]
part_index[RW]
producers[RW]
program_genres[RW]
program_id[RW]
recording_quality[RW]
series_genres[RW]
series_id[RW]
series_title[RW]
show_type[RW]
showing_bits[RW]
source_size[RW]
star_rating[RW]
start_time[RW]
stop_time[RW]
time[RW]
title[RW]
tv_rating[RW]
writers[RW]

Public Class Methods

new(item) click to toggle source
# File lib/tivohmo/api/metadata.rb, line 74
def initialize(item)
  self.item = item
  self.duration = 0
  self.showing_bits = 4096
  self.is_episode = true
  self.recording_quality = {name: "HIGH", value: "75"}
  self.color_code = {name: 'COLOR', value: '4'}
  self.show_type = {name: 'SERIES', value: '5'}
  self.channel = {major_number: '0', minor_number: '0', callsign: ''}
end

Public Instance Methods

estimate_source_size() click to toggle source
# File lib/tivohmo/api/metadata.rb, line 101
def estimate_source_size
  # This is needed so that we can give tivo an estimate of transcoded size
  # so transfer doesn't abort half way through.  Using the max audio and
  # video bit rates for a max estimate
  opts = item.transcoder.transcoder_options
  vbr = (opts[:video_bitrate] || opts[:video_max_bitrate] || 30000) * 1000
  abr = (opts[:audio_bitrate] || 448) * 1000
  (self.duration * ((abr + vbr) * 1.02 / 8)).to_i
end