mirror of
https://github.com/Radarr/Radarr
synced 2025-02-24 15:21:28 +00:00
Added trailer links to the discovery page.
This commit is contained in:
parent
b1025e7229
commit
5a0f02007f
3 changed files with 17 additions and 0 deletions
|
@ -34,6 +34,8 @@ public class MovieResult
|
||||||
public int vote_count { get; set; }
|
public int vote_count { get; set; }
|
||||||
public bool video { get; set; }
|
public bool video { get; set; }
|
||||||
public float vote_average { get; set; }
|
public float vote_average { get; set; }
|
||||||
|
public string trailer_key { get; set; }
|
||||||
|
public string trailer_site { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -591,6 +591,15 @@ private Movie MapMovie(MovieResult result)
|
||||||
_logger.Debug(result);
|
_logger.Debug(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (result.trailer_key.IsNotNullOrWhiteSpace() && result.trailer_site.IsNotNullOrWhiteSpace())
|
||||||
|
{
|
||||||
|
if (result.trailer_site == "youtube")
|
||||||
|
{
|
||||||
|
imdbMovie.YouTubeTrailerId = result.trailer_key;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return imdbMovie;
|
return imdbMovie;
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
|
|
@ -27,6 +27,12 @@
|
||||||
<span class="label label-warning">In Cinemas</span>
|
<span class="label label-warning">In Cinemas</span>
|
||||||
{{/if_eq}}
|
{{/if_eq}}
|
||||||
<span class="label label-default" title="{{ratings.votes}} Vote(s)">{{ratings.value}}</span>
|
<span class="label label-default" title="{{ratings.votes}} Vote(s)">{{ratings.value}}</span>
|
||||||
|
|
||||||
|
{{#if youTubeTrailerId}}
|
||||||
|
<span class="label label-info">
|
||||||
|
<a href="{{youTubeTrailerUrl}}" style="color: white;">Trailer</a>
|
||||||
|
</span>
|
||||||
|
{{/if}}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue