thetvdb v1.1.1 TheTVDB.User

This module contains access to all user-scoped endpoints.

All functions allow the user to specify an optional username. If no username is specified, the last authenticated user will be used. See TheTVDB for more information.

Link to this section Summary

Link to this section Types

Link to this type rating_type()
rating_type() :: :series | :episode | :image
Link to this type t()
t() :: %TheTVDB.User{favorites_displaymode: term, language: term, user_name: term}
Link to this type username()
username() :: String.t | nil

Link to this section Functions

Link to this function add_favorite(username \\ nil, series_id)
add_favorite(username, integer) :: :ok | {:error, term}

Add a favorite series for a given user.

Link to this function add_favorite!(username \\ nil, series_id)
add_favorite!(username, integer) :: :ok

See add_favorite/2.

Link to this function add_rating(username \\ nil, type, item, rating)
add_rating(username, rating_type, integer, integer) ::
  :ok |
  {:error, term}

Add a rating for a given user.

# Rate a series
TheTVDB.User.add_rating(:series, series_id, 10.0)
# => :ok

# Rate an episode
TheTVDB.User.add_rating(:episode, episode_id, 10.0)
# => :ok

# Rate an image
TheTVDB.User.add_rating(:image, image_id, 10.0)
# => :ok
Link to this function add_rating!(username \\ nil, type, item, rating)
add_rating!(username, rating_type, integer, integer) :: :ok

See add_rating/4.

Link to this function favorites(username \\ nil)
favorites(username) :: {:ok, [binary]} | {:error, term}

Get a list of all favorited series for a given user.

Link to this function favorites!(username \\ nil)
favorites!(username) :: [binary]

See favorites/1.

Link to this function info(username \\ nil)
info(username) :: {:ok, t} | {:error, term}

Get info about a user.

Link to this function info!(username \\ nil)
info!(username) :: t

See info/1.

Link to this function ratings(username \\ nil)
ratings(username) :: {:ok, [TheTVDB.User.Rating.t]}

Get a list of all ratings for a given user.

Link to this function ratings!(username \\ nil)

See ratings/1.

Link to this function remove_favorite(username \\ nil, series_id)
remove_favorite(username, integer) :: :ok | {:error, term}

Remove a favorite series for a given user.

Link to this function remove_favorite!(username \\ nil, series_id)
remove_favorite!(username, integer) :: :ok

See remove_favorite/2.

Link to this function remove_rating(username \\ nil, type, item)
remove_rating(username, rating_type, integer) ::
  :ok |
  {:error, term}

Remove a rating for a given user.

Link to this function remove_rating!(username, type, item)
remove_rating!(username, rating_type, integer) :: :ok

See remove_rating/3.