-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(api): add new methods & watchProvider entity
- Loading branch information
Showing
6 changed files
with
199 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { makeHttpRequest } from 'utils/utils'; | ||
import urls from 'urls/urls'; | ||
|
||
/** | ||
* @module watchProvider | ||
*/ | ||
|
||
/** | ||
* Returns a list of all of the countries we have watch provider (OTT/streaming) data for. | ||
* @param {Object} options | ||
* @param {string} options.language | ||
* @returns {Promise} | ||
* @see https://developers.themoviedb.org/3/watch-providers/get-available-regions | ||
*/ | ||
export const availableRegions = async (options = {}) => { | ||
const { language } = options; | ||
|
||
return await makeHttpRequest(urls.v3.WATCH_PROVIDERS_AVAILABLE_REGIONS, { | ||
language, | ||
}); | ||
}; | ||
|
||
/** | ||
* Returns a list of the watch provider (OTT/streaming) data we have available for movies. | ||
* You can specify a watch_region param if you want to further filter the list by country. | ||
* @param {Object} options | ||
* @param {string} options.language | ||
* @param {string} options.watch_region | ||
* @returns {Promise} | ||
* @see https://developers.themoviedb.org/3/watch-providers/get-movie-providers | ||
*/ | ||
export const movie = async (options = {}) => { | ||
const { language, watch_region } = options; | ||
|
||
return await makeHttpRequest(urls.v3.WATCH_PROVIDERS_MOVIE, { | ||
language, | ||
watch_region, | ||
}); | ||
}; | ||
|
||
/** | ||
* Returns a list of the watch provider (OTT/streaming) data we have available for TV series. | ||
* You can specify a watch_region param if you want to further filter the list by country. | ||
* @param {Object} options | ||
* @param {string} options.language | ||
* @param {string} options.watch_region | ||
* @returns {Promise} | ||
* @see https://developers.themoviedb.org/3/watch-providers/get-tv-providers | ||
*/ | ||
export const tv = async (options = {}) => { | ||
const { language, watch_region } = options; | ||
|
||
return await makeHttpRequest(urls.v3.WATCH_PROVIDERS_TV, { | ||
language, | ||
watch_region, | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters