mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-11-15 18:08:53 -07:00
center guide grid
This commit is contained in:
parent
0b57b33988
commit
0f7f467478
@ -1002,6 +1002,11 @@ namespace MediaBrowser.Api.Playback
|
||||
/// <returns>StreamState.</returns>
|
||||
protected async Task<StreamState> GetState(StreamRequest request, CancellationToken cancellationToken)
|
||||
{
|
||||
if (request.ThrowDebugError)
|
||||
{
|
||||
throw new InvalidOperationException("You asked for a debug error, you got one.");
|
||||
}
|
||||
|
||||
var url = Request.PathInfo;
|
||||
|
||||
if (!request.AudioCodec.HasValue)
|
||||
|
@ -17,7 +17,7 @@ namespace MediaBrowser.Api.Playback
|
||||
|
||||
[ApiMember(Name = "DeviceId", Description = "The device id of the client requesting. Used to stop encoding processes when needed.", IsRequired = false, DataType = "string", ParameterType = "query", Verb = "GET")]
|
||||
public string DeviceId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the audio codec.
|
||||
/// </summary>
|
||||
@ -65,6 +65,11 @@ namespace MediaBrowser.Api.Playback
|
||||
/// No need to put this in api docs since it's dlna only
|
||||
/// </summary>
|
||||
public bool AlbumArt { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// For testing purposes
|
||||
/// </summary>
|
||||
public bool ThrowDebugError { get; set; }
|
||||
}
|
||||
|
||||
public class VideoStreamRequest : StreamRequest
|
||||
|
@ -144,7 +144,7 @@ namespace MediaBrowser.Api.UserLibrary
|
||||
{
|
||||
var libraryItems = user.RootFolder.GetRecursiveChildren(user).ToList();
|
||||
|
||||
items = items.Where(i => GetLibraryItems(i, libraryItems).All(l => !l.IsPlayed(user)));
|
||||
items = items.Where(i => GetLibraryItems(i, libraryItems).All(l => l.IsUnplayed(user)));
|
||||
}
|
||||
|
||||
return items;
|
||||
|
@ -107,9 +107,7 @@ namespace MediaBrowser.Api.UserLibrary
|
||||
/// <returns>IEnumerable{Tuple{System.StringFunc{System.Int32}}}.</returns>
|
||||
protected override IEnumerable<Genre> GetAllItems(GetItemsByName request, IEnumerable<BaseItem> items)
|
||||
{
|
||||
var itemsList = items.Where(i => i.Genres != null).ToList();
|
||||
|
||||
return itemsList
|
||||
return items
|
||||
.SelectMany(i => i.Genres)
|
||||
.Distinct(StringComparer.OrdinalIgnoreCase)
|
||||
.Select(name => LibraryManager.GetGenre(name));
|
||||
|
@ -446,7 +446,7 @@ namespace MediaBrowser.Api.UserLibrary
|
||||
return items.Where(item => item.IsPlayed(currentUser));
|
||||
|
||||
case ItemFilter.IsUnplayed:
|
||||
return items.Where(item => !item.IsPlayed(currentUser));
|
||||
return items.Where(item => item.IsUnplayed(currentUser));
|
||||
|
||||
case ItemFilter.IsFolder:
|
||||
return items.Where(item => item.IsFolder);
|
||||
|
@ -1713,5 +1713,12 @@ namespace MediaBrowser.Controller.Entities
|
||||
|
||||
return userdata != null && userdata.Played;
|
||||
}
|
||||
|
||||
public virtual bool IsUnplayed(User user)
|
||||
{
|
||||
var userdata = UserDataManager.GetUserData(user.Id, GetUserDataKey());
|
||||
|
||||
return userdata == null || !userdata.Played;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1090,5 +1090,11 @@ namespace MediaBrowser.Controller.Entities
|
||||
return GetRecursiveChildren(user).Where(i => !i.IsFolder && i.LocationType != LocationType.Virtual)
|
||||
.All(i => i.IsPlayed(user));
|
||||
}
|
||||
|
||||
public override bool IsUnplayed(User user)
|
||||
{
|
||||
return GetRecursiveChildren(user).Where(i => !i.IsFolder && i.LocationType != LocationType.Virtual)
|
||||
.All(i => i.IsUnplayed(user));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -233,7 +233,7 @@ namespace MediaBrowser.Model.Configuration
|
||||
public ServerConfiguration()
|
||||
: base()
|
||||
{
|
||||
MediaEncodingQuality = EncodingQuality.HighSpeed;
|
||||
MediaEncodingQuality = EncodingQuality.Auto;
|
||||
ImageSavingConvention = ImageSavingConvention.Compatible;
|
||||
HttpServerPortNumber = 8096;
|
||||
LegacyWebSocketPortNumber = 8945;
|
||||
|
@ -1,6 +1,5 @@
|
||||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.Library;
|
||||
using MediaBrowser.Controller.Persistence;
|
||||
using MediaBrowser.Controller.Sorting;
|
||||
using MediaBrowser.Model.Querying;
|
||||
|
||||
@ -32,7 +31,7 @@ namespace MediaBrowser.Server.Implementations.Sorting
|
||||
/// <returns>DateTime.</returns>
|
||||
private int GetValue(BaseItem x)
|
||||
{
|
||||
return x.IsPlayed(User) ? 1 : 0;
|
||||
return x.IsUnplayed(User) ? 0 : 1;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
Loading…
Reference in New Issue
Block a user