Added a fix for the poster path issue #1533

pull/1551/head
Jamie.Rees 7 years ago
parent f5a0572946
commit 462bbcc4a6

@ -64,7 +64,7 @@ namespace Ombi.Core.Engine
RequestType = RequestType.Movie,
Overview = movieInfo.Overview,
ImdbId = movieInfo.ImdbId,
PosterPath = movieInfo.PosterPath.TrimStart('/'),
PosterPath = PosterPathHelper.FixPosterPath(movieInfo.PosterPath.TrimStart('/')),
Title = movieInfo.Title,
ReleaseDate = !string.IsNullOrEmpty(movieInfo.ReleaseDate)
? DateTime.Parse(movieInfo.ReleaseDate)

@ -0,0 +1,22 @@
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;
}
}
}
Loading…
Cancel
Save