mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-21 17:44:43 +01:00
fix artist editor
This commit is contained in:
@@ -1168,6 +1168,26 @@ namespace MediaBrowser.Server.Implementations.Dto
|
||||
};
|
||||
})
|
||||
.ToList();
|
||||
|
||||
// Include artists that are not in the database yet, e.g., just added via metadata editor
|
||||
var foundArtists = artistItems.Items.Select(i => i.Item1.Name).ToList();
|
||||
dto.ArtistItems.AddRange(hasArtist.Artists
|
||||
.Except(foundArtists, new DistinctNameComparer())
|
||||
.Select(i =>
|
||||
{
|
||||
var artist = _libraryManager.GetArtist(i);
|
||||
if (artist != null)
|
||||
{
|
||||
return new NameIdPair
|
||||
{
|
||||
Name = artist.Name,
|
||||
Id = artist.Id.ToString("N")
|
||||
};
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
}).Where(i => i != null));
|
||||
}
|
||||
|
||||
var hasAlbumArtist = item as IHasAlbumArtist;
|
||||
|
||||
@@ -33,7 +33,7 @@ using Microsoft.Win32;
|
||||
|
||||
namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
|
||||
{
|
||||
public class EmbyTV : ILiveTvService, ISupportsNewTimerIds, IHasRegistrationInfo, IDisposable
|
||||
public class EmbyTV : ILiveTvService, ISupportsNewTimerIds, IDisposable
|
||||
{
|
||||
private readonly IApplicationHost _appHpst;
|
||||
private readonly ILogger _logger;
|
||||
@@ -46,7 +46,6 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
|
||||
|
||||
private readonly LiveTvManager _liveTvManager;
|
||||
private readonly IFileSystem _fileSystem;
|
||||
private readonly ISecurityManager _security;
|
||||
|
||||
private readonly ILibraryMonitor _libraryMonitor;
|
||||
private readonly ILibraryManager _libraryManager;
|
||||
@@ -62,7 +61,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
|
||||
private readonly ConcurrentDictionary<string, ActiveRecordingInfo> _activeRecordings =
|
||||
new ConcurrentDictionary<string, ActiveRecordingInfo>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
public EmbyTV(IApplicationHost appHost, ILogger logger, IJsonSerializer jsonSerializer, IHttpClient httpClient, IServerConfigurationManager config, ILiveTvManager liveTvManager, IFileSystem fileSystem, ISecurityManager security, ILibraryManager libraryManager, ILibraryMonitor libraryMonitor, IProviderManager providerManager, IFileOrganizationService organizationService, IMediaEncoder mediaEncoder, IPowerManagement powerManagement)
|
||||
public EmbyTV(IApplicationHost appHost, ILogger logger, IJsonSerializer jsonSerializer, IHttpClient httpClient, IServerConfigurationManager config, ILiveTvManager liveTvManager, IFileSystem fileSystem, ILibraryManager libraryManager, ILibraryMonitor libraryMonitor, IProviderManager providerManager, IFileOrganizationService organizationService, IMediaEncoder mediaEncoder, IPowerManagement powerManagement)
|
||||
{
|
||||
Current = this;
|
||||
|
||||
@@ -71,7 +70,6 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
|
||||
_httpClient = httpClient;
|
||||
_config = config;
|
||||
_fileSystem = fileSystem;
|
||||
_security = security;
|
||||
_libraryManager = libraryManager;
|
||||
_libraryMonitor = libraryMonitor;
|
||||
_providerManager = providerManager;
|
||||
@@ -1114,7 +1112,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
|
||||
|
||||
if (config.EnableRecordingEncoding)
|
||||
{
|
||||
var regInfo = await _security.GetRegistrationStatus("embytvrecordingconversion").ConfigureAwait(false);
|
||||
var regInfo = await _liveTvManager.GetRegistrationInfo("embytvrecordingconversion").ConfigureAwait(false);
|
||||
|
||||
if (regInfo.IsValid)
|
||||
{
|
||||
@@ -1171,8 +1169,8 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
|
||||
private async Task UpdateTimersForSeriesTimer(List<ProgramInfo> epgData, SeriesTimerInfo seriesTimer, bool deleteInvalidTimers)
|
||||
{
|
||||
var newTimers = GetTimersForSeries(seriesTimer, epgData, true).ToList();
|
||||
|
||||
var registration = await GetRegistrationInfo("seriesrecordings").ConfigureAwait(false);
|
||||
|
||||
var registration = await _liveTvManager.GetRegistrationInfo("seriesrecordings").ConfigureAwait(false);
|
||||
|
||||
if (registration.IsValid)
|
||||
{
|
||||
@@ -1349,20 +1347,6 @@ namespace MediaBrowser.Server.Implementations.LiveTv.EmbyTV
|
||||
}
|
||||
}
|
||||
|
||||
public Task<MBRegistrationRecord> GetRegistrationInfo(string feature)
|
||||
{
|
||||
if (string.Equals(feature, "seriesrecordings", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return _security.GetRegistrationStatus("embytvseriesrecordings");
|
||||
}
|
||||
|
||||
return Task.FromResult(new MBRegistrationRecord
|
||||
{
|
||||
IsValid = true,
|
||||
IsRegistered = true
|
||||
});
|
||||
}
|
||||
|
||||
public List<VirtualFolderInfo> GetRecordingFolders()
|
||||
{
|
||||
var list = new List<VirtualFolderInfo>();
|
||||
|
||||
@@ -31,6 +31,7 @@ using CommonIO;
|
||||
using IniParser;
|
||||
using IniParser.Model;
|
||||
using MediaBrowser.Common.Events;
|
||||
using MediaBrowser.Common.Security;
|
||||
using MediaBrowser.Controller.Entities.Movies;
|
||||
using MediaBrowser.Controller.Entities.TV;
|
||||
using MediaBrowser.Model.Events;
|
||||
@@ -51,6 +52,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||
private readonly ITaskManager _taskManager;
|
||||
private readonly IJsonSerializer _jsonSerializer;
|
||||
private readonly IProviderManager _providerManager;
|
||||
private readonly ISecurityManager _security;
|
||||
|
||||
private readonly IDtoService _dtoService;
|
||||
private readonly ILocalizationManager _localization;
|
||||
@@ -73,7 +75,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||
public event EventHandler<GenericEventArgs<TimerEventInfo>> TimerCreated;
|
||||
public event EventHandler<GenericEventArgs<TimerEventInfo>> SeriesTimerCreated;
|
||||
|
||||
public LiveTvManager(IApplicationHost appHost, IServerConfigurationManager config, ILogger logger, IItemRepository itemRepo, IImageProcessor imageProcessor, IUserDataManager userDataManager, IDtoService dtoService, IUserManager userManager, ILibraryManager libraryManager, ITaskManager taskManager, ILocalizationManager localization, IJsonSerializer jsonSerializer, IProviderManager providerManager, IFileSystem fileSystem)
|
||||
public LiveTvManager(IApplicationHost appHost, IServerConfigurationManager config, ILogger logger, IItemRepository itemRepo, IImageProcessor imageProcessor, IUserDataManager userDataManager, IDtoService dtoService, IUserManager userManager, ILibraryManager libraryManager, ITaskManager taskManager, ILocalizationManager localization, IJsonSerializer jsonSerializer, IProviderManager providerManager, IFileSystem fileSystem, ISecurityManager security)
|
||||
{
|
||||
_config = config;
|
||||
_logger = logger;
|
||||
@@ -85,6 +87,7 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||
_jsonSerializer = jsonSerializer;
|
||||
_providerManager = providerManager;
|
||||
_fileSystem = fileSystem;
|
||||
_security = security;
|
||||
_dtoService = dtoService;
|
||||
_userDataManager = userDataManager;
|
||||
|
||||
@@ -2133,6 +2136,14 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||
|
||||
public async Task CreateSeriesTimer(SeriesTimerInfoDto timer, CancellationToken cancellationToken)
|
||||
{
|
||||
var registration = await GetRegistrationInfo("seriesrecordings").ConfigureAwait(false);
|
||||
|
||||
if (!registration.IsValid)
|
||||
{
|
||||
_logger.Info("Creating series recordings requires an active Emby Premiere subscription.");
|
||||
return;
|
||||
}
|
||||
|
||||
var service = GetService(timer.ServiceName);
|
||||
|
||||
var info = await _tvDtoService.GetSeriesTimerInfo(timer, true, this, cancellationToken).ConfigureAwait(false);
|
||||
@@ -2695,33 +2706,14 @@ namespace MediaBrowser.Server.Implementations.LiveTv
|
||||
}
|
||||
}
|
||||
|
||||
public Task<MBRegistrationRecord> GetRegistrationInfo(string channelId, string programId, string feature)
|
||||
public Task<MBRegistrationRecord> GetRegistrationInfo(string feature)
|
||||
{
|
||||
ILiveTvService service;
|
||||
|
||||
if (string.IsNullOrWhiteSpace(programId))
|
||||
if (string.Equals(feature, "seriesrecordings", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
var channel = GetInternalChannel(channelId);
|
||||
service = GetService(channel);
|
||||
}
|
||||
else
|
||||
{
|
||||
var program = GetInternalProgram(programId);
|
||||
service = GetService(program);
|
||||
feature = "embytvseriesrecordings";
|
||||
}
|
||||
|
||||
var hasRegistration = service as IHasRegistrationInfo;
|
||||
|
||||
if (hasRegistration != null)
|
||||
{
|
||||
return hasRegistration.GetRegistrationInfo(feature);
|
||||
}
|
||||
|
||||
return Task.FromResult(new MBRegistrationRecord
|
||||
{
|
||||
IsValid = true,
|
||||
IsRegistered = true
|
||||
});
|
||||
return _security.GetRegistrationStatus(feature);
|
||||
}
|
||||
|
||||
public List<NameValuePair> GetSatIniMappings()
|
||||
|
||||
Reference in New Issue
Block a user