commit
7b92139173
|
@ -139,34 +139,34 @@ namespace Emby.Server.Implementations.Data
|
||||||
RunDefaultInitialization(connection);
|
RunDefaultInitialization(connection);
|
||||||
|
|
||||||
var createMediaStreamsTableCommand
|
var createMediaStreamsTableCommand
|
||||||
= "create table if not exists mediastreams (ItemId GUID, StreamIndex INT, StreamType TEXT, Codec TEXT, Language TEXT, ChannelLayout TEXT, Profile TEXT, AspectRatio TEXT, Path TEXT, IsInterlaced BIT, BitRate INT NULL, Channels INT NULL, SampleRate INT NULL, IsDefault BIT, IsForced BIT, IsExternal BIT, Height INT NULL, Width INT NULL, AverageFrameRate FLOAT NULL, RealFrameRate FLOAT NULL, Level FLOAT NULL, PixelFormat TEXT, BitDepth INT NULL, IsAnamorphic BIT NULL, RefFrames INT NULL, CodecTag TEXT NULL, Comment TEXT NULL, NalLengthSize TEXT NULL, IsAvc BIT NULL, Title TEXT NULL, TimeBase TEXT NULL, CodecTimeBase TEXT NULL, PRIMARY KEY (ItemId, StreamIndex))";
|
= "create table if not exists mediastreams (ItemId GUID, StreamIndex INT, StreamType TEXT, Codec TEXT, Language TEXT, ChannelLayout TEXT, Profile TEXT, AspectRatio TEXT, Path TEXT, IsInterlaced BIT, BitRate INT NULL, Channels INT NULL, SampleRate INT NULL, IsDefault BIT, IsForced BIT, IsExternal BIT, Height INT NULL, Width INT NULL, AverageFrameRate FLOAT NULL, RealFrameRate FLOAT NULL, Level FLOAT NULL, PixelFormat TEXT, BitDepth INT NULL, IsAnamorphic BIT NULL, RefFrames INT NULL, CodecTag TEXT NULL, Comment TEXT NULL, NalLengthSize TEXT NULL, IsAvc BIT NULL, Title TEXT NULL, TimeBase TEXT NULL, CodecTimeBase TEXT NULL, PRIMARY KEY (ItemId, StreamIndex))";
|
||||||
|
|
||||||
string[] queries = {
|
string[] queries = {
|
||||||
"PRAGMA locking_mode=EXCLUSIVE",
|
"PRAGMA locking_mode=EXCLUSIVE",
|
||||||
|
|
||||||
"create table if not exists TypedBaseItems (guid GUID primary key NOT NULL, type TEXT NOT NULL, data BLOB NULL, ParentId GUID NULL, Path TEXT NULL)",
|
"create table if not exists TypedBaseItems (guid GUID primary key NOT NULL, type TEXT NOT NULL, data BLOB NULL, ParentId GUID NULL, Path TEXT NULL)",
|
||||||
|
|
||||||
"create table if not exists AncestorIds (ItemId GUID, AncestorId GUID, AncestorIdText TEXT, PRIMARY KEY (ItemId, AncestorId))",
|
"create table if not exists AncestorIds (ItemId GUID, AncestorId GUID, AncestorIdText TEXT, PRIMARY KEY (ItemId, AncestorId))",
|
||||||
"create index if not exists idx_AncestorIds1 on AncestorIds(AncestorId)",
|
"create index if not exists idx_AncestorIds1 on AncestorIds(AncestorId)",
|
||||||
"create index if not exists idx_AncestorIds5 on AncestorIds(AncestorIdText,ItemId)",
|
"create index if not exists idx_AncestorIds5 on AncestorIds(AncestorIdText,ItemId)",
|
||||||
|
|
||||||
"create table if not exists ItemValues (ItemId GUID, Type INT, Value TEXT, CleanValue TEXT)",
|
"create table if not exists ItemValues (ItemId GUID, Type INT, Value TEXT, CleanValue TEXT)",
|
||||||
|
|
||||||
"create table if not exists People (ItemId GUID, Name TEXT NOT NULL, Role TEXT, PersonType TEXT, SortOrder int, ListOrder int)",
|
"create table if not exists People (ItemId GUID, Name TEXT NOT NULL, Role TEXT, PersonType TEXT, SortOrder int, ListOrder int)",
|
||||||
|
|
||||||
"drop index if exists idxPeopleItemId",
|
"drop index if exists idxPeopleItemId",
|
||||||
"create index if not exists idxPeopleItemId1 on People(ItemId,ListOrder)",
|
"create index if not exists idxPeopleItemId1 on People(ItemId,ListOrder)",
|
||||||
"create index if not exists idxPeopleName on People(Name)",
|
"create index if not exists idxPeopleName on People(Name)",
|
||||||
|
|
||||||
"create table if not exists "+ChaptersTableName+" (ItemId GUID, ChapterIndex INT, StartPositionTicks BIGINT, Name TEXT, ImagePath TEXT, PRIMARY KEY (ItemId, ChapterIndex))",
|
"create table if not exists "+ChaptersTableName+" (ItemId GUID, ChapterIndex INT, StartPositionTicks BIGINT, Name TEXT, ImagePath TEXT, PRIMARY KEY (ItemId, ChapterIndex))",
|
||||||
|
|
||||||
createMediaStreamsTableCommand,
|
createMediaStreamsTableCommand,
|
||||||
|
|
||||||
"create index if not exists idx_mediastreams1 on mediastreams(ItemId)",
|
"create index if not exists idx_mediastreams1 on mediastreams(ItemId)",
|
||||||
|
|
||||||
"pragma shrink_memory"
|
"pragma shrink_memory"
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
connection.RunQueries(queries);
|
connection.RunQueries(queries);
|
||||||
|
|
||||||
|
@ -277,80 +277,80 @@ namespace Emby.Server.Implementations.Data
|
||||||
|
|
||||||
string[] postQueries =
|
string[] postQueries =
|
||||||
|
|
||||||
{
|
{
|
||||||
// obsolete
|
// obsolete
|
||||||
"drop index if exists idx_TypedBaseItems",
|
"drop index if exists idx_TypedBaseItems",
|
||||||
"drop index if exists idx_mediastreams",
|
"drop index if exists idx_mediastreams",
|
||||||
"drop index if exists idx_"+ChaptersTableName,
|
"drop index if exists idx_"+ChaptersTableName,
|
||||||
"drop index if exists idx_UserDataKeys1",
|
"drop index if exists idx_UserDataKeys1",
|
||||||
"drop index if exists idx_UserDataKeys2",
|
"drop index if exists idx_UserDataKeys2",
|
||||||
"drop index if exists idx_TypeTopParentId3",
|
"drop index if exists idx_TypeTopParentId3",
|
||||||
"drop index if exists idx_TypeTopParentId2",
|
"drop index if exists idx_TypeTopParentId2",
|
||||||
"drop index if exists idx_TypeTopParentId4",
|
"drop index if exists idx_TypeTopParentId4",
|
||||||
"drop index if exists idx_Type",
|
"drop index if exists idx_Type",
|
||||||
"drop index if exists idx_TypeTopParentId",
|
"drop index if exists idx_TypeTopParentId",
|
||||||
"drop index if exists idx_GuidType",
|
"drop index if exists idx_GuidType",
|
||||||
"drop index if exists idx_TopParentId",
|
"drop index if exists idx_TopParentId",
|
||||||
"drop index if exists idx_TypeTopParentId6",
|
"drop index if exists idx_TypeTopParentId6",
|
||||||
"drop index if exists idx_ItemValues2",
|
"drop index if exists idx_ItemValues2",
|
||||||
"drop index if exists Idx_ProviderIds",
|
"drop index if exists Idx_ProviderIds",
|
||||||
"drop index if exists idx_ItemValues3",
|
"drop index if exists idx_ItemValues3",
|
||||||
"drop index if exists idx_ItemValues4",
|
"drop index if exists idx_ItemValues4",
|
||||||
"drop index if exists idx_ItemValues5",
|
"drop index if exists idx_ItemValues5",
|
||||||
"drop index if exists idx_UserDataKeys3",
|
"drop index if exists idx_UserDataKeys3",
|
||||||
"drop table if exists UserDataKeys",
|
"drop table if exists UserDataKeys",
|
||||||
"drop table if exists ProviderIds",
|
"drop table if exists ProviderIds",
|
||||||
"drop index if exists Idx_ProviderIds1",
|
"drop index if exists Idx_ProviderIds1",
|
||||||
"drop table if exists Images",
|
"drop table if exists Images",
|
||||||
"drop index if exists idx_Images",
|
"drop index if exists idx_Images",
|
||||||
"drop index if exists idx_TypeSeriesPresentationUniqueKey",
|
"drop index if exists idx_TypeSeriesPresentationUniqueKey",
|
||||||
"drop index if exists idx_SeriesPresentationUniqueKey",
|
"drop index if exists idx_SeriesPresentationUniqueKey",
|
||||||
"drop index if exists idx_TypeSeriesPresentationUniqueKey2",
|
"drop index if exists idx_TypeSeriesPresentationUniqueKey2",
|
||||||
"drop index if exists idx_AncestorIds3",
|
"drop index if exists idx_AncestorIds3",
|
||||||
"drop index if exists idx_AncestorIds4",
|
"drop index if exists idx_AncestorIds4",
|
||||||
"drop index if exists idx_AncestorIds2",
|
"drop index if exists idx_AncestorIds2",
|
||||||
|
|
||||||
"create index if not exists idx_PathTypedBaseItems on TypedBaseItems(Path)",
|
"create index if not exists idx_PathTypedBaseItems on TypedBaseItems(Path)",
|
||||||
"create index if not exists idx_ParentIdTypedBaseItems on TypedBaseItems(ParentId)",
|
"create index if not exists idx_ParentIdTypedBaseItems on TypedBaseItems(ParentId)",
|
||||||
|
|
||||||
"create index if not exists idx_PresentationUniqueKey on TypedBaseItems(PresentationUniqueKey)",
|
"create index if not exists idx_PresentationUniqueKey on TypedBaseItems(PresentationUniqueKey)",
|
||||||
"create index if not exists idx_GuidTypeIsFolderIsVirtualItem on TypedBaseItems(Guid,Type,IsFolder,IsVirtualItem)",
|
"create index if not exists idx_GuidTypeIsFolderIsVirtualItem on TypedBaseItems(Guid,Type,IsFolder,IsVirtualItem)",
|
||||||
//"create index if not exists idx_GuidMediaTypeIsFolderIsVirtualItem on TypedBaseItems(Guid,MediaType,IsFolder,IsVirtualItem)",
|
//"create index if not exists idx_GuidMediaTypeIsFolderIsVirtualItem on TypedBaseItems(Guid,MediaType,IsFolder,IsVirtualItem)",
|
||||||
"create index if not exists idx_CleanNameType on TypedBaseItems(CleanName,Type)",
|
"create index if not exists idx_CleanNameType on TypedBaseItems(CleanName,Type)",
|
||||||
|
|
||||||
// covering index
|
// covering index
|
||||||
"create index if not exists idx_TopParentIdGuid on TypedBaseItems(TopParentId,Guid)",
|
"create index if not exists idx_TopParentIdGuid on TypedBaseItems(TopParentId,Guid)",
|
||||||
|
|
||||||
// series
|
// series
|
||||||
"create index if not exists idx_TypeSeriesPresentationUniqueKey1 on TypedBaseItems(Type,SeriesPresentationUniqueKey,PresentationUniqueKey,SortName)",
|
"create index if not exists idx_TypeSeriesPresentationUniqueKey1 on TypedBaseItems(Type,SeriesPresentationUniqueKey,PresentationUniqueKey,SortName)",
|
||||||
|
|
||||||
// series counts
|
// series counts
|
||||||
// seriesdateplayed sort order
|
// seriesdateplayed sort order
|
||||||
"create index if not exists idx_TypeSeriesPresentationUniqueKey3 on TypedBaseItems(SeriesPresentationUniqueKey,Type,IsFolder,IsVirtualItem)",
|
"create index if not exists idx_TypeSeriesPresentationUniqueKey3 on TypedBaseItems(SeriesPresentationUniqueKey,Type,IsFolder,IsVirtualItem)",
|
||||||
|
|
||||||
// live tv programs
|
// live tv programs
|
||||||
"create index if not exists idx_TypeTopParentIdStartDate on TypedBaseItems(Type,TopParentId,StartDate)",
|
"create index if not exists idx_TypeTopParentIdStartDate on TypedBaseItems(Type,TopParentId,StartDate)",
|
||||||
|
|
||||||
// covering index for getitemvalues
|
// covering index for getitemvalues
|
||||||
"create index if not exists idx_TypeTopParentIdGuid on TypedBaseItems(Type,TopParentId,Guid)",
|
"create index if not exists idx_TypeTopParentIdGuid on TypedBaseItems(Type,TopParentId,Guid)",
|
||||||
|
|
||||||
// used by movie suggestions
|
// used by movie suggestions
|
||||||
"create index if not exists idx_TypeTopParentIdGroup on TypedBaseItems(Type,TopParentId,PresentationUniqueKey)",
|
"create index if not exists idx_TypeTopParentIdGroup on TypedBaseItems(Type,TopParentId,PresentationUniqueKey)",
|
||||||
"create index if not exists idx_TypeTopParentId5 on TypedBaseItems(TopParentId,IsVirtualItem)",
|
"create index if not exists idx_TypeTopParentId5 on TypedBaseItems(TopParentId,IsVirtualItem)",
|
||||||
|
|
||||||
// latest items
|
// latest items
|
||||||
"create index if not exists idx_TypeTopParentId9 on TypedBaseItems(TopParentId,Type,IsVirtualItem,PresentationUniqueKey,DateCreated)",
|
"create index if not exists idx_TypeTopParentId9 on TypedBaseItems(TopParentId,Type,IsVirtualItem,PresentationUniqueKey,DateCreated)",
|
||||||
"create index if not exists idx_TypeTopParentId8 on TypedBaseItems(TopParentId,IsFolder,IsVirtualItem,PresentationUniqueKey,DateCreated)",
|
"create index if not exists idx_TypeTopParentId8 on TypedBaseItems(TopParentId,IsFolder,IsVirtualItem,PresentationUniqueKey,DateCreated)",
|
||||||
|
|
||||||
// resume
|
// resume
|
||||||
"create index if not exists idx_TypeTopParentId7 on TypedBaseItems(TopParentId,MediaType,IsVirtualItem,PresentationUniqueKey)",
|
"create index if not exists idx_TypeTopParentId7 on TypedBaseItems(TopParentId,MediaType,IsVirtualItem,PresentationUniqueKey)",
|
||||||
|
|
||||||
// items by name
|
// items by name
|
||||||
"create index if not exists idx_ItemValues6 on ItemValues(ItemId,Type,CleanValue)",
|
"create index if not exists idx_ItemValues6 on ItemValues(ItemId,Type,CleanValue)",
|
||||||
"create index if not exists idx_ItemValues7 on ItemValues(Type,CleanValue,ItemId)",
|
"create index if not exists idx_ItemValues7 on ItemValues(Type,CleanValue,ItemId)",
|
||||||
|
|
||||||
// Used to update inherited tags
|
// Used to update inherited tags
|
||||||
"create index if not exists idx_ItemValues8 on ItemValues(Type, ItemId, Value)",
|
"create index if not exists idx_ItemValues8 on ItemValues(Type, ItemId, Value)",
|
||||||
};
|
};
|
||||||
|
|
||||||
connection.RunQueries(postQueries);
|
connection.RunQueries(postQueries);
|
||||||
|
@ -1153,12 +1153,12 @@ namespace Emby.Server.Implementations.Data
|
||||||
}
|
}
|
||||||
|
|
||||||
return path +
|
return path +
|
||||||
delimeter +
|
delimeter +
|
||||||
image.DateModified.Ticks.ToString(CultureInfo.InvariantCulture) +
|
image.DateModified.Ticks.ToString(CultureInfo.InvariantCulture) +
|
||||||
delimeter +
|
delimeter +
|
||||||
image.Type +
|
image.Type +
|
||||||
delimeter +
|
delimeter +
|
||||||
image.IsPlaceholder;
|
image.IsPlaceholder;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemImageInfo ItemImageInfoFromValueString(string value)
|
public ItemImageInfo ItemImageInfoFromValueString(string value)
|
||||||
|
@ -1709,17 +1709,17 @@ namespace Emby.Server.Implementations.Data
|
||||||
if (!reader.IsDBNull(index))
|
if (!reader.IsDBNull(index))
|
||||||
{
|
{
|
||||||
trailer.TrailerTypes = reader.GetString(index).Split('|').Where(i => !string.IsNullOrWhiteSpace(i)).Select(
|
trailer.TrailerTypes = reader.GetString(index).Split('|').Where(i => !string.IsNullOrWhiteSpace(i)).Select(
|
||||||
i =>
|
i =>
|
||||||
{
|
|
||||||
TrailerType parsedValue;
|
|
||||||
|
|
||||||
if (Enum.TryParse(i, true, out parsedValue))
|
|
||||||
{
|
{
|
||||||
return parsedValue;
|
TrailerType parsedValue;
|
||||||
}
|
|
||||||
return (TrailerType?)null;
|
|
||||||
|
|
||||||
}).Where(i => i.HasValue).Select(i => i.Value).ToList();
|
if (Enum.TryParse(i, true, out parsedValue))
|
||||||
|
{
|
||||||
|
return parsedValue;
|
||||||
|
}
|
||||||
|
return (TrailerType?)null;
|
||||||
|
|
||||||
|
}).Where(i => i.HasValue).Select(i => i.Value).ToList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
index++;
|
index++;
|
||||||
|
@ -1961,7 +1961,7 @@ namespace Emby.Server.Implementations.Data
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
index ++;
|
index++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2221,8 +2221,8 @@ namespace Emby.Server.Implementations.Data
|
||||||
}
|
}
|
||||||
|
|
||||||
private readonly List<ItemFields> allFields = Enum.GetNames(typeof(ItemFields))
|
private readonly List<ItemFields> allFields = Enum.GetNames(typeof(ItemFields))
|
||||||
.Select(i => (ItemFields)Enum.Parse(typeof(ItemFields), i, true))
|
.Select(i => (ItemFields)Enum.Parse(typeof(ItemFields), i, true))
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
private IEnumerable<string> GetColumnNamesFromField(ItemFields field)
|
private IEnumerable<string> GetColumnNamesFromField(ItemFields field)
|
||||||
{
|
{
|
||||||
|
@ -2324,13 +2324,13 @@ namespace Emby.Server.Implementations.Data
|
||||||
private bool HasStartDate(InternalItemsQuery query)
|
private bool HasStartDate(InternalItemsQuery query)
|
||||||
{
|
{
|
||||||
var excludeParentTypes = new string[]
|
var excludeParentTypes = new string[]
|
||||||
{
|
{
|
||||||
"Series",
|
"Series",
|
||||||
"Season",
|
"Season",
|
||||||
"MusicAlbum",
|
"MusicAlbum",
|
||||||
"MusicArtist",
|
"MusicArtist",
|
||||||
"PhotoAlbum"
|
"PhotoAlbum"
|
||||||
};
|
};
|
||||||
|
|
||||||
if (excludeParentTypes.Contains(query.ParentType ?? string.Empty, StringComparer.OrdinalIgnoreCase))
|
if (excludeParentTypes.Contains(query.ParentType ?? string.Empty, StringComparer.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
|
@ -2387,11 +2387,11 @@ namespace Emby.Server.Implementations.Data
|
||||||
private bool HasArtistFields(InternalItemsQuery query)
|
private bool HasArtistFields(InternalItemsQuery query)
|
||||||
{
|
{
|
||||||
var excludeParentTypes = new string[]
|
var excludeParentTypes = new string[]
|
||||||
{
|
{
|
||||||
"Series",
|
"Series",
|
||||||
"Season",
|
"Season",
|
||||||
"PhotoAlbum"
|
"PhotoAlbum"
|
||||||
};
|
};
|
||||||
|
|
||||||
if (excludeParentTypes.Contains(query.ParentType ?? string.Empty, StringComparer.OrdinalIgnoreCase))
|
if (excludeParentTypes.Contains(query.ParentType ?? string.Empty, StringComparer.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
|
@ -2420,9 +2420,9 @@ namespace Emby.Server.Implementations.Data
|
||||||
private bool HasSeriesFields(InternalItemsQuery query)
|
private bool HasSeriesFields(InternalItemsQuery query)
|
||||||
{
|
{
|
||||||
var excludeParentTypes = new string[]
|
var excludeParentTypes = new string[]
|
||||||
{
|
{
|
||||||
"PhotoAlbum"
|
"PhotoAlbum"
|
||||||
};
|
};
|
||||||
|
|
||||||
if (excludeParentTypes.Contains(query.ParentType ?? string.Empty, StringComparer.OrdinalIgnoreCase))
|
if (excludeParentTypes.Contains(query.ParentType ?? string.Empty, StringComparer.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
|
@ -4716,6 +4716,33 @@ namespace Emby.Server.Implementations.Data
|
||||||
|
|
||||||
public void UpdateInheritedValues(CancellationToken cancellationToken)
|
public void UpdateInheritedValues(CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
|
UpdateInheritedTags(cancellationToken);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UpdateInheritedTags(CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
using (WriteLock.Write())
|
||||||
|
{
|
||||||
|
using (var connection = CreateConnection())
|
||||||
|
{
|
||||||
|
connection.RunInTransaction(db =>
|
||||||
|
{
|
||||||
|
connection.ExecuteAll(string.Join(";", new string[]
|
||||||
|
{
|
||||||
|
"delete from itemvalues where type = 6",
|
||||||
|
|
||||||
|
"insert into itemvalues (ItemId, Type, Value, CleanValue) select ItemId, 6, Value, CleanValue from ItemValues where Type=4",
|
||||||
|
|
||||||
|
@"insert into itemvalues (ItemId, Type, Value, CleanValue) select AncestorIds.itemid, 6, ItemValues.Value, ItemValues.CleanValue
|
||||||
|
FROM AncestorIds
|
||||||
|
LEFT JOIN ItemValues ON (AncestorIds.AncestorId = ItemValues.ItemId)
|
||||||
|
where AncestorIdText not null and ItemValues.Value not null and ItemValues.Type = 4 "
|
||||||
|
|
||||||
|
}));
|
||||||
|
|
||||||
|
}, TransactionMode);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Dictionary<string, string[]> GetTypeMapDictionary()
|
private static Dictionary<string, string[]> GetTypeMapDictionary()
|
||||||
|
@ -5504,7 +5531,7 @@ namespace Emby.Server.Implementations.Data
|
||||||
var listIndex = 0;
|
var listIndex = 0;
|
||||||
|
|
||||||
using (var statement = PrepareStatement(connection,
|
using (var statement = PrepareStatement(connection,
|
||||||
"insert into People (ItemId, Name, Role, PersonType, SortOrder, ListOrder) values (@ItemId, @Name, @Role, @PersonType, @SortOrder, @ListOrder)"))
|
"insert into People (ItemId, Name, Role, PersonType, SortOrder, ListOrder) values (@ItemId, @Name, @Role, @PersonType, @SortOrder, @ListOrder)"))
|
||||||
{
|
{
|
||||||
foreach (var person in people)
|
foreach (var person in people)
|
||||||
{
|
{
|
||||||
|
@ -5633,8 +5660,8 @@ namespace Emby.Server.Implementations.Data
|
||||||
connection.Execute("delete from mediastreams where ItemId=@ItemId", id.ToGuidBlob());
|
connection.Execute("delete from mediastreams where ItemId=@ItemId", id.ToGuidBlob());
|
||||||
|
|
||||||
using (var statement = PrepareStatement(connection, string.Format("replace into mediastreams ({0}) values ({1})",
|
using (var statement = PrepareStatement(connection, string.Format("replace into mediastreams ({0}) values ({1})",
|
||||||
string.Join(",", _mediaStreamSaveColumns),
|
string.Join(",", _mediaStreamSaveColumns),
|
||||||
string.Join(",", _mediaStreamSaveColumns.Select(i => "@" + i).ToArray()))))
|
string.Join(",", _mediaStreamSaveColumns.Select(i => "@" + i).ToArray()))))
|
||||||
{
|
{
|
||||||
foreach (var stream in streams)
|
foreach (var stream in streams)
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,5 +15,6 @@ namespace MediaBrowser.Controller.Entities
|
||||||
bool IsPremiere { get; set; }
|
bool IsPremiere { get; set; }
|
||||||
ProgramAudio? Audio { get; set; }
|
ProgramAudio? Audio { get; set; }
|
||||||
string EpisodeTitle { get; set; }
|
string EpisodeTitle { get; set; }
|
||||||
|
string ServiceName { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,24 +89,9 @@ namespace MediaBrowser.Controller.LiveTv
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string EmbyServiceName = "Emby";
|
|
||||||
public override double? GetDefaultPrimaryImageAspectRatio()
|
public override double? GetDefaultPrimaryImageAspectRatio()
|
||||||
{
|
{
|
||||||
var serviceName = ServiceName;
|
return LiveTvProgram.GetDefaultPrimaryImageAspectRatio(this);
|
||||||
if (!IsMovie && !string.Equals(serviceName, EmbyServiceName, StringComparison.OrdinalIgnoreCase) || !string.IsNullOrWhiteSpace(serviceName))
|
|
||||||
{
|
|
||||||
double value = 16;
|
|
||||||
value /= 9;
|
|
||||||
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
double value = 2;
|
|
||||||
value /= 3;
|
|
||||||
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string GetClientTypeName()
|
public override string GetClientTypeName()
|
||||||
|
|
|
@ -47,11 +47,10 @@ namespace MediaBrowser.Controller.LiveTv
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string EmbyServiceName = "Emby";
|
public static double? GetDefaultPrimaryImageAspectRatio(IHasProgramAttributes item)
|
||||||
public override double? GetDefaultPrimaryImageAspectRatio()
|
|
||||||
{
|
{
|
||||||
var serviceName = ServiceName;
|
var serviceName = item.ServiceName;
|
||||||
if (!IsMovie && !string.Equals(serviceName, EmbyServiceName, StringComparison.OrdinalIgnoreCase) || !string.IsNullOrWhiteSpace(serviceName))
|
if (!item.IsMovie && !string.Equals(serviceName, EmbyServiceName, StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
double value = 16;
|
double value = 16;
|
||||||
value /= 9;
|
value /= 9;
|
||||||
|
@ -67,6 +66,12 @@ namespace MediaBrowser.Controller.LiveTv
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static string EmbyServiceName = "Emby";
|
||||||
|
public override double? GetDefaultPrimaryImageAspectRatio()
|
||||||
|
{
|
||||||
|
return GetDefaultPrimaryImageAspectRatio(this);
|
||||||
|
}
|
||||||
|
|
||||||
[IgnoreDataMember]
|
[IgnoreDataMember]
|
||||||
public override SourceType SourceType
|
public override SourceType SourceType
|
||||||
{
|
{
|
||||||
|
|
|
@ -98,24 +98,9 @@ namespace MediaBrowser.Controller.LiveTv
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string EmbyServiceName = "Emby";
|
|
||||||
public override double? GetDefaultPrimaryImageAspectRatio()
|
public override double? GetDefaultPrimaryImageAspectRatio()
|
||||||
{
|
{
|
||||||
var serviceName = ServiceName;
|
return LiveTvProgram.GetDefaultPrimaryImageAspectRatio(this);
|
||||||
if (!IsMovie && !string.Equals(serviceName, EmbyServiceName, StringComparison.OrdinalIgnoreCase) || !string.IsNullOrWhiteSpace(serviceName))
|
|
||||||
{
|
|
||||||
double value = 16;
|
|
||||||
value /= 9;
|
|
||||||
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
double value = 2;
|
|
||||||
value /= 3;
|
|
||||||
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[IgnoreDataMember]
|
[IgnoreDataMember]
|
||||||
|
|
|
@ -4,6 +4,10 @@
|
||||||
{
|
{
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
|
||||||
|
public string DisplayName { get; set; }
|
||||||
|
|
||||||
public string EmbeddedResourcePath { get; set; }
|
public string EmbeddedResourcePath { get; set; }
|
||||||
|
|
||||||
|
public bool EnableInMainMenu { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,9 @@ namespace MediaBrowser.WebDashboard.Api
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The name.</value>
|
/// <value>The name.</value>
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
public bool EnableInMainMenu { get; set; }
|
||||||
|
|
||||||
|
public string DisplayName { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets the type of the configuration page.
|
/// Gets the type of the configuration page.
|
||||||
|
@ -27,15 +30,22 @@ namespace MediaBrowser.WebDashboard.Api
|
||||||
public ConfigurationPageInfo(IPluginConfigurationPage page)
|
public ConfigurationPageInfo(IPluginConfigurationPage page)
|
||||||
{
|
{
|
||||||
Name = page.Name;
|
Name = page.Name;
|
||||||
|
|
||||||
ConfigurationPageType = page.ConfigurationPageType;
|
ConfigurationPageType = page.ConfigurationPageType;
|
||||||
|
|
||||||
// Don't use "N" because it needs to match Plugin.Id
|
if (page.Plugin != null)
|
||||||
PluginId = page.Plugin.Id.ToString();
|
{
|
||||||
|
DisplayName = page.Plugin.Name;
|
||||||
|
// Don't use "N" because it needs to match Plugin.Id
|
||||||
|
PluginId = page.Plugin.Id.ToString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConfigurationPageInfo(IPlugin plugin, PluginPageInfo page)
|
public ConfigurationPageInfo(IPlugin plugin, PluginPageInfo page)
|
||||||
{
|
{
|
||||||
Name = page.Name;
|
Name = page.Name;
|
||||||
|
EnableInMainMenu = page.EnableInMainMenu;
|
||||||
|
DisplayName = string.IsNullOrWhiteSpace(page.DisplayName) ? plugin.Name : page.DisplayName;
|
||||||
|
|
||||||
// Don't use "N" because it needs to match Plugin.Id
|
// Don't use "N" because it needs to match Plugin.Id
|
||||||
PluginId = plugin.Id.ToString();
|
PluginId = plugin.Id.ToString();
|
||||||
|
|
|
@ -32,6 +32,7 @@ namespace MediaBrowser.WebDashboard.Api
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <value>The type of the page.</value>
|
/// <value>The type of the page.</value>
|
||||||
public ConfigurationPageType? PageType { get; set; }
|
public ConfigurationPageType? PageType { get; set; }
|
||||||
|
public bool? EnableInMainMenu { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -221,25 +222,20 @@ namespace MediaBrowser.WebDashboard.Api
|
||||||
/// <returns>System.Object.</returns>
|
/// <returns>System.Object.</returns>
|
||||||
public object Get(GetDashboardConfigurationPages request)
|
public object Get(GetDashboardConfigurationPages request)
|
||||||
{
|
{
|
||||||
const string unavilableMessage = "The server is still loading. Please try again momentarily.";
|
const string unavailableMessage = "The server is still loading. Please try again momentarily.";
|
||||||
|
|
||||||
var instance = ServerEntryPoint.Instance;
|
var instance = ServerEntryPoint.Instance;
|
||||||
|
|
||||||
if (instance == null)
|
if (instance == null)
|
||||||
{
|
{
|
||||||
throw new InvalidOperationException(unavilableMessage);
|
throw new InvalidOperationException(unavailableMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
var pages = instance.PluginConfigurationPages;
|
var pages = instance.PluginConfigurationPages;
|
||||||
|
|
||||||
if (pages == null)
|
if (pages == null)
|
||||||
{
|
{
|
||||||
throw new InvalidOperationException(unavilableMessage);
|
throw new InvalidOperationException(unavailableMessage);
|
||||||
}
|
|
||||||
|
|
||||||
if (request.PageType.HasValue)
|
|
||||||
{
|
|
||||||
pages = pages.Where(p => p.ConfigurationPageType == request.PageType.Value).ToList();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't allow a failing plugin to fail them all
|
// Don't allow a failing plugin to fail them all
|
||||||
|
@ -261,6 +257,16 @@ namespace MediaBrowser.WebDashboard.Api
|
||||||
|
|
||||||
configPages.AddRange(_appHost.Plugins.SelectMany(GetConfigPages));
|
configPages.AddRange(_appHost.Plugins.SelectMany(GetConfigPages));
|
||||||
|
|
||||||
|
if (request.PageType.HasValue)
|
||||||
|
{
|
||||||
|
configPages = configPages.Where(p => p.ConfigurationPageType == request.PageType.Value).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (request.EnableInMainMenu.HasValue)
|
||||||
|
{
|
||||||
|
configPages = configPages.Where(p => p.EnableInMainMenu == request.EnableInMainMenu.Value).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
return _resultFactory.GetOptimizedResult(Request, configPages);
|
return _resultFactory.GetOptimizedResult(Request, configPages);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
|
||||||
[assembly: AssemblyVersion("3.2.30.20")]
|
[assembly: AssemblyVersion("3.2.30.21")]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user