Class: Traktr::Show::Episode

Inherits:
Endpoint show all
Defined in:
lib/traktr/show/episode.rb

Instance Method Summary collapse

Methods inherited from Endpoint

#initialize

Constructor Details

This class inherits a constructor from Traktr::Endpoint

Instance Method Details

#comments(title, season, episode) ⇒ Object



4
5
6
# File 'lib/traktr/show/episode.rb', line 4

def comments(title, season, episode)
  parse_response self.class.get("/" + File.join("comments.json", @client.api_key, title, season.to_s, episode.to_s))
end

#library(show, episodes) ⇒ Object



20
21
22
23
24
25
26
27
# File 'lib/traktr/show/episode.rb', line 20

def library(show, episodes)
  data = {
      username: @client.username, password: @client.password,
      title: show.title, year: show.year, imdb_id: show.imdb_id, tvdb_id: show.tvdb_id,
      episodes: episodes.collect{ |e| { season: e.season, episode: e.episode } }
  }
  parse_response self.class.post("/" + File.join("library", @client.api_key), body: data.to_json, headers: { 'Content-Type' => 'application/json'})
end

#seen(show, episodes) ⇒ Object



38
39
40
41
42
43
44
45
# File 'lib/traktr/show/episode.rb', line 38

def seen(show, episodes)
  data = {
      username: @client.username, password: @client.password,
      title: show.title, year: show.year, imdb_id: show.imdb_id, tvdb_id: show.tvdb_id,
      episodes: episodes.collect{ |e| { season: e.season, episode: e.episode } }
  }
  parse_response self.class.post("/" + File.join("seen", @client.api_key), body: data.to_json, headers: { 'Content-Type' => 'application/json'})
end

#stats(title, season, episode) ⇒ Object



8
9
10
# File 'lib/traktr/show/episode.rb', line 8

def stats(title, season, episode)
  parse_response self.class.get("/" + File.join("stats.json", @client.api_key, title, season.to_s, episode.to_s))
end

#summary(title, season, episode) ⇒ Object



12
13
14
# File 'lib/traktr/show/episode.rb', line 12

def summary(title, season, episode)
  parse_response self.class.get("/" + File.join("summary.json", @client.api_key, title, season.to_s, episode.to_s))
end

#unlibrary(show, episodes) ⇒ Object



29
30
31
32
33
34
35
36
# File 'lib/traktr/show/episode.rb', line 29

def unlibrary(show, episodes)
  data = {
      username: @client.username, password: @client.password,
      title: show.title, year: show.year, imdb_id: show.imdb_id, tvdb_id: show.tvdb_id,
      episodes: episodes.collect{ |e| { season: e.season, episode: e.episode } }
  }
  parse_response self.class.post("/" + File.join("unlibrary", @client.api_key), body: data.to_json, headers: { 'Content-Type' => 'application/json'})
end

#unseen(show, episodes) ⇒ Object



47
48
49
50
51
52
53
54
# File 'lib/traktr/show/episode.rb', line 47

def unseen(show, episodes)
  data = {
      username: @client.username, password: @client.password,
      title: show.title, year: show.year, imdb_id: show.imdb_id, tvdb_id: show.tvdb_id,
      episodes: episodes.collect{ |e| { season: e.season, episode: e.episode } }
  }
  parse_response self.class.post("/" + File.join("unseen", @client.api_key), body: data.to_json, headers: { 'Content-Type' => 'application/json'})
end

#unwatchlist(show, episodes) ⇒ Object



65
66
67
68
69
70
71
72
# File 'lib/traktr/show/episode.rb', line 65

def unwatchlist(show, episodes)
  data = {
      username: @client.username, password: @client.password,
      title: show.title, year: show.year, imdb_id: show.imdb_id, tvdb_id: show.tvdb_id,
      episodes: episodes.collect{ |e| { season: e.season, episode: e.episode } }
  }
  parse_response self.class.post("/" + File.join("unwatchlist", @client.api_key), body: data.to_json, headers: { 'Content-Type' => 'application/json'})
end

#watchingnow(title, season, episode) ⇒ Object



16
17
18
# File 'lib/traktr/show/episode.rb', line 16

def watchingnow(title, season, episode)
  parse_response self.class.get("/" + File.join("watchingnow.json", @client.api_key, title, season.to_s, episode.to_s))
end

#watchlist(show, episodes) ⇒ Object



56
57
58
59
60
61
62
63
# File 'lib/traktr/show/episode.rb', line 56

def watchlist(show, episodes)
  data = {
      username: @client.username, password: @client.password,
      title: show.title, year: show.year, imdb_id: show.imdb_id, tvdb_id: show.tvdb_id,
      episodes: episodes.collect{ |e| { season: e.season, episode: e.episode } }
  }
  parse_response self.class.post("/" + File.join("watchlist", @client.api_key), body: data.to_json, headers: { 'Content-Type' => 'application/json'})
end