You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Ombi/src/Ombi.Helpers/PosterPathHelper.cs

22 lines
616 B

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;
}
}
}