mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-03-26 03:57:12 +00:00
update main projects
This commit is contained in:
@@ -826,30 +826,6 @@ namespace MediaBrowser.Controller.Entities
|
||||
}
|
||||
}
|
||||
|
||||
if (query.SortBy != null && query.SortBy.Length > 0)
|
||||
{
|
||||
if (query.SortBy.Contains(ItemSortBy.AiredEpisodeOrder, StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
Logger.Debug("Query requires post-filtering due to ItemSortBy.AiredEpisodeOrder");
|
||||
return true;
|
||||
}
|
||||
if (query.SortBy.Contains(ItemSortBy.GameSystem, StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
Logger.Debug("Query requires post-filtering due to ItemSortBy.GameSystem");
|
||||
return true;
|
||||
}
|
||||
if (query.SortBy.Contains(ItemSortBy.Players, StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
Logger.Debug("Query requires post-filtering due to ItemSortBy.Players");
|
||||
return true;
|
||||
}
|
||||
if (query.SortBy.Contains(ItemSortBy.VideoBitRate, StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
Logger.Debug("Query requires post-filtering due to ItemSortBy.VideoBitRate");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (query.IsInBoxSet.HasValue)
|
||||
{
|
||||
Logger.Debug("Query requires post-filtering due to IsInBoxSet");
|
||||
@@ -907,18 +883,6 @@ namespace MediaBrowser.Controller.Entities
|
||||
return true;
|
||||
}
|
||||
|
||||
if (query.MinPlayers.HasValue)
|
||||
{
|
||||
Logger.Debug("Query requires post-filtering due to MinPlayers");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (query.MaxPlayers.HasValue)
|
||||
{
|
||||
Logger.Debug("Query requires post-filtering due to MaxPlayers");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (UserViewBuilder.CollapseBoxSetItems(query, this, query.User, ConfigurationManager))
|
||||
{
|
||||
Logger.Debug("Query requires post-filtering due to CollapseBoxSetItems");
|
||||
@@ -949,12 +913,6 @@ namespace MediaBrowser.Controller.Entities
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(query.AlbumArtistStartsWithOrGreater))
|
||||
{
|
||||
Logger.Debug("Query requires post-filtering due to AlbumArtistStartsWithOrGreater");
|
||||
return true;
|
||||
}
|
||||
|
||||
if (query.IsPlayed.HasValue)
|
||||
{
|
||||
if (query.IncludeItemTypes.Length == 1 && query.IncludeItemTypes.Contains(typeof(Series).Name))
|
||||
|
||||
@@ -154,7 +154,6 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
public DayOfWeek[] AirDays { get; set; }
|
||||
public SeriesStatus[] SeriesStatuses { get; set; }
|
||||
public string AlbumArtistStartsWithOrGreater { get; set; }
|
||||
public string ExternalSeriesId { get; set; }
|
||||
public string ExternalId { get; set; }
|
||||
|
||||
|
||||
@@ -142,13 +142,12 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
|
||||
public override int GetChildCount(User user)
|
||||
{
|
||||
var enableSeriesPresentationKey = ConfigurationManager.Configuration.EnableSeriesPresentationUniqueKey;
|
||||
var seriesKey = GetUniqueSeriesKey(this);
|
||||
|
||||
var result = LibraryManager.GetCount(new InternalItemsQuery(user)
|
||||
{
|
||||
AncestorWithPresentationUniqueKey = enableSeriesPresentationKey ? null : seriesKey,
|
||||
SeriesPresentationUniqueKey = enableSeriesPresentationKey ? seriesKey : null,
|
||||
AncestorWithPresentationUniqueKey = null,
|
||||
SeriesPresentationUniqueKey = seriesKey,
|
||||
IncludeItemTypes = new[] { typeof(Season).Name },
|
||||
IsVirtualItem = false,
|
||||
Limit = 0,
|
||||
@@ -167,13 +166,12 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
|
||||
public override int GetRecursiveChildCount(User user)
|
||||
{
|
||||
var enableSeriesPresentationKey = ConfigurationManager.Configuration.EnableSeriesPresentationUniqueKey;
|
||||
var seriesKey = GetUniqueSeriesKey(this);
|
||||
|
||||
var query = new InternalItemsQuery(user)
|
||||
{
|
||||
AncestorWithPresentationUniqueKey = enableSeriesPresentationKey ? null : seriesKey,
|
||||
SeriesPresentationUniqueKey = enableSeriesPresentationKey ? seriesKey : null,
|
||||
AncestorWithPresentationUniqueKey = null,
|
||||
SeriesPresentationUniqueKey = seriesKey,
|
||||
DtoOptions = new Dto.DtoOptions
|
||||
{
|
||||
Fields = new List<ItemFields>
|
||||
@@ -270,11 +268,10 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
{
|
||||
var config = user.Configuration;
|
||||
|
||||
var enableSeriesPresentationKey = ConfigurationManager.Configuration.EnableSeriesPresentationUniqueKey;
|
||||
var seriesKey = GetUniqueSeriesKey(this);
|
||||
|
||||
query.AncestorWithPresentationUniqueKey = enableSeriesPresentationKey ? null : seriesKey;
|
||||
query.SeriesPresentationUniqueKey = enableSeriesPresentationKey ? seriesKey : null;
|
||||
query.AncestorWithPresentationUniqueKey = null;
|
||||
query.SeriesPresentationUniqueKey = seriesKey;
|
||||
query.IncludeItemTypes = new[] { typeof(Season).Name };
|
||||
query.SortBy = new[] {ItemSortBy.SortName};
|
||||
|
||||
@@ -303,11 +300,10 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
|
||||
if (query.Recursive)
|
||||
{
|
||||
var enableSeriesPresentationKey = ConfigurationManager.Configuration.EnableSeriesPresentationUniqueKey;
|
||||
var seriesKey = GetUniqueSeriesKey(this);
|
||||
|
||||
query.AncestorWithPresentationUniqueKey = enableSeriesPresentationKey ? null : seriesKey;
|
||||
query.SeriesPresentationUniqueKey = enableSeriesPresentationKey ? seriesKey : null;
|
||||
query.AncestorWithPresentationUniqueKey = null;
|
||||
query.SeriesPresentationUniqueKey = seriesKey;
|
||||
if (query.SortBy.Length == 0)
|
||||
{
|
||||
query.SortBy = new[] { ItemSortBy.SortName };
|
||||
@@ -327,13 +323,12 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
|
||||
public IEnumerable<Episode> GetEpisodes(User user, DtoOptions options)
|
||||
{
|
||||
var enableSeriesPresentationKey = ConfigurationManager.Configuration.EnableSeriesPresentationUniqueKey;
|
||||
var seriesKey = GetUniqueSeriesKey(this);
|
||||
|
||||
var query = new InternalItemsQuery(user)
|
||||
{
|
||||
AncestorWithPresentationUniqueKey = enableSeriesPresentationKey ? null : seriesKey,
|
||||
SeriesPresentationUniqueKey = enableSeriesPresentationKey ? seriesKey : null,
|
||||
AncestorWithPresentationUniqueKey = null,
|
||||
SeriesPresentationUniqueKey = seriesKey,
|
||||
IncludeItemTypes = new[] { typeof(Episode).Name, typeof(Season).Name },
|
||||
SortBy = new[] { ItemSortBy.SortName },
|
||||
DtoOptions = options
|
||||
@@ -436,8 +431,6 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
|
||||
public IEnumerable<Episode> GetSeasonEpisodes(Season parentSeason, User user, DtoOptions options)
|
||||
{
|
||||
var enableSeriesPresentationKey = ConfigurationManager.Configuration.EnableSeriesPresentationUniqueKey;
|
||||
|
||||
var queryFromSeries = ConfigurationManager.Configuration.DisplaySpecialsWithinSeasons;
|
||||
|
||||
// add optimization when this setting is not enabled
|
||||
@@ -447,8 +440,8 @@ namespace MediaBrowser.Controller.Entities.TV
|
||||
|
||||
var query = new InternalItemsQuery(user)
|
||||
{
|
||||
AncestorWithPresentationUniqueKey = queryFromSeries && enableSeriesPresentationKey ? null : seriesKey,
|
||||
SeriesPresentationUniqueKey = queryFromSeries && enableSeriesPresentationKey ? seriesKey : null,
|
||||
AncestorWithPresentationUniqueKey = queryFromSeries ? null : seriesKey,
|
||||
SeriesPresentationUniqueKey = queryFromSeries ? seriesKey : null,
|
||||
IncludeItemTypes = new[] { typeof(Episode).Name },
|
||||
SortBy = new[] { ItemSortBy.SortName },
|
||||
DtoOptions = options
|
||||
|
||||
@@ -1714,17 +1714,6 @@ namespace MediaBrowser.Controller.Entities
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(query.AlbumArtistStartsWithOrGreater))
|
||||
{
|
||||
var ok = new[] { item }.OfType<IHasAlbumArtist>()
|
||||
.Any(p => string.Compare(query.AlbumArtistStartsWithOrGreater, p.AlbumArtists.FirstOrDefault(), StringComparison.CurrentCultureIgnoreCase) < 1);
|
||||
|
||||
if (!ok)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -282,12 +282,10 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
public IEnumerable<Video> GetLinkedAlternateVersions()
|
||||
{
|
||||
var linkedVersions = LinkedAlternateVersions
|
||||
return LinkedAlternateVersions
|
||||
.Select(GetLinkedChild)
|
||||
.Where(i => i != null)
|
||||
.OfType<Video>();
|
||||
|
||||
return linkedVersions
|
||||
.OfType<Video>()
|
||||
.OrderBy(i => i.SortName);
|
||||
}
|
||||
|
||||
@@ -630,21 +628,24 @@ namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
info.Path = media.ShortcutPath;
|
||||
|
||||
if (info.Path.StartsWith("Http", StringComparison.OrdinalIgnoreCase))
|
||||
if (!string.IsNullOrWhiteSpace(info.Path))
|
||||
{
|
||||
info.Protocol = MediaProtocol.Http;
|
||||
}
|
||||
else if (info.Path.StartsWith("Rtmp", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
info.Protocol = MediaProtocol.Rtmp;
|
||||
}
|
||||
else if (info.Path.StartsWith("Rtsp", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
info.Protocol = MediaProtocol.Rtsp;
|
||||
}
|
||||
else
|
||||
{
|
||||
info.Protocol = MediaProtocol.File;
|
||||
if (info.Path.StartsWith("Http", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
info.Protocol = MediaProtocol.Http;
|
||||
}
|
||||
else if (info.Path.StartsWith("Rtmp", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
info.Protocol = MediaProtocol.Rtmp;
|
||||
}
|
||||
else if (info.Path.StartsWith("Rtsp", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
info.Protocol = MediaProtocol.Rtsp;
|
||||
}
|
||||
else
|
||||
{
|
||||
info.Protocol = MediaProtocol.File;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -994,6 +994,10 @@ namespace MediaBrowser.Controller.MediaEncoding
|
||||
{
|
||||
sourceBitrate *= 2;
|
||||
}
|
||||
else if (sourceBitrate <= 3000000)
|
||||
{
|
||||
sourceBitrate = Convert.ToInt32(sourceBitrate * 1.5);
|
||||
}
|
||||
|
||||
var bitrate = Math.Min(sourceBitrate, requestedBitrate);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user