mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-06-23 15:30:56 -04:00
update video osd
This commit is contained in:
parent
3b7b06f70b
commit
85cd90d6e6
@ -3208,6 +3208,11 @@ namespace Emby.Server.Implementations.Data
|
|||||||
|
|
||||||
private List<string> GetWhereClauses(InternalItemsQuery query, IStatement statement, string paramSuffix = "")
|
private List<string> GetWhereClauses(InternalItemsQuery query, IStatement statement, string paramSuffix = "")
|
||||||
{
|
{
|
||||||
|
if (query.IsResumable ?? false)
|
||||||
|
{
|
||||||
|
query.IsVirtualItem = false;
|
||||||
|
}
|
||||||
|
|
||||||
var whereClauses = new List<string>();
|
var whereClauses = new List<string>();
|
||||||
|
|
||||||
if (EnableJoinUserData(query))
|
if (EnableJoinUserData(query))
|
||||||
@ -4081,27 +4086,6 @@ namespace Emby.Server.Implementations.Data
|
|||||||
|
|
||||||
whereClauses.Add("LocationType in (" + val + ")");
|
whereClauses.Add("LocationType in (" + val + ")");
|
||||||
}
|
}
|
||||||
if (query.ExcludeLocationTypes.Length == 1)
|
|
||||||
{
|
|
||||||
if (query.ExcludeLocationTypes[0] == LocationType.Virtual && _config.Configuration.SchemaVersion >= 90)
|
|
||||||
{
|
|
||||||
query.IsVirtualItem = false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
whereClauses.Add("LocationType<>@ExcludeLocationTypes");
|
|
||||||
if (statement != null)
|
|
||||||
{
|
|
||||||
statement.TryBind("@ExcludeLocationTypes", query.ExcludeLocationTypes[0].ToString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (query.ExcludeLocationTypes.Length > 1)
|
|
||||||
{
|
|
||||||
var val = string.Join(",", query.ExcludeLocationTypes.Select(i => "'" + i + "'").ToArray());
|
|
||||||
|
|
||||||
whereClauses.Add("LocationType not in (" + val + ")");
|
|
||||||
}
|
|
||||||
if (query.IsVirtualItem.HasValue)
|
if (query.IsVirtualItem.HasValue)
|
||||||
{
|
{
|
||||||
whereClauses.Add("IsVirtualItem=@IsVirtualItem");
|
whereClauses.Add("IsVirtualItem=@IsVirtualItem");
|
||||||
|
@ -157,6 +157,7 @@ namespace Emby.Server.Implementations.Library
|
|||||||
}
|
}
|
||||||
|
|
||||||
AddIfMissing(excludeItemTypes, typeof(CollectionFolder).Name);
|
AddIfMissing(excludeItemTypes, typeof(CollectionFolder).Name);
|
||||||
|
AddIfMissing(excludeItemTypes, typeof(Folder).Name);
|
||||||
|
|
||||||
var mediaItems = _libraryManager.GetItemList(new InternalItemsQuery(user)
|
var mediaItems = _libraryManager.GetItemList(new InternalItemsQuery(user)
|
||||||
{
|
{
|
||||||
@ -164,8 +165,7 @@ namespace Emby.Server.Implementations.Library
|
|||||||
ExcludeItemTypes = excludeItemTypes.ToArray(),
|
ExcludeItemTypes = excludeItemTypes.ToArray(),
|
||||||
IncludeItemTypes = includeItemTypes.ToArray(),
|
IncludeItemTypes = includeItemTypes.ToArray(),
|
||||||
Limit = query.Limit,
|
Limit = query.Limit,
|
||||||
IncludeItemsByName = true,
|
IncludeItemsByName = true
|
||||||
IsVirtualItem = false
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// Add search hints based on item name
|
// Add search hints based on item name
|
||||||
|
@ -287,7 +287,7 @@ namespace Emby.Server.Implementations.Library
|
|||||||
SortBy = new[] { ItemSortBy.DateCreated },
|
SortBy = new[] { ItemSortBy.DateCreated },
|
||||||
IsFolder = includeItemTypes.Length == 0 ? false : (bool?)null,
|
IsFolder = includeItemTypes.Length == 0 ? false : (bool?)null,
|
||||||
ExcludeItemTypes = excludeItemTypes,
|
ExcludeItemTypes = excludeItemTypes,
|
||||||
ExcludeLocationTypes = new[] { LocationType.Virtual },
|
IsVirtualItem = false,
|
||||||
Limit = limit * 5,
|
Limit = limit * 5,
|
||||||
SourceTypes = parents.Count == 0 ? new[] { SourceType.Library } : new SourceType[] { },
|
SourceTypes = parents.Count == 0 ? new[] { SourceType.Library } : new SourceType[] { },
|
||||||
IsPlayed = request.IsPlayed
|
IsPlayed = request.IsPlayed
|
||||||
|
@ -1602,7 +1602,7 @@ namespace Emby.Server.Implementations.LiveTv
|
|||||||
Recursive = true,
|
Recursive = true,
|
||||||
AncestorIds = folders.Select(i => i.Id.ToString("N")).ToArray(),
|
AncestorIds = folders.Select(i => i.Id.ToString("N")).ToArray(),
|
||||||
IsFolder = false,
|
IsFolder = false,
|
||||||
ExcludeLocationTypes = new[] { LocationType.Virtual },
|
IsVirtualItem = false,
|
||||||
Limit = query.Limit,
|
Limit = query.Limit,
|
||||||
SortBy = new[] { ItemSortBy.DateCreated },
|
SortBy = new[] { ItemSortBy.DateCreated },
|
||||||
SortOrder = SortOrder.Descending,
|
SortOrder = SortOrder.Descending,
|
||||||
|
@ -666,7 +666,7 @@ namespace MediaBrowser.Api.Library
|
|||||||
IncludeItemTypes = new[] { type.Name },
|
IncludeItemTypes = new[] { type.Name },
|
||||||
Limit = 0,
|
Limit = 0,
|
||||||
Recursive = true,
|
Recursive = true,
|
||||||
ExcludeLocationTypes = new[] { LocationType.Virtual },
|
IsVirtualItem = false,
|
||||||
SourceTypes = new[] { SourceType.Library },
|
SourceTypes = new[] { SourceType.Library },
|
||||||
IsFavorite = request.IsFavorite
|
IsFavorite = request.IsFavorite
|
||||||
};
|
};
|
||||||
|
@ -293,7 +293,11 @@ namespace MediaBrowser.Api.Reports
|
|||||||
// ExcludeLocationTypes
|
// ExcludeLocationTypes
|
||||||
if (!string.IsNullOrEmpty(request.ExcludeLocationTypes))
|
if (!string.IsNullOrEmpty(request.ExcludeLocationTypes))
|
||||||
{
|
{
|
||||||
query.ExcludeLocationTypes = request.ExcludeLocationTypes.Split(',').Select(d => (LocationType)Enum.Parse(typeof(LocationType), d, true)).ToArray();
|
var excludeLocationTypes = request.ExcludeLocationTypes.Split(',').Select(d => (LocationType)Enum.Parse(typeof(LocationType), d, true)).ToArray();
|
||||||
|
if (excludeLocationTypes.Contains(LocationType.Virtual))
|
||||||
|
{
|
||||||
|
query.IsVirtualItem = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(request.LocationTypes))
|
if (!string.IsNullOrEmpty(request.LocationTypes))
|
||||||
|
@ -318,7 +318,11 @@ namespace MediaBrowser.Api.UserLibrary
|
|||||||
// ExcludeLocationTypes
|
// ExcludeLocationTypes
|
||||||
if (!string.IsNullOrEmpty(request.ExcludeLocationTypes))
|
if (!string.IsNullOrEmpty(request.ExcludeLocationTypes))
|
||||||
{
|
{
|
||||||
query.ExcludeLocationTypes = request.ExcludeLocationTypes.Split(',').Select(d => (LocationType)Enum.Parse(typeof(LocationType), d, true)).ToArray();
|
var excludeLocationTypes = request.ExcludeLocationTypes.Split(',').Select(d => (LocationType)Enum.Parse(typeof(LocationType), d, true)).ToArray();
|
||||||
|
if (excludeLocationTypes.Contains(LocationType.Virtual))
|
||||||
|
{
|
||||||
|
query.IsVirtualItem = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(request.LocationTypes))
|
if (!string.IsNullOrEmpty(request.LocationTypes))
|
||||||
|
@ -16,6 +16,15 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[IgnoreDataMember]
|
||||||
|
public override bool SupportsPlayedStatus
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[IgnoreDataMember]
|
[IgnoreDataMember]
|
||||||
public string SeriesPresentationUniqueKey { get; set; }
|
public string SeriesPresentationUniqueKey { get; set; }
|
||||||
[IgnoreDataMember]
|
[IgnoreDataMember]
|
||||||
|
@ -1336,7 +1336,7 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
|
|
||||||
if (!user.Configuration.DisplayMissingEpisodes || !user.Configuration.DisplayUnairedEpisodes)
|
if (!user.Configuration.DisplayMissingEpisodes || !user.Configuration.DisplayUnairedEpisodes)
|
||||||
{
|
{
|
||||||
query.ExcludeLocationTypes = new[] { LocationType.Virtual };
|
query.IsVirtualItem = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
var itemsResult = await GetItems(query).ConfigureAwait(false);
|
var itemsResult = await GetItems(query).ConfigureAwait(false);
|
||||||
@ -1375,7 +1375,7 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
{
|
{
|
||||||
Recursive = true,
|
Recursive = true,
|
||||||
IsFolder = false,
|
IsFolder = false,
|
||||||
ExcludeLocationTypes = new[] { LocationType.Virtual },
|
IsVirtualItem = false,
|
||||||
EnableTotalRecordCount = false
|
EnableTotalRecordCount = false
|
||||||
|
|
||||||
}).Result;
|
}).Result;
|
||||||
|
@ -130,7 +130,6 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
public string[] TopParentIds { get; set; }
|
public string[] TopParentIds { get; set; }
|
||||||
|
|
||||||
public LocationType[] LocationTypes { get; set; }
|
public LocationType[] LocationTypes { get; set; }
|
||||||
public LocationType[] ExcludeLocationTypes { get; set; }
|
|
||||||
public string[] PresetViews { get; set; }
|
public string[] PresetViews { get; set; }
|
||||||
public SourceType[] SourceTypes { get; set; }
|
public SourceType[] SourceTypes { get; set; }
|
||||||
public SourceType[] ExcludeSourceTypes { get; set; }
|
public SourceType[] ExcludeSourceTypes { get; set; }
|
||||||
@ -233,7 +232,6 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
ExcludeTags = new string[] { };
|
ExcludeTags = new string[] { };
|
||||||
ExcludeInheritedTags = new string[] { };
|
ExcludeInheritedTags = new string[] { };
|
||||||
LocationTypes = new LocationType[] { };
|
LocationTypes = new LocationType[] { };
|
||||||
ExcludeLocationTypes = new LocationType[] { };
|
|
||||||
PresetViews = new string[] { };
|
PresetViews = new string[] { };
|
||||||
SourceTypes = new SourceType[] { };
|
SourceTypes = new SourceType[] { };
|
||||||
ExcludeSourceTypes = new SourceType[] { };
|
ExcludeSourceTypes = new SourceType[] { };
|
||||||
|
@ -647,7 +647,7 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
query.SetUser(user);
|
query.SetUser(user);
|
||||||
query.Limit = GetSpecialItemsLimit();
|
query.Limit = GetSpecialItemsLimit();
|
||||||
query.IncludeItemTypes = new[] { typeof(Episode).Name };
|
query.IncludeItemTypes = new[] { typeof(Episode).Name };
|
||||||
query.ExcludeLocationTypes = new[] { LocationType.Virtual };
|
query.IsVirtualItem = false;
|
||||||
|
|
||||||
return ConvertToResult(_libraryManager.GetItemList(query));
|
return ConvertToResult(_libraryManager.GetItemList(query));
|
||||||
}
|
}
|
||||||
@ -1199,7 +1199,7 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (query.ExcludeLocationTypes.Length > 0 && query.ExcludeLocationTypes.Contains(item.LocationType))
|
if (query.IsVirtualItem.HasValue && item.IsVirtualItem != query.IsVirtualItem.Value)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,11 @@ namespace MediaBrowser.Controller.LiveTv
|
|||||||
{
|
{
|
||||||
public class LiveTvProgram : BaseItem, IHasLookupInfo<LiveTvProgramLookupInfo>, IHasStartDate, IHasProgramAttributes
|
public class LiveTvProgram : BaseItem, IHasLookupInfo<LiveTvProgramLookupInfo>, IHasStartDate, IHasProgramAttributes
|
||||||
{
|
{
|
||||||
|
public LiveTvProgram()
|
||||||
|
{
|
||||||
|
IsVirtualItem = true;
|
||||||
|
}
|
||||||
|
|
||||||
public override List<string> GetUserDataKeys()
|
public override List<string> GetUserDataKeys()
|
||||||
{
|
{
|
||||||
var list = base.GetUserDataKeys();
|
var list = base.GetUserDataKeys();
|
||||||
|
@ -82,10 +82,10 @@ namespace MediaBrowser.Providers.MediaInfo
|
|||||||
{
|
{
|
||||||
MediaTypes = new string[] { MediaType.Video },
|
MediaTypes = new string[] { MediaType.Video },
|
||||||
IsVirtualItem = false,
|
IsVirtualItem = false,
|
||||||
ExcludeLocationTypes = new LocationType[] { LocationType.Remote, LocationType.Virtual },
|
|
||||||
IncludeItemTypes = types.ToArray()
|
IncludeItemTypes = types.ToArray()
|
||||||
|
|
||||||
}).OfType<Video>()
|
}).OfType<Video>()
|
||||||
|
.Where(i => i.LocationType != LocationType.Remote)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
if (videos.Count == 0)
|
if (videos.Count == 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user