Further Release 10.9.x improvements (#92)

This commit is contained in:
Lomion0815 2024-08-20 19:12:15 +02:00 committed by GitHub
parent e7813bd973
commit 21f653ac5c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 58 additions and 9 deletions

View File

@ -429,7 +429,13 @@ namespace TVHeadEnd
livetvasset.Path = _htsConnectionHandler.GetHttpBaseUrl() + ticket.Path;
livetvasset.Protocol = MediaProtocol.Http;
livetvasset.RequiredHttpHeaders = _htsConnectionHandler.GetHeaders();
livetvasset.AnalyzeDurationMs = 3000;
livetvasset.AnalyzeDurationMs = 2000;
livetvasset.SupportsDirectStream = false;
livetvasset.RequiresClosing = true;
livetvasset.SupportsProbing = false;
livetvasset.Container = "mpegts";
livetvasset.RequiresOpening = true;
livetvasset.IsInfiniteStream = true;
// Probe the asset stream to determine available sub-streams
string livetvasset_probeUrl = "" + livetvasset.Path;
@ -445,6 +451,7 @@ namespace TVHeadEnd
{
i.IsInterlaced = true;
}
i.RealFrameRate = 50.0F;
}
}
@ -457,7 +464,10 @@ namespace TVHeadEnd
Id = channelId,
Path = _htsConnectionHandler.GetHttpBaseUrl() + ticket.Url,
Protocol = MediaProtocol.Http,
AnalyzeDurationMs = 3000,
AnalyzeDurationMs = 2000,
SupportsDirectStream = false,
SupportsProbing = false,
Container = "mpegts",
MediaStreams = new List<MediaStream>
{
new MediaStream
@ -466,7 +476,8 @@ namespace TVHeadEnd
// Set the index to -1 because we don't know the exact index of the video stream within the container
Index = -1,
// Set to true if unknown to enable deinterlacing
IsInterlaced = true
IsInterlaced = true,
RealFrameRate = 50.0F
},
new MediaStream
{
@ -569,6 +580,15 @@ namespace TVHeadEnd
// Set asset source and type for stream probing and logging
string recordingasset_probeUrl = "" + recordingasset.Path;
recordingasset.AnalyzeDurationMs = 2000;
recordingasset.SupportsDirectStream = false;
recordingasset.RequiresClosing = true;
recordingasset.SupportsProbing = false;
recordingasset.Container = "mpegts";
recordingasset.RequiresOpening = true;
recordingasset.IsInfiniteStream = true;
// If enabled, force video deinterlacing for recordings
if (_htsConnectionHandler.GetForceDeinterlace())
{
@ -592,6 +612,10 @@ namespace TVHeadEnd
Id = recordingId,
Path = _htsConnectionHandler.GetHttpBaseUrl() + ticket.Url,
Protocol = MediaProtocol.Http,
AnalyzeDurationMs = 2000,
SupportsDirectStream = false,
SupportsProbing = false,
Container = "mpegts",
MediaStreams = new List<MediaStream>
{
new MediaStream
@ -600,7 +624,8 @@ namespace TVHeadEnd
// Set the index to -1 because we don't know the exact index of the video stream within the container
Index = -1,
// Set to true if unknown to enable deinterlacing
IsInterlaced = true
IsInterlaced = true,
RealFrameRate = 50.0F
},
new MediaStream
{

View File

@ -22,7 +22,7 @@ using TVHeadEnd.TimeoutHelper;
namespace TVHeadEnd
{
public class RecordingsChannel : IChannel, IHasCacheKey, ISupportsDelete, ISupportsLatestMedia, ISupportsMediaProbe, IHasFolderAttributes
public class RecordingsChannel : IChannel, ISupportsDelete, ISupportsLatestMedia, IHasFolderAttributes
{
private HTSConnectionHandler _htsConnectionHandler;
private readonly TimeSpan TIMEOUT = TimeSpan.FromMinutes(5);
@ -246,6 +246,8 @@ namespace TVHeadEnd
public async Task<ChannelItemResult> GetChannelItems(InternalChannelItemQuery query, Func<MyRecordingInfo, bool> filter, CancellationToken cancellationToken)
{
_logger.LogDebug("[TVHclient] GetChannelItems - Updating TVHeadend Recording Items");
var allRecordings = await GetAllRecordingsAsync(cancellationToken).ConfigureAwait(false);
var result = new ChannelItemResult
@ -260,6 +262,8 @@ namespace TVHeadEnd
{
var path = buildRecordingPath(item.Id);
_logger.LogDebug("[TVHclient] ConvertToChannelItem - Creating ChannelItemInfo");
var channelItem = new ChannelItemInfo
{
Name = string.IsNullOrEmpty(item.EpisodeTitle) ? item.Name : item.EpisodeTitle,
@ -269,17 +273,36 @@ namespace TVHeadEnd
ContentType = item.IsMovie ? ChannelMediaContentType.Movie : (item.IsSeries ? ChannelMediaContentType.Episode : ChannelMediaContentType.Clip),
Genres = item.Genres,
ImageUrl = item.ImageUrl,
//HomePageUrl = item.HomePageUrl
Id = item.Id,
//IndexNumber = item.IndexNumber,
MediaType = item.ChannelType == MediaBrowser.Model.LiveTv.ChannelType.TV ? ChannelMediaType.Video : ChannelMediaType.Audio,
IsLiveStream = false,
MediaSources = new List<MediaSourceInfo>
{
new MediaSourceInfo
{
Path = path,
Protocol = path.StartsWith("http", StringComparison.OrdinalIgnoreCase) ? MediaProtocol.Http : MediaProtocol.File,
Id = item.Id
Id = item.Id,
Container = "mpegts",
AnalyzeDurationMs = 2000,
MediaStreams = new List<MediaStream>
{
new MediaStream
{
Type = MediaStreamType.Video,
// Set the index to -1 because we don't know the exact index of the video stream within the container
Index = -1,
// Set to true if unknown to enable deinterlacing
IsInterlaced = true,
RealFrameRate = 50.0F
},
new MediaStream
{
Type = MediaStreamType.Audio,
// Set the index to -1 because we don't know the exact index of the audio stream within the container
Index = -1
}
}
}
},
//ParentIndexNumber = item.ParentIndexNumber,
@ -293,7 +316,6 @@ namespace TVHeadEnd
DateModified = item.DateLastUpdated,
Overview = item.Overview,
//People = item.People
IsLiveStream = item.Status == MediaBrowser.Model.LiveTv.RecordingStatus.InProgress,
Etag = item.Status.ToString()
};
@ -326,6 +348,8 @@ namespace TVHeadEnd
private async Task<ChannelItemResult> GetRecordingGroups(InternalChannelItemQuery query, CancellationToken cancellationToken)
{
_logger.LogDebug("[TVHclient] GetRecordingGroups - Updateing TVHeadend Recording Items");
var allRecordings = await GetAllRecordingsAsync(cancellationToken).ConfigureAwait(false);
var result = new ChannelItemResult();
var items = new List<ChannelItemInfo>();