mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-26 20:14:45 +01:00
live tv fixes
This commit is contained in:
@@ -828,14 +828,11 @@ namespace MediaBrowser.Server.Implementations.Dto
|
||||
|
||||
if (!string.IsNullOrEmpty(chapterInfo.ImagePath))
|
||||
{
|
||||
var file = new FileInfo(chapterInfo.ImagePath);
|
||||
|
||||
dto.ImageTag = GetImageCacheTag(item, new ItemImageInfo
|
||||
{
|
||||
Path = chapterInfo.ImagePath,
|
||||
Type = ImageType.Chapter,
|
||||
DateModified = _fileSystem.GetLastWriteTimeUtc(file),
|
||||
Length = file.Length
|
||||
DateModified = _fileSystem.GetLastWriteTimeUtc(chapterInfo.ImagePath)
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -202,9 +202,15 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
|
||||
public async Task<UserView> GetUserView(List<ICollectionFolder> parents, string viewType, string sortName, User user, CancellationToken cancellationToken)
|
||||
{
|
||||
var name = _localizationManager.GetLocalizedString("ViewType" + viewType);
|
||||
|
||||
if (parents.Count == 1 && parents.All(i => string.Equals(i.CollectionType, viewType, StringComparison.OrdinalIgnoreCase)))
|
||||
{
|
||||
var name = parents[0].Name;
|
||||
if (!string.IsNullOrWhiteSpace(parents[0].Name))
|
||||
{
|
||||
name = parents[0].Name;
|
||||
}
|
||||
|
||||
var parentId = parents[0].Id;
|
||||
|
||||
var enableRichView = !user.Configuration.PlainFolderViews.Contains(parentId.ToString("N"), StringComparer.OrdinalIgnoreCase);
|
||||
@@ -226,8 +232,6 @@ namespace MediaBrowser.Server.Implementations.Library
|
||||
}
|
||||
else
|
||||
{
|
||||
var name = _localizationManager.GetLocalizedString("ViewType" + viewType);
|
||||
|
||||
return await _libraryManager.GetNamedView(user, name, viewType, sortName, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||
|
||||
private async Task AddMediaInfo(MediaSourceInfo mediaSource, bool isAudio, CancellationToken cancellationToken)
|
||||
{
|
||||
var inputPaths = new[] { mediaSource.Path };
|
||||
var originalRuntime = mediaSource.RunTimeTicks;
|
||||
|
||||
var info = await _mediaEncoder.GetMediaInfo(new MediaInfoRequest
|
||||
{
|
||||
@@ -131,8 +131,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||
MediaType = isAudio ? DlnaProfileType.Audio : DlnaProfileType.Video,
|
||||
ExtractChapters = false
|
||||
|
||||
}, cancellationToken)
|
||||
.ConfigureAwait(false);
|
||||
}, cancellationToken).ConfigureAwait(false);
|
||||
|
||||
mediaSource.Bitrate = info.Bitrate;
|
||||
mediaSource.Container = info.Container;
|
||||
@@ -146,6 +145,12 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||
|
||||
mediaSource.DefaultSubtitleStreamIndex = null;
|
||||
|
||||
// Null this out so that it will be treated like a live stream
|
||||
if (!originalRuntime.HasValue)
|
||||
{
|
||||
mediaSource.RunTimeTicks = null;
|
||||
}
|
||||
|
||||
var audioStream = mediaSource.MediaStreams.FirstOrDefault(i => i.Type == Model.Entities.MediaStreamType.Audio);
|
||||
|
||||
if (audioStream == null || audioStream.Index == -1)
|
||||
|
||||
Reference in New Issue
Block a user