Sha256: b5d30614ab4f8cdf541afff64a2c33f40681ec190c77209094b7d85778f2ba21

Contents?: true

Size: 689 Bytes

Versions: 1

Compression:

Stored size: 689 Bytes

Contents

# encoding: utf-8
module Nokaya

  class Movie < Basic

    require 'spotlite'

    attr_reader :title, :ref_url, :year

    def initialize args, options = {}
      super(args, options)
      @type = :movie
      begin
        resp = Spotlite::Movie.find(@args.join(' '))
      rescue SocketError
        Logs.rec.error 'No connexion'
        return nil
      end
      @options['alt'] ? res = resp[1] : res = resp[0]
      @title = res.title
      @ref_url = res.url
      @year = res.year
      @urls = [res.poster_url]
      @filenames = [name_files()]
    end

    private

    def name_files
      @name ||= @workers.sanitize(@title)
      "#{@type.to_s}-#{@name}"
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nokaya-0.1.3 lib/nokaya/movie.rb