mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
Improve support for embedded metadata; support external subtitles with strm files
This commit is contained in:
parent
c4ceeae889
commit
70b0dd968f
@ -39,6 +39,14 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts
|
|||||||
FileSystem = fileSystem;
|
FileSystem = fileSystem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public virtual bool IsSupported
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected abstract Task<List<ChannelInfo>> GetChannelsInternal(TunerHostInfo tuner, CancellationToken cancellationToken);
|
protected abstract Task<List<ChannelInfo>> GetChannelsInternal(TunerHostInfo tuner, CancellationToken cancellationToken);
|
||||||
public abstract string Type { get; }
|
public abstract string Type { get; }
|
||||||
|
|
||||||
|
@ -76,6 +76,21 @@ namespace Emby.Server.Implementations.MediaEncoder
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (video.VideoType == VideoType.Iso)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (video.VideoType == VideoType.BluRay || video.VideoType == VideoType.Dvd)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (video.IsShortcut)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!video.IsCompleteMedia)
|
if (!video.IsCompleteMedia)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
@ -118,16 +133,6 @@ namespace Emby.Server.Implementations.MediaEncoder
|
|||||||
{
|
{
|
||||||
if (extractImages)
|
if (extractImages)
|
||||||
{
|
{
|
||||||
if (video.VideoType == VideoType.Iso)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (video.VideoType == VideoType.BluRay || video.VideoType == VideoType.Dvd)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
// Add some time for the first chapter to make sure we don't end up with a black image
|
// Add some time for the first chapter to make sure we don't end up with a black image
|
||||||
|
@ -46,6 +46,10 @@ namespace MediaBrowser.Controller.LiveTv
|
|||||||
Task<List<MediaSourceInfo>> GetChannelStreamMediaSources(string channelId, CancellationToken cancellationToken);
|
Task<List<MediaSourceInfo>> GetChannelStreamMediaSources(string channelId, CancellationToken cancellationToken);
|
||||||
|
|
||||||
Task<List<TunerHostInfo>> DiscoverDevices(int discoveryDurationMs, CancellationToken cancellationToken);
|
Task<List<TunerHostInfo>> DiscoverDevices(int discoveryDurationMs, CancellationToken cancellationToken);
|
||||||
|
bool IsSupported
|
||||||
|
{
|
||||||
|
get;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public interface IConfigurableTunerHost
|
public interface IConfigurableTunerHost
|
||||||
{
|
{
|
||||||
|
@ -153,7 +153,6 @@ namespace MediaBrowser.Providers.MediaInfo
|
|||||||
if (item.IsShortcut)
|
if (item.IsShortcut)
|
||||||
{
|
{
|
||||||
FetchShortcutInfo(item);
|
FetchShortcutInfo(item);
|
||||||
return Task.FromResult(ItemUpdateType.MetadataImport);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var prober = new FFProbeVideoInfo(_logger, _isoManager, _mediaEncoder, _itemRepo, _blurayExaminer, _localization, _appPaths, _json, _encodingManager, _fileSystem, _config, _subtitleManager, _chapterManager, _libraryManager);
|
var prober = new FFProbeVideoInfo(_logger, _isoManager, _mediaEncoder, _itemRepo, _blurayExaminer, _localization, _appPaths, _json, _encodingManager, _fileSystem, _config, _subtitleManager, _chapterManager, _libraryManager);
|
||||||
|
@ -74,6 +74,10 @@ namespace MediaBrowser.Providers.MediaInfo
|
|||||||
BlurayDiscInfo blurayDiscInfo = null;
|
BlurayDiscInfo blurayDiscInfo = null;
|
||||||
|
|
||||||
try
|
try
|
||||||
|
{
|
||||||
|
Model.MediaInfo.MediaInfo mediaInfoResult = null;
|
||||||
|
|
||||||
|
if (!item.IsShortcut)
|
||||||
{
|
{
|
||||||
string[] streamFileNames = null;
|
string[] streamFileNames = null;
|
||||||
|
|
||||||
@ -113,11 +117,12 @@ namespace MediaBrowser.Providers.MediaInfo
|
|||||||
streamFileNames = new string[] { };
|
streamFileNames = new string[] { };
|
||||||
}
|
}
|
||||||
|
|
||||||
var result = await GetMediaInfo(item, isoMount, streamFileNames, cancellationToken).ConfigureAwait(false);
|
mediaInfoResult = await GetMediaInfo(item, isoMount, streamFileNames, cancellationToken).ConfigureAwait(false);
|
||||||
|
|
||||||
cancellationToken.ThrowIfCancellationRequested();
|
cancellationToken.ThrowIfCancellationRequested();
|
||||||
|
}
|
||||||
|
|
||||||
await Fetch(item, cancellationToken, result, isoMount, blurayDiscInfo, options).ConfigureAwait(false);
|
await Fetch(item, cancellationToken, mediaInfoResult, isoMount, blurayDiscInfo, options).ConfigureAwait(false);
|
||||||
|
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
@ -162,7 +167,12 @@ namespace MediaBrowser.Providers.MediaInfo
|
|||||||
BlurayDiscInfo blurayInfo,
|
BlurayDiscInfo blurayInfo,
|
||||||
MetadataRefreshOptions options)
|
MetadataRefreshOptions options)
|
||||||
{
|
{
|
||||||
var mediaStreams = mediaInfo.MediaStreams;
|
List<MediaStream> mediaStreams;
|
||||||
|
List<ChapterInfo> chapters;
|
||||||
|
|
||||||
|
if (mediaInfo != null)
|
||||||
|
{
|
||||||
|
mediaStreams = mediaInfo.MediaStreams;
|
||||||
|
|
||||||
video.TotalBitrate = mediaInfo.Bitrate;
|
video.TotalBitrate = mediaInfo.Bitrate;
|
||||||
//video.FormatName = (mediaInfo.Container ?? string.Empty)
|
//video.FormatName = (mediaInfo.Container ?? string.Empty)
|
||||||
@ -188,17 +198,29 @@ namespace MediaBrowser.Providers.MediaInfo
|
|||||||
}
|
}
|
||||||
video.Container = mediaInfo.Container;
|
video.Container = mediaInfo.Container;
|
||||||
|
|
||||||
var chapters = mediaInfo.Chapters == null ? new List<ChapterInfo>() : mediaInfo.Chapters.ToList();
|
chapters = mediaInfo.Chapters == null ? new List<ChapterInfo>() : mediaInfo.Chapters.ToList();
|
||||||
if (blurayInfo != null)
|
if (blurayInfo != null)
|
||||||
{
|
{
|
||||||
FetchBdInfo(video, chapters, mediaStreams, blurayInfo);
|
FetchBdInfo(video, chapters, mediaStreams, blurayInfo);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mediaStreams = new List<MediaStream>();
|
||||||
|
chapters = new List<ChapterInfo>();
|
||||||
|
}
|
||||||
|
|
||||||
await AddExternalSubtitles(video, mediaStreams, options, cancellationToken).ConfigureAwait(false);
|
await AddExternalSubtitles(video, mediaStreams, options, cancellationToken).ConfigureAwait(false);
|
||||||
|
|
||||||
var libraryOptions = _libraryManager.GetLibraryOptions(video);
|
var libraryOptions = _libraryManager.GetLibraryOptions(video);
|
||||||
|
|
||||||
|
if (mediaInfo != null)
|
||||||
|
{
|
||||||
FetchEmbeddedInfo(video, mediaInfo, options, libraryOptions);
|
FetchEmbeddedInfo(video, mediaInfo, options, libraryOptions);
|
||||||
FetchPeople(video, mediaInfo, options);
|
FetchPeople(video, mediaInfo, options);
|
||||||
|
video.Timestamp = mediaInfo.Timestamp;
|
||||||
|
video.Video3DFormat = video.Video3DFormat ?? mediaInfo.Video3DFormat;
|
||||||
|
}
|
||||||
|
|
||||||
video.IsHD = mediaStreams.Any(i => i.Type == MediaStreamType.Video && i.Width.HasValue && i.Width.Value >= 1260);
|
video.IsHD = mediaStreams.Any(i => i.Type == MediaStreamType.Video && i.Width.HasValue && i.Width.Value >= 1260);
|
||||||
|
|
||||||
@ -207,9 +229,6 @@ namespace MediaBrowser.Providers.MediaInfo
|
|||||||
video.DefaultVideoStreamIndex = videoStream == null ? (int?)null : videoStream.Index;
|
video.DefaultVideoStreamIndex = videoStream == null ? (int?)null : videoStream.Index;
|
||||||
|
|
||||||
video.HasSubtitles = mediaStreams.Any(i => i.Type == MediaStreamType.Subtitle);
|
video.HasSubtitles = mediaStreams.Any(i => i.Type == MediaStreamType.Subtitle);
|
||||||
video.Timestamp = mediaInfo.Timestamp;
|
|
||||||
|
|
||||||
video.Video3DFormat = video.Video3DFormat ?? mediaInfo.Video3DFormat;
|
|
||||||
|
|
||||||
_itemRepo.SaveMediaStreams(video.Id, mediaStreams, cancellationToken);
|
_itemRepo.SaveMediaStreams(video.Id, mediaStreams, cancellationToken);
|
||||||
|
|
||||||
|
@ -262,7 +262,7 @@ namespace MediaBrowser.Providers.Movies
|
|||||||
var keepTypes = new[]
|
var keepTypes = new[]
|
||||||
{
|
{
|
||||||
PersonType.Director,
|
PersonType.Director,
|
||||||
PersonType.Writer,
|
//PersonType.Writer,
|
||||||
//PersonType.Producer
|
//PersonType.Producer
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user