thetvdb v1.2.0 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
Functions
Add a favorite series for a given user.
Add a rating for a given user.
Get a list of all favorited series for a given user.
Get info about a user.
Get a list of all ratings for a given user.
Remove a favorite series for a given user.
Remove a rating for a given user.
Link to this section Types
rating_type()
Specs
rating_type() :: :series | :episode | :image
Specs
username()
Specs
username() :: String.t() | nil
Link to this section Functions
add_favorite(username \\ nil, series_id)
Specs
Add a favorite series for a given user.
add_favorite!(username \\ nil, series_id)
Specs
See add_favorite/2
.
add_rating(username \\ nil, type, item, rating)
Specs
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
add_rating!(username \\ nil, type, item, rating)
Specs
add_rating!(username(), rating_type(), integer(), integer()) :: :ok
See add_rating/4
.
favorites(username \\ nil)
Specs
Get a list of all favorited series for a given user.
favorites!(username \\ nil)
Specs
See favorites/1
.
info(username \\ nil)
Specs
Get info about a user.
info!(username \\ nil)
Specs
See info/1
.
ratings(username \\ nil)
Specs
ratings(username()) :: {:ok, [TheTVDB.User.Rating.t()]}
Get a list of all ratings for a given user.
ratings!(username \\ nil)
Specs
ratings!(username()) :: [TheTVDB.User.Rating.t()]
See ratings/1
.
remove_favorite(username \\ nil, series_id)
Specs
Remove a favorite series for a given user.
remove_favorite!(username \\ nil, series_id)
Specs
See remove_favorite/2
.
remove_rating(username \\ nil, type, item)
Specs
remove_rating(username(), rating_type(), integer()) :: :ok | {:error, term()}
Remove a rating for a given user.
remove_rating!(username, type, item)
Specs
remove_rating!(username(), rating_type(), integer()) :: :ok
See remove_rating/3
.