Sort trailers before teasers (#14715)

This commit is contained in:
theguymadmax 2025-09-11 17:23:41 -04:00 committed by GitHub
parent 3fad5eb069
commit da19f02f7b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -340,9 +340,12 @@ namespace MediaBrowser.Providers.Plugins.Tmdb.Movies
if (movieResult.Videos?.Results is not null) if (movieResult.Videos?.Results is not null)
{ {
var trailers = new List<MediaUrl>(); var trailers = new List<MediaUrl>();
for (var i = 0; i < movieResult.Videos.Results.Count; i++)
var sortedVideos = movieResult.Videos.Results
.OrderByDescending(video => string.Equals(video.Type, "trailer", StringComparison.OrdinalIgnoreCase));
foreach (var video in sortedVideos)
{ {
var video = movieResult.Videos.Results[i];
if (!TmdbUtils.IsTrailerType(video)) if (!TmdbUtils.IsTrailerType(video))
{ {
continue; continue;