mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
update intro provider
This commit is contained in:
parent
6186d2809f
commit
2c52712c4e
@ -166,7 +166,7 @@ namespace MediaBrowser.Server.Implementations.Intros
|
|||||||
private IEnumerable<IntroInfo> GetResult(BaseItem item, IEnumerable<ItemWithTrailer> candidates, CinemaModeConfiguration config, int? ratingLevel)
|
private IEnumerable<IntroInfo> GetResult(BaseItem item, IEnumerable<ItemWithTrailer> candidates, CinemaModeConfiguration config, int? ratingLevel)
|
||||||
{
|
{
|
||||||
var customIntros = !string.IsNullOrWhiteSpace(config.CustomIntroPath) ?
|
var customIntros = !string.IsNullOrWhiteSpace(config.CustomIntroPath) ?
|
||||||
GetCustomIntros(item) :
|
GetCustomIntros(config) :
|
||||||
new List<IntroInfo>();
|
new List<IntroInfo>();
|
||||||
|
|
||||||
var trailerLimit = config.TrailerLimit;
|
var trailerLimit = config.TrailerLimit;
|
||||||
@ -215,11 +215,11 @@ namespace MediaBrowser.Server.Implementations.Intros
|
|||||||
return _serverConfig.GetConfiguration<CinemaModeConfiguration>("cinemamode");
|
return _serverConfig.GetConfiguration<CinemaModeConfiguration>("cinemamode");
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<IntroInfo> GetCustomIntros(BaseItem item)
|
private List<IntroInfo> GetCustomIntros(CinemaModeConfiguration options)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return GetCustomIntroFiles()
|
return GetCustomIntroFiles(options, true, false)
|
||||||
.OrderBy(i => Guid.NewGuid())
|
.OrderBy(i => Guid.NewGuid())
|
||||||
.Select(i => new IntroInfo
|
.Select(i => new IntroInfo
|
||||||
{
|
{
|
||||||
@ -233,19 +233,17 @@ namespace MediaBrowser.Server.Implementations.Intros
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerable<string> GetCustomIntroFiles(CinemaModeConfiguration options = null)
|
private IEnumerable<string> GetCustomIntroFiles(CinemaModeConfiguration options, bool enableCustomIntros, bool enableMediaInfoIntros)
|
||||||
{
|
{
|
||||||
options = options ?? GetOptions();
|
|
||||||
|
|
||||||
var list = new List<string>();
|
var list = new List<string>();
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(options.CustomIntroPath))
|
if (enableCustomIntros && !string.IsNullOrWhiteSpace(options.CustomIntroPath))
|
||||||
{
|
{
|
||||||
list.AddRange(_fileSystem.GetFilePaths(options.CustomIntroPath, true)
|
list.AddRange(_fileSystem.GetFilePaths(options.CustomIntroPath, true)
|
||||||
.Where(_libraryManager.IsVideoFile));
|
.Where(_libraryManager.IsVideoFile));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!string.IsNullOrWhiteSpace(options.MediaInfoIntroPath))
|
if (enableMediaInfoIntros && !string.IsNullOrWhiteSpace(options.MediaInfoIntroPath))
|
||||||
{
|
{
|
||||||
list.AddRange(_fileSystem.GetFilePaths(options.MediaInfoIntroPath, true)
|
list.AddRange(_fileSystem.GetFilePaths(options.MediaInfoIntroPath, true)
|
||||||
.Where(_libraryManager.IsVideoFile));
|
.Where(_libraryManager.IsVideoFile));
|
||||||
@ -352,7 +350,7 @@ namespace MediaBrowser.Server.Implementations.Intros
|
|||||||
|
|
||||||
public IEnumerable<string> GetAllIntroFiles()
|
public IEnumerable<string> GetAllIntroFiles()
|
||||||
{
|
{
|
||||||
return GetCustomIntroFiles();
|
return GetCustomIntroFiles(GetOptions(), true, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool IsSupporter
|
private bool IsSupporter
|
||||||
|
Loading…
x
Reference in New Issue
Block a user