update home sections
This commit is contained in:
parent
b5aca50c9e
commit
1663b258a7
|
@ -3929,15 +3929,6 @@ namespace Emby.Server.Implementations.Data
|
|||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(query.SlugName))
|
||||
{
|
||||
whereClauses.Add("CleanName=@SlugName");
|
||||
if (statement != null)
|
||||
{
|
||||
statement.TryBind("@SlugName", GetCleanValue(query.SlugName));
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(query.MinSortName))
|
||||
{
|
||||
whereClauses.Add("SortName>=@MinSortName");
|
||||
|
|
|
@ -167,7 +167,6 @@
|
|||
<Compile Include="LiveTv\LiveTvDtoService.cs" />
|
||||
<Compile Include="LiveTv\LiveTvManager.cs" />
|
||||
<Compile Include="LiveTv\LiveTvMediaSourceProvider.cs" />
|
||||
<Compile Include="LiveTv\ProgramImageProvider.cs" />
|
||||
<Compile Include="LiveTv\RecordingImageProvider.cs" />
|
||||
<Compile Include="LiveTv\RefreshChannelsScheduledTask.cs" />
|
||||
<Compile Include="LiveTv\TunerHosts\BaseTunerHost.cs" />
|
||||
|
|
|
@ -1422,18 +1422,6 @@ namespace Emby.Server.Implementations.LiveTv
|
|||
await _libraryManager.UpdateItem(program, ItemUpdateType.MetadataImport, cancellationToken).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
if (!(service is EmbyTV.EmbyTV))
|
||||
{
|
||||
foreach (var program in newPrograms)
|
||||
{
|
||||
_providerManager.QueueRefresh(program.Id, new MetadataRefreshOptions(_fileSystem), RefreshPriority.Low);
|
||||
}
|
||||
foreach (var program in updatedPrograms)
|
||||
{
|
||||
_providerManager.QueueRefresh(program.Id, new MetadataRefreshOptions(_fileSystem), RefreshPriority.Low);
|
||||
}
|
||||
}
|
||||
|
||||
currentChannel.IsMovie = isMovie;
|
||||
currentChannel.IsNews = isNews;
|
||||
currentChannel.IsSports = isSports;
|
||||
|
|
|
@ -1,103 +0,0 @@
|
|||
using MediaBrowser.Controller.Entities;
|
||||
using MediaBrowser.Controller.LiveTv;
|
||||
using MediaBrowser.Controller.Providers;
|
||||
using MediaBrowser.Model.Entities;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Emby.Server.Implementations.LiveTv
|
||||
{
|
||||
public class ProgramImageProvider : IDynamicImageProvider, IHasItemChangeMonitor, IHasOrder
|
||||
{
|
||||
private readonly ILiveTvManager _liveTvManager;
|
||||
|
||||
public ProgramImageProvider(ILiveTvManager liveTvManager)
|
||||
{
|
||||
_liveTvManager = liveTvManager;
|
||||
}
|
||||
|
||||
public IEnumerable<ImageType> GetSupportedImages(IHasImages item)
|
||||
{
|
||||
return new[] { ImageType.Primary };
|
||||
}
|
||||
|
||||
private string GetItemExternalId(BaseItem item)
|
||||
{
|
||||
var externalId = item.ExternalId;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(externalId))
|
||||
{
|
||||
externalId = item.GetProviderId("ProviderExternalId");
|
||||
}
|
||||
|
||||
return externalId;
|
||||
}
|
||||
|
||||
public async Task<DynamicImageResponse> GetImage(IHasImages item, ImageType type, CancellationToken cancellationToken)
|
||||
{
|
||||
var liveTvItem = (LiveTvProgram)item;
|
||||
|
||||
var imageResponse = new DynamicImageResponse();
|
||||
|
||||
var service = _liveTvManager.Services.FirstOrDefault(i => string.Equals(i.Name, liveTvItem.ServiceName, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
if (service != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
var channel = _liveTvManager.GetInternalChannel(liveTvItem.ChannelId);
|
||||
|
||||
if (channel != null)
|
||||
{
|
||||
var response = await service.GetProgramImageAsync(GetItemExternalId(liveTvItem), GetItemExternalId(channel), cancellationToken).ConfigureAwait(false);
|
||||
|
||||
if (response != null)
|
||||
{
|
||||
imageResponse.HasImage = true;
|
||||
imageResponse.Stream = response.Stream;
|
||||
imageResponse.Format = response.Format;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (NotImplementedException)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
return imageResponse;
|
||||
}
|
||||
|
||||
public string Name
|
||||
{
|
||||
get { return "Live TV Service Provider"; }
|
||||
}
|
||||
|
||||
public bool Supports(IHasImages item)
|
||||
{
|
||||
return item is LiveTvProgram;
|
||||
}
|
||||
|
||||
public int Order
|
||||
{
|
||||
get
|
||||
{
|
||||
// Let the better providers run first
|
||||
return 100;
|
||||
}
|
||||
}
|
||||
|
||||
public bool HasChanged(IHasMetadata item, IDirectoryService directoryService)
|
||||
{
|
||||
var liveTvItem = item as LiveTvProgram;
|
||||
|
||||
if (liveTvItem != null)
|
||||
{
|
||||
return !liveTvItem.HasImage(ImageType.Primary);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -178,13 +178,7 @@ namespace MediaBrowser.Api
|
|||
{
|
||||
if (name.IndexOf(BaseItem.SlugChar) != -1)
|
||||
{
|
||||
var result = libraryManager.GetItemList(new InternalItemsQuery
|
||||
{
|
||||
SlugName = name,
|
||||
IncludeItemTypes = new[] { typeof(MusicArtist).Name },
|
||||
DtoOptions = dtoOptions
|
||||
|
||||
}).OfType<MusicArtist>().FirstOrDefault();
|
||||
var result = GetItemFromSlugName<MusicArtist>(libraryManager, name, dtoOptions);
|
||||
|
||||
if (result != null)
|
||||
{
|
||||
|
@ -199,13 +193,7 @@ namespace MediaBrowser.Api
|
|||
{
|
||||
if (name.IndexOf(BaseItem.SlugChar) != -1)
|
||||
{
|
||||
var result = libraryManager.GetItemList(new InternalItemsQuery
|
||||
{
|
||||
SlugName = name,
|
||||
IncludeItemTypes = new[] { typeof(Studio).Name },
|
||||
DtoOptions = dtoOptions
|
||||
|
||||
}).OfType<Studio>().FirstOrDefault();
|
||||
var result = GetItemFromSlugName<Studio>(libraryManager, name, dtoOptions);
|
||||
|
||||
if (result != null)
|
||||
{
|
||||
|
@ -220,13 +208,7 @@ namespace MediaBrowser.Api
|
|||
{
|
||||
if (name.IndexOf(BaseItem.SlugChar) != -1)
|
||||
{
|
||||
var result = libraryManager.GetItemList(new InternalItemsQuery
|
||||
{
|
||||
SlugName = name,
|
||||
IncludeItemTypes = new[] { typeof(Genre).Name },
|
||||
DtoOptions = dtoOptions
|
||||
|
||||
}).OfType<Genre>().FirstOrDefault();
|
||||
var result = GetItemFromSlugName<Genre>(libraryManager, name, dtoOptions);
|
||||
|
||||
if (result != null)
|
||||
{
|
||||
|
@ -241,13 +223,7 @@ namespace MediaBrowser.Api
|
|||
{
|
||||
if (name.IndexOf(BaseItem.SlugChar) != -1)
|
||||
{
|
||||
var result = libraryManager.GetItemList(new InternalItemsQuery
|
||||
{
|
||||
SlugName = name,
|
||||
IncludeItemTypes = new[] { typeof(MusicGenre).Name },
|
||||
DtoOptions = dtoOptions
|
||||
|
||||
}).OfType<MusicGenre>().FirstOrDefault();
|
||||
var result = GetItemFromSlugName<MusicGenre>(libraryManager, name, dtoOptions);
|
||||
|
||||
if (result != null)
|
||||
{
|
||||
|
@ -262,13 +238,7 @@ namespace MediaBrowser.Api
|
|||
{
|
||||
if (name.IndexOf(BaseItem.SlugChar) != -1)
|
||||
{
|
||||
var result = libraryManager.GetItemList(new InternalItemsQuery
|
||||
{
|
||||
SlugName = name,
|
||||
IncludeItemTypes = new[] { typeof(GameGenre).Name },
|
||||
DtoOptions = dtoOptions
|
||||
|
||||
}).OfType<GameGenre>().FirstOrDefault();
|
||||
var result = GetItemFromSlugName<GameGenre>(libraryManager, name, dtoOptions);
|
||||
|
||||
if (result != null)
|
||||
{
|
||||
|
@ -283,13 +253,7 @@ namespace MediaBrowser.Api
|
|||
{
|
||||
if (name.IndexOf(BaseItem.SlugChar) != -1)
|
||||
{
|
||||
var result = libraryManager.GetItemList(new InternalItemsQuery
|
||||
{
|
||||
SlugName = name,
|
||||
IncludeItemTypes = new[] { typeof(Person).Name },
|
||||
DtoOptions = dtoOptions
|
||||
|
||||
}).OfType<Person>().FirstOrDefault();
|
||||
var result = GetItemFromSlugName<Person>(libraryManager, name, dtoOptions);
|
||||
|
||||
if (result != null)
|
||||
{
|
||||
|
@ -300,6 +264,42 @@ namespace MediaBrowser.Api
|
|||
return libraryManager.GetPerson(name);
|
||||
}
|
||||
|
||||
private T GetItemFromSlugName<T>(ILibraryManager libraryManager, string name, DtoOptions dtoOptions)
|
||||
where T : BaseItem, new()
|
||||
{
|
||||
var result = libraryManager.GetItemList(new InternalItemsQuery
|
||||
{
|
||||
Name = name.Replace(BaseItem.SlugChar, '&'),
|
||||
IncludeItemTypes = new[] { typeof(T).Name },
|
||||
DtoOptions = dtoOptions
|
||||
|
||||
}).OfType<Person>().FirstOrDefault();
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
result = libraryManager.GetItemList(new InternalItemsQuery
|
||||
{
|
||||
Name = name.Replace(BaseItem.SlugChar, '/'),
|
||||
IncludeItemTypes = new[] { typeof(T).Name },
|
||||
DtoOptions = dtoOptions
|
||||
|
||||
}).OfType<Person>().FirstOrDefault();
|
||||
}
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
result = libraryManager.GetItemList(new InternalItemsQuery
|
||||
{
|
||||
Name = name.Replace(BaseItem.SlugChar, '?'),
|
||||
IncludeItemTypes = new[] { typeof(T).Name },
|
||||
DtoOptions = dtoOptions
|
||||
|
||||
}).OfType<Person>().FirstOrDefault();
|
||||
}
|
||||
|
||||
return result as T;
|
||||
}
|
||||
|
||||
protected string GetPathValue(int index)
|
||||
{
|
||||
var pathInfo = Parse(Request.PathInfo);
|
||||
|
|
|
@ -56,7 +56,6 @@ namespace MediaBrowser.Controller.Entities
|
|||
public string Path { get; set; }
|
||||
public string PathNotStartsWith { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string SlugName { get; set; }
|
||||
|
||||
public string Person { get; set; }
|
||||
public string[] PersonIds { get; set; }
|
||||
|
|
|
@ -221,12 +221,6 @@ namespace MediaBrowser.Controller.LiveTv
|
|||
|
||||
public override bool IsInternetMetadataEnabled()
|
||||
{
|
||||
if (IsMovie)
|
||||
{
|
||||
var options = (LiveTvOptions)ConfigurationManager.GetConfiguration("livetv");
|
||||
return options.EnableMovieProviders;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -233,7 +233,12 @@ namespace MediaBrowser.Controller.MediaEncoding
|
|||
return null;
|
||||
}
|
||||
|
||||
return codec;
|
||||
if (_mediaEncoder.SupportsDecoder(codec))
|
||||
{
|
||||
return codec;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -92,7 +92,13 @@ namespace MediaBrowser.MediaEncoding.Encoder
|
|||
"mpeg2_qsv",
|
||||
"vc1_qsv",
|
||||
"h264_cuvid",
|
||||
"hevc_cuvid"
|
||||
"hevc_cuvid",
|
||||
"dts",
|
||||
"ac3",
|
||||
"aac",
|
||||
"mp3",
|
||||
"h264",
|
||||
"hevc"
|
||||
};
|
||||
|
||||
foreach (var codec in required)
|
||||
|
|
|
@ -1,13 +1,11 @@
|
|||
using System.Collections.Generic;
|
||||
using MediaBrowser.Model.Dto;
|
||||
using MediaBrowser.Model.Extensions;
|
||||
|
||||
namespace MediaBrowser.Model.LiveTv
|
||||
{
|
||||
public class LiveTvOptions
|
||||
{
|
||||
public int? GuideDays { get; set; }
|
||||
public bool EnableMovieProviders { get; set; }
|
||||
public string RecordingPath { get; set; }
|
||||
public string MovieRecordingPath { get; set; }
|
||||
public string SeriesRecordingPath { get; set; }
|
||||
|
@ -30,7 +28,6 @@ namespace MediaBrowser.Model.LiveTv
|
|||
|
||||
public LiveTvOptions()
|
||||
{
|
||||
EnableMovieProviders = true;
|
||||
TunerHosts = new List<TunerHostInfo>();
|
||||
ListingProviders = new List<ListingsProviderInfo>();
|
||||
MediaLocationsCreated = new string[] { };
|
||||
|
|
|
@ -70,6 +70,8 @@ namespace MediaBrowser.Model.Users
|
|||
|
||||
public UserPolicy()
|
||||
{
|
||||
EnableContentDeletion = true;
|
||||
|
||||
EnableSyncTranscoding = true;
|
||||
|
||||
EnableMediaPlayback = true;
|
||||
|
|
Loading…
Reference in New Issue
Block a user