@ -1,4 +1,4 @@
#nullable disable
#nullable disable
using System ;
using System ;
using System.Collections.Generic ;
using System.Collections.Generic ;
@ -471,33 +471,39 @@ namespace MediaBrowser.Providers.Plugins.Tmdb
}
}
/// <summary>
/// <summary>
/// Gets the absolute URL of the poster .
/// Handles bad path checking and builds the absolute url .
/// </summary>
/// </summary>
/// <param name="posterPath">The relative URL of the poster.</param>
/// <param name="size">The image size to fetch.</param>
/// <param name="path">The relative URL of the image.</param>
/// <returns>The absolute URL.</returns>
/// <returns>The absolute URL.</returns>
p ublic string GetPosterUrl ( string posterP ath)
p rivate string GetUrl ( string size , string p ath)
{
{
if ( string . IsNullOrEmpty ( p osterP ath) )
if ( string . IsNullOrEmpty ( p ath) )
{
{
return null ;
return null ;
}
}
return _tmDbClient . GetImageUrl ( _tmDbClient. Config . Image s. PosterS izes[ ^ 1 ] , p osterP ath) . ToString ( ) ;
return _tmDbClient . GetImageUrl ( size, p ath) . ToString ( ) ;
}
}
/// <summary>
/// <summary>
/// Gets the absolute URL of the backdrop image .
/// Gets the absolute URL of the poster .
/// </summary>
/// </summary>
/// <param name="posterPath">The relative URL of the backdrop image .</param>
/// <param name="posterPath">The relative URL of the poster .</param>
/// <returns>The absolute URL.</returns>
/// <returns>The absolute URL.</returns>
public string Get Backdrop Url( string posterPath )
public string Get Poster Url( string posterPath )
{
{
if ( string . IsNullOrEmpty ( posterPath ) )
return GetUrl ( _tmDbClient . Config . Images . PosterSizes [ ^ 1 ] , posterPath ) ;
{
}
return null ;
}
return _tmDbClient . GetImageUrl ( _tmDbClient . Config . Images . BackdropSizes [ ^ 1 ] , posterPath ) . ToString ( ) ;
/// <summary>
/// Gets the absolute URL of the backdrop image.
/// </summary>
/// <param name="backdropPath">The relative URL of the backdrop image.</param>
/// <returns>The absolute URL.</returns>
public string GetBackdropUrl ( string backdropPath )
{
return GetUrl ( _tmDbClient . Config . Images . BackdropSizes [ ^ 1 ] , backdropPath ) ;
}
}
/// <summary>
/// <summary>
@ -507,12 +513,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb
/// <returns>The absolute URL.</returns>
/// <returns>The absolute URL.</returns>
public string GetProfileUrl ( string actorProfilePath )
public string GetProfileUrl ( string actorProfilePath )
{
{
if ( string . IsNullOrEmpty ( actorProfilePath ) )
return GetUrl ( _tmDbClient . Config . Images . ProfileSizes [ ^ 1 ] , actorProfilePath ) ;
{
return null ;
}
return _tmDbClient . GetImageUrl ( _tmDbClient . Config . Images . ProfileSizes [ ^ 1 ] , actorProfilePath ) . ToString ( ) ;
}
}
/// <summary>
/// <summary>
@ -522,12 +523,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb
/// <returns>The absolute URL.</returns>
/// <returns>The absolute URL.</returns>
public string GetStillUrl ( string filePath )
public string GetStillUrl ( string filePath )
{
{
if ( string . IsNullOrEmpty ( filePath ) )
return GetUrl ( _tmDbClient . Config . Images . StillSizes [ ^ 1 ] , filePath ) ;
{
return null ;
}
return _tmDbClient . GetImageUrl ( _tmDbClient . Config . Images . StillSizes [ ^ 1 ] , filePath ) . ToString ( ) ;
}
}
private Task EnsureClientConfigAsync ( )
private Task EnsureClientConfigAsync ( )
@ -542,7 +538,7 @@ namespace MediaBrowser.Providers.Plugins.Tmdb
GC . SuppressFinalize ( this ) ;
GC . SuppressFinalize ( this ) ;
}
}
/// <summary>
/// <summary>
/// Releases unmanaged and - optionally - managed resources.
/// Releases unmanaged and - optionally - managed resources.
/// </summary>
/// </summary>
/// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
/// <param name="disposing"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>