mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-21 09:34:44 +01:00
update live tv startup
This commit is contained in:
@@ -1378,12 +1378,6 @@ namespace Emby.Server.Implementations.Channels
|
||||
item.SetImagePath(ImageType.Primary, info.ImageUrl);
|
||||
}
|
||||
|
||||
if (item.SourceType != SourceType.Channel)
|
||||
{
|
||||
item.SourceType = SourceType.Channel;
|
||||
forceUpdate = true;
|
||||
}
|
||||
|
||||
if (isNew)
|
||||
{
|
||||
await _libraryManager.CreateItem(item, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
@@ -199,10 +199,11 @@ namespace Emby.Server.Implementations.Data
|
||||
AddColumn(db, "TypedBaseItems", "ParentId", "GUID", existingColumnNames);
|
||||
AddColumn(db, "TypedBaseItems", "Genres", "Text", existingColumnNames);
|
||||
AddColumn(db, "TypedBaseItems", "SortName", "Text", existingColumnNames);
|
||||
AddColumn(db, "TypedBaseItems", "ForcedSortName", "Text", existingColumnNames);
|
||||
|
||||
AddColumn(db, "TypedBaseItems", "RunTimeTicks", "BIGINT", existingColumnNames);
|
||||
|
||||
AddColumn(db, "TypedBaseItems", "HomePageUrl", "Text", existingColumnNames);
|
||||
AddColumn(db, "TypedBaseItems", "VoteCount", "INT", existingColumnNames);
|
||||
AddColumn(db, "TypedBaseItems", "DisplayMediaType", "Text", existingColumnNames);
|
||||
AddColumn(db, "TypedBaseItems", "DateCreated", "DATETIME", existingColumnNames);
|
||||
AddColumn(db, "TypedBaseItems", "DateModified", "DATETIME", existingColumnNames);
|
||||
@@ -233,7 +234,6 @@ namespace Emby.Server.Implementations.Data
|
||||
AddColumn(db, "TypedBaseItems", "UnratedType", "Text", existingColumnNames);
|
||||
AddColumn(db, "TypedBaseItems", "TopParentId", "Text", existingColumnNames);
|
||||
AddColumn(db, "TypedBaseItems", "IsItemByName", "BIT", existingColumnNames);
|
||||
AddColumn(db, "TypedBaseItems", "SourceType", "Text", existingColumnNames);
|
||||
AddColumn(db, "TypedBaseItems", "TrailerTypes", "Text", existingColumnNames);
|
||||
AddColumn(db, "TypedBaseItems", "CriticRating", "Float", existingColumnNames);
|
||||
AddColumn(db, "TypedBaseItems", "InheritedTags", "Text", existingColumnNames);
|
||||
@@ -424,9 +424,8 @@ namespace Emby.Server.Implementations.Data
|
||||
"OfficialRating",
|
||||
"HomePageUrl",
|
||||
"DisplayMediaType",
|
||||
"SortName",
|
||||
"ForcedSortName",
|
||||
"RunTimeTicks",
|
||||
"VoteCount",
|
||||
"DateCreated",
|
||||
"DateModified",
|
||||
"guid",
|
||||
@@ -439,7 +438,6 @@ namespace Emby.Server.Implementations.Data
|
||||
"LockedFields",
|
||||
"Studios",
|
||||
"Tags",
|
||||
"SourceType",
|
||||
"TrailerTypes",
|
||||
"OriginalTitle",
|
||||
"PrimaryVersionId",
|
||||
@@ -541,9 +539,9 @@ namespace Emby.Server.Implementations.Data
|
||||
"Genres",
|
||||
"InheritedParentalRatingValue",
|
||||
"SortName",
|
||||
"ForcedSortName",
|
||||
"RunTimeTicks",
|
||||
"HomePageUrl",
|
||||
"VoteCount",
|
||||
"DisplayMediaType",
|
||||
"DateCreated",
|
||||
"DateModified",
|
||||
@@ -563,7 +561,6 @@ namespace Emby.Server.Implementations.Data
|
||||
"UnratedType",
|
||||
"TopParentId",
|
||||
"IsItemByName",
|
||||
"SourceType",
|
||||
"TrailerTypes",
|
||||
"CriticRating",
|
||||
"InheritedTags",
|
||||
@@ -815,10 +812,12 @@ namespace Emby.Server.Implementations.Data
|
||||
saveItemStatement.TryBind("@InheritedParentalRatingValue", item.InheritedParentalRatingValue);
|
||||
|
||||
saveItemStatement.TryBind("@SortName", item.SortName);
|
||||
|
||||
saveItemStatement.TryBind("@ForcedSortName", item.ForcedSortName);
|
||||
|
||||
saveItemStatement.TryBind("@RunTimeTicks", item.RunTimeTicks);
|
||||
|
||||
saveItemStatement.TryBind("@HomePageUrl", item.HomePageUrl);
|
||||
saveItemStatement.TryBind("@VoteCount", item.VoteCount);
|
||||
saveItemStatement.TryBind("@DisplayMediaType", item.DisplayMediaType);
|
||||
saveItemStatement.TryBind("@DateCreated", item.DateCreated);
|
||||
saveItemStatement.TryBind("@DateModified", item.DateModified);
|
||||
@@ -909,7 +908,6 @@ namespace Emby.Server.Implementations.Data
|
||||
isByName = dualAccess == null || dualAccess.IsAccessedByName;
|
||||
}
|
||||
saveItemStatement.TryBind("@IsItemByName", isByName);
|
||||
saveItemStatement.TryBind("@SourceType", item.SourceType.ToString());
|
||||
|
||||
var trailer = item as Trailer;
|
||||
if (trailer != null && trailer.TrailerTypes.Count > 0)
|
||||
@@ -1624,7 +1622,7 @@ namespace Emby.Server.Implementations.Data
|
||||
{
|
||||
if (!reader.IsDBNull(index))
|
||||
{
|
||||
item.SortName = reader.GetString(index);
|
||||
item.ForcedSortName = reader.GetString(index);
|
||||
}
|
||||
index++;
|
||||
}
|
||||
@@ -1635,15 +1633,6 @@ namespace Emby.Server.Implementations.Data
|
||||
}
|
||||
index++;
|
||||
|
||||
if (HasField(query, ItemFields.VoteCount))
|
||||
{
|
||||
if (!reader.IsDBNull(index))
|
||||
{
|
||||
item.VoteCount = reader.GetInt32(index);
|
||||
}
|
||||
index++;
|
||||
}
|
||||
|
||||
if (HasField(query, ItemFields.DateCreated))
|
||||
{
|
||||
if (!reader.IsDBNull(index))
|
||||
@@ -1733,12 +1722,6 @@ namespace Emby.Server.Implementations.Data
|
||||
index++;
|
||||
}
|
||||
|
||||
if (!reader.IsDBNull(index))
|
||||
{
|
||||
item.SourceType = (SourceType)Enum.Parse(typeof(SourceType), reader.GetString(index), true);
|
||||
}
|
||||
index++;
|
||||
|
||||
if (hasTrailerTypes)
|
||||
{
|
||||
var trailer = item as Trailer;
|
||||
@@ -2283,7 +2266,7 @@ namespace Emby.Server.Implementations.Data
|
||||
}
|
||||
if (field == ItemFields.SortName)
|
||||
{
|
||||
return new[] { "SortName" };
|
||||
return new[] { "ForcedSortName" };
|
||||
}
|
||||
if (field == ItemFields.Taglines)
|
||||
{
|
||||
@@ -2306,7 +2289,6 @@ namespace Emby.Server.Implementations.Data
|
||||
case ItemFields.HomePageUrl:
|
||||
case ItemFields.Keywords:
|
||||
case ItemFields.DisplayMediaType:
|
||||
case ItemFields.VoteCount:
|
||||
case ItemFields.CustomRating:
|
||||
case ItemFields.ProductionLocations:
|
||||
case ItemFields.Settings:
|
||||
@@ -3872,34 +3854,6 @@ namespace Emby.Server.Implementations.Data
|
||||
}
|
||||
}
|
||||
|
||||
if (query.SourceTypes.Length == 1)
|
||||
{
|
||||
whereClauses.Add("SourceType=@SourceType");
|
||||
if (statement != null)
|
||||
{
|
||||
statement.TryBind("@SourceType", query.SourceTypes[0].ToString());
|
||||
}
|
||||
}
|
||||
else if (query.SourceTypes.Length > 1)
|
||||
{
|
||||
var inClause = string.Join(",", query.SourceTypes.Select(i => "'" + i + "'").ToArray());
|
||||
whereClauses.Add(string.Format("SourceType in ({0})", inClause));
|
||||
}
|
||||
|
||||
if (query.ExcludeSourceTypes.Length == 1)
|
||||
{
|
||||
whereClauses.Add("SourceType<>@ExcludeSourceTypes");
|
||||
if (statement != null)
|
||||
{
|
||||
statement.TryBind("@ExcludeSourceTypes", query.ExcludeSourceTypes[0].ToString());
|
||||
}
|
||||
}
|
||||
else if (query.ExcludeSourceTypes.Length > 1)
|
||||
{
|
||||
var inClause = string.Join(",", query.ExcludeSourceTypes.Select(i => "'" + i + "'").ToArray());
|
||||
whereClauses.Add(string.Format("SourceType not in ({0})", inClause));
|
||||
}
|
||||
|
||||
if (query.TrailerTypes.Length > 0)
|
||||
{
|
||||
var clauses = new List<string>();
|
||||
@@ -5017,14 +4971,6 @@ namespace Emby.Server.Implementations.Data
|
||||
statement.TryBind("@NameContains", "%" + query.NameContains + "%");
|
||||
}
|
||||
}
|
||||
if (query.SourceTypes.Length == 1)
|
||||
{
|
||||
whereClauses.Add("(select sourcetype from typedbaseitems where guid=ItemId) = @SourceTypes");
|
||||
if (statement != null)
|
||||
{
|
||||
statement.TryBind("@SourceTypes", query.SourceTypes[0].ToString());
|
||||
}
|
||||
}
|
||||
|
||||
return whereClauses;
|
||||
}
|
||||
|
||||
@@ -1058,11 +1058,6 @@ namespace Emby.Server.Implementations.Dto
|
||||
dto.CommunityRating = item.CommunityRating;
|
||||
}
|
||||
|
||||
if (fields.Contains(ItemFields.VoteCount))
|
||||
{
|
||||
dto.VoteCount = item.VoteCount;
|
||||
}
|
||||
|
||||
//if (item.IsFolder)
|
||||
//{
|
||||
// var folder = (Folder)item;
|
||||
|
||||
@@ -1292,7 +1292,7 @@ namespace Emby.Server.Implementations.Library
|
||||
return item;
|
||||
}
|
||||
|
||||
public IEnumerable<BaseItem> GetItemList(InternalItemsQuery query)
|
||||
public IEnumerable<BaseItem> GetItemList(InternalItemsQuery query, bool allowExternalContent)
|
||||
{
|
||||
if (query.Recursive && query.ParentId.HasValue)
|
||||
{
|
||||
@@ -1305,12 +1305,17 @@ namespace Emby.Server.Implementations.Library
|
||||
|
||||
if (query.User != null)
|
||||
{
|
||||
AddUserToQuery(query, query.User);
|
||||
AddUserToQuery(query, query.User, allowExternalContent);
|
||||
}
|
||||
|
||||
return ItemRepository.GetItemList(query);
|
||||
}
|
||||
|
||||
public IEnumerable<BaseItem> GetItemList(InternalItemsQuery query)
|
||||
{
|
||||
return GetItemList(query, true);
|
||||
}
|
||||
|
||||
public int GetCount(InternalItemsQuery query)
|
||||
{
|
||||
if (query.Recursive && query.ParentId.HasValue)
|
||||
@@ -1548,7 +1553,7 @@ namespace Emby.Server.Implementations.Library
|
||||
query.Parent = null;
|
||||
}
|
||||
|
||||
private void AddUserToQuery(InternalItemsQuery query, User user)
|
||||
private void AddUserToQuery(InternalItemsQuery query, User user, bool allowExternalContent = true)
|
||||
{
|
||||
if (query.AncestorIds.Length == 0 &&
|
||||
!query.ParentId.HasValue &&
|
||||
@@ -1561,7 +1566,8 @@ namespace Emby.Server.Implementations.Library
|
||||
var userViews = _userviewManager().GetUserViews(new UserViewQuery
|
||||
{
|
||||
UserId = user.Id.ToString("N"),
|
||||
IncludeHidden = true
|
||||
IncludeHidden = true,
|
||||
IncludeExternalContent = allowExternalContent
|
||||
|
||||
}, CancellationToken.None).Result.ToList();
|
||||
|
||||
|
||||
@@ -280,7 +280,7 @@ namespace Emby.Server.Implementations.Library
|
||||
|
||||
} : new string[] { };
|
||||
|
||||
return _libraryManager.GetItemList(new InternalItemsQuery(user)
|
||||
var query = new InternalItemsQuery(user)
|
||||
{
|
||||
IncludeItemTypes = includeItemTypes,
|
||||
SortOrder = SortOrder.Descending,
|
||||
@@ -289,11 +289,16 @@ namespace Emby.Server.Implementations.Library
|
||||
ExcludeItemTypes = excludeItemTypes,
|
||||
IsVirtualItem = false,
|
||||
Limit = limit * 5,
|
||||
SourceTypes = parents.Count == 0 ? new[] { SourceType.Library } : new SourceType[] { },
|
||||
IsPlayed = isPlayed,
|
||||
DtoOptions = options
|
||||
};
|
||||
|
||||
}, parents);
|
||||
if (parents.Count == 0)
|
||||
{
|
||||
return _libraryManager.GetItemList(query, false);
|
||||
}
|
||||
|
||||
return _libraryManager.GetItemList(query, parents);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2270,11 +2270,6 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
|
||||
writer.WriteElementString("studio", studio);
|
||||
}
|
||||
|
||||
if (item.VoteCount.HasValue)
|
||||
{
|
||||
writer.WriteElementString("votes", item.VoteCount.Value.ToString(CultureInfo.InvariantCulture));
|
||||
}
|
||||
|
||||
writer.WriteEndElement();
|
||||
writer.WriteEndDocument();
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace Emby.Server.Implementations.LiveTv
|
||||
private readonly IMediaEncoder _mediaEncoder;
|
||||
private readonly ILogger _logger;
|
||||
|
||||
const int AnalyzeDurationMs = 2000;
|
||||
const int AnalyzeDurationMs = 1000;
|
||||
|
||||
public LiveStreamHelper(IMediaEncoder mediaEncoder, ILogger logger)
|
||||
{
|
||||
|
||||
@@ -422,6 +422,8 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
|
||||
SupportsTranscoding = true,
|
||||
IsInfiniteStream = true,
|
||||
IgnoreDts = true,
|
||||
//SupportsProbing = false,
|
||||
//AnalyzeDurationMs = 2000000
|
||||
//IgnoreIndex = true,
|
||||
//ReadAtNativeFramerate = true
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user