mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-07-16 02:02:55 -07:00
Added a fix for the poster path issue #1533
This commit is contained in:
parent
f5a0572946
commit
462bbcc4a6
2 changed files with 23 additions and 1 deletions
|
@ -64,7 +64,7 @@ namespace Ombi.Core.Engine
|
||||||
RequestType = RequestType.Movie,
|
RequestType = RequestType.Movie,
|
||||||
Overview = movieInfo.Overview,
|
Overview = movieInfo.Overview,
|
||||||
ImdbId = movieInfo.ImdbId,
|
ImdbId = movieInfo.ImdbId,
|
||||||
PosterPath = movieInfo.PosterPath.TrimStart('/'),
|
PosterPath = PosterPathHelper.FixPosterPath(movieInfo.PosterPath.TrimStart('/')),
|
||||||
Title = movieInfo.Title,
|
Title = movieInfo.Title,
|
||||||
ReleaseDate = !string.IsNullOrEmpty(movieInfo.ReleaseDate)
|
ReleaseDate = !string.IsNullOrEmpty(movieInfo.ReleaseDate)
|
||||||
? DateTime.Parse(movieInfo.ReleaseDate)
|
? DateTime.Parse(movieInfo.ReleaseDate)
|
||||||
|
|
22
src/Ombi.Helpers/PosterPathHelper.cs
Normal file
22
src/Ombi.Helpers/PosterPathHelper.cs
Normal file
|
@ -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…
Add table
Add a link
Reference in a new issue