mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-03-12 04:35:27 -07:00
* Added background property to TvRequests * set background property for new requests and display in UI
36 lines
1.1 KiB
C#
36 lines
1.1 KiB
C#
using System.Globalization;
|
|
using System.Linq;
|
|
|
|
namespace Ombi.Helpers
|
|
{
|
|
public class PosterPathHelper
|
|
{
|
|
public static string FixPosterPath(string poster)
|
|
{
|
|
// https://image.tmdb.org/t/p/w150/fJAvGOitU8y53ByeHnM4avtKFaG.jpg
|
|
|
|
if (poster.Contains("image.tmdb.org", CompareOptions.IgnoreCase))
|
|
{
|
|
// Somehow we have a full path here for the poster, we only want the last segment
|
|
var posterSegments = poster.Split('/');
|
|
return posterSegments.Last();
|
|
}
|
|
|
|
return poster;
|
|
}
|
|
|
|
public static string FixBackgroundPath(string background)
|
|
{
|
|
// https://image.tmdb.org/t/p/w1280/fJAvGOitU8y53ByeHnM4avtKFaG.jpg
|
|
|
|
if (background.Contains("image.tmdb.org", CompareOptions.IgnoreCase))
|
|
{
|
|
// Somehow we have a full path here for the poster, we only want the last segment
|
|
var backgroundSegments = background.Split('/');
|
|
return backgroundSegments.Last();
|
|
}
|
|
|
|
return background;
|
|
}
|
|
}
|
|
} |