TMDbLib/Client/TMDbClientLists.cs
/// <summary>
/// Will check if the provided movie id is present in the specified list
/// </summary>
/// <param name="listId">Id of the list to check in</param>
/// <param name="movieId">Id of the movie to check for in the list</param>
/// <param name="cancellationToken">A cancellation token</param>
Will check if the provided movie id is present in the specified list
Will check if the provided movie id is present in the specified list
public async Task<bool> GetListIsMoviePresentAsync(string listId, int movieId, CancellationToken cancellationToken = default)
        {
            if (string.IsNullOrWhiteSpace(listId))
                throw new ArgumentNullException(nameof(listId));
            if (movieId <= 0)
                throw new ArgumentOutOfRangeException(nameof(movieId));
            RestRequest req = _client.Create("list/{listId}/item_status");
            req.AddUrlSegment("listId", listId);
            req.AddParameter("movie_id", movieId.ToString());
            RestResponse<ListStatus> response = await req.Get<ListStatus>(cancellationToken).ConfigureAwait(false);
            return (await response.GetDataObject().ConfigureAwait(false)).ItemPresent;
        }
public async Task < bool > GetListIsMoviePresentAsync ( string listId , int movieId , CancellationToken cancellationToken = default ) { if ( string . IsNullOrWhiteSpace ( listId ) ) throw new ArgumentNullException ( nameof ( listId ) ) ; if ( movieId <= 0 ) throw new ArgumentOutOfRangeException ( nameof ( movieId ) ) ; RestRequest req = _client . Create ( " " ) ; req . AddUrlSegment ( " " , listId ) ; req . AddParameter ( " " , movieId . ToString ( ) ) ; RestResponse < ListStatus > response = await req . Get < ListStatus > ( cancellationToken ) . ConfigureAwait ( false ) ; return ( await response . GetDataObject ( ) . ConfigureAwait ( false ) ) . ItemPresent ; }
Will check if the provided movie id is present in the specified list
Will check if the provided movie id is present in the specified list
listId
string
Id of the list to check in
Id of the list to check in
movieId
int
Id of the movie to check for in the list
Id of the movie to check for in the list
cancellationToken
CancellationToken
A cancellation token
A cancellation token