re-word internet provider setting

This commit is contained in:
Luke Pulverenti 2014-02-11 23:29:13 -05:00
parent c5f29c67ea
commit 8bf02c9906
10 changed files with 20 additions and 28 deletions

View file

@ -1,6 +1,7 @@
using MediaBrowser.Common.Extensions; using MediaBrowser.Common.Extensions;
using MediaBrowser.Controller.Dto; using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Session;
using MediaBrowser.Model.Dto; using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Serialization; using MediaBrowser.Model.Serialization;
using MediaBrowser.Model.Users; using MediaBrowser.Model.Users;
@ -172,12 +173,14 @@ namespace MediaBrowser.Api
/// </summary> /// </summary>
private readonly IUserManager _userManager; private readonly IUserManager _userManager;
private readonly IDtoService _dtoService; private readonly IDtoService _dtoService;
private readonly ISessionManager _sessionMananger;
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="UserService" /> class. /// Initializes a new instance of the <see cref="UserService" /> class.
/// </summary> /// </summary>
/// <param name="xmlSerializer">The XML serializer.</param> /// <param name="xmlSerializer">The XML serializer.</param>
/// <param name="userManager">The user manager.</param> /// <param name="userManager">The user manager.</param>
/// <param name="dtoService">The dto service.</param>
/// <exception cref="System.ArgumentNullException">xmlSerializer</exception> /// <exception cref="System.ArgumentNullException">xmlSerializer</exception>
public UserService(IXmlSerializer xmlSerializer, IUserManager userManager, IDtoService dtoService) public UserService(IXmlSerializer xmlSerializer, IUserManager userManager, IDtoService dtoService)
: base() : base()
@ -300,17 +303,15 @@ namespace MediaBrowser.Api
throw new ResourceNotFoundException("User not found"); throw new ResourceNotFoundException("User not found");
} }
var success = await _userManager.AuthenticateUser(user, request.Password).ConfigureAwait(false); var auth = AuthorizationRequestFilterAttribute.GetAuthorization(Request);
if (!success) var session = await _sessionMananger.AuthenticateNewSession(user, request.Password, auth.Client, auth.Version,
{ auth.DeviceId, auth.Device, Request.RemoteIp).ConfigureAwait(false);
// Unauthorized
throw new UnauthorizedAccessException("Invalid user or password entered.");
}
var result = new AuthenticationResult var result = new AuthenticationResult
{ {
User = _dtoService.GetUserDto(user) User = _dtoService.GetUserDto(user),
SessionInfo = _dtoService.GetSessionInfoDto(session)
}; };
return result; return result;

View file

@ -1,7 +1,6 @@
using System.Collections.Generic; using MediaBrowser.Model.Weather;
using System.Linq;
using MediaBrowser.Model.Weather;
using System; using System;
using System.Collections.Generic;
namespace MediaBrowser.Model.Configuration namespace MediaBrowser.Model.Configuration
{ {

View file

@ -375,11 +375,6 @@ namespace MediaBrowser.Providers.Manager
{ {
if (provider is IRemoteMetadataProvider) if (provider is IRemoteMetadataProvider)
{ {
if (!ConfigurationManager.Configuration.EnableInternetProviders)
{
return false;
}
if (Array.IndexOf(options.DisabledMetadataFetchers, provider.Name) != -1) if (Array.IndexOf(options.DisabledMetadataFetchers, provider.Name) != -1)
{ {
return false; return false;
@ -410,11 +405,6 @@ namespace MediaBrowser.Providers.Manager
{ {
if (provider is IRemoteImageProvider) if (provider is IRemoteImageProvider)
{ {
if (!ConfigurationManager.Configuration.EnableInternetProviders)
{
return false;
}
if (Array.IndexOf(options.DisabledImageFetchers, provider.Name) != -1) if (Array.IndexOf(options.DisabledImageFetchers, provider.Name) != -1)
{ {
return false; return false;

View file

@ -54,7 +54,7 @@ namespace MediaBrowser.Providers.Movies
/// <returns>Task.</returns> /// <returns>Task.</returns>
public async Task Run(IProgress<double> progress, CancellationToken cancellationToken) public async Task Run(IProgress<double> progress, CancellationToken cancellationToken)
{ {
if (!_config.Configuration.EnableInternetProviders || !_config.Configuration.EnableFanArtUpdates) if (!_config.Configuration.EnableFanArtUpdates)
{ {
progress.Report(100); progress.Report(100);
return; return;

View file

@ -68,7 +68,7 @@ namespace MediaBrowser.Providers.Movies
/// <returns>Task.</returns> /// <returns>Task.</returns>
public async Task Run(IProgress<double> progress, CancellationToken cancellationToken) public async Task Run(IProgress<double> progress, CancellationToken cancellationToken)
{ {
if (!_config.Configuration.EnableInternetProviders && !_config.Configuration.EnableTmdbUpdates) if (!_config.Configuration.EnableTmdbUpdates)
{ {
progress.Report(100); progress.Report(100);
return; return;

View file

@ -53,7 +53,7 @@ namespace MediaBrowser.Providers.Music
/// <returns>Task.</returns> /// <returns>Task.</returns>
public async Task Run(IProgress<double> progress, CancellationToken cancellationToken) public async Task Run(IProgress<double> progress, CancellationToken cancellationToken)
{ {
if (!_config.Configuration.EnableInternetProviders || !_config.Configuration.EnableFanArtUpdates) if (!_config.Configuration.EnableFanArtUpdates)
{ {
progress.Report(100); progress.Report(100);
return; return;

View file

@ -54,7 +54,7 @@ namespace MediaBrowser.Providers.TV
/// <returns>Task.</returns> /// <returns>Task.</returns>
public async Task Run(IProgress<double> progress, CancellationToken cancellationToken) public async Task Run(IProgress<double> progress, CancellationToken cancellationToken)
{ {
if (!_config.Configuration.EnableInternetProviders || !_config.Configuration.EnableFanArtUpdates) if (!_config.Configuration.EnableFanArtUpdates)
{ {
progress.Report(100); progress.Report(100);
return; return;

View file

@ -171,7 +171,9 @@ namespace MediaBrowser.Providers.TV
hasNewSeasons = await AddDummySeasonFolders(series, cancellationToken).ConfigureAwait(false); hasNewSeasons = await AddDummySeasonFolders(series, cancellationToken).ConfigureAwait(false);
} }
if (_config.Configuration.EnableInternetProviders) var seriesConfig = _config.Configuration.MetadataOptions.FirstOrDefault(i => string.Equals(i.ItemType, typeof(Series).Name, StringComparison.OrdinalIgnoreCase));
if (seriesConfig == null || !seriesConfig.DisabledMetadataFetchers.Contains(TvdbSeriesProvider.Current.Name, StringComparer.OrdinalIgnoreCase))
{ {
hasNewEpisodes = await AddMissingEpisodes(group.ToList(), seriesDataPath, episodeLookup, cancellationToken) hasNewEpisodes = await AddMissingEpisodes(group.ToList(), seriesDataPath, episodeLookup, cancellationToken)
.ConfigureAwait(false); .ConfigureAwait(false);

View file

@ -253,8 +253,6 @@ namespace MediaBrowser.Providers.TV
private void FetchMainEpisodeInfo(Episode item, string xmlFile, CancellationToken cancellationToken) private void FetchMainEpisodeInfo(Episode item, string xmlFile, CancellationToken cancellationToken)
{ {
var status = ProviderRefreshStatus.Success;
using (var streamReader = new StreamReader(xmlFile, Encoding.UTF8)) using (var streamReader = new StreamReader(xmlFile, Encoding.UTF8))
{ {
if (!item.LockedFields.Contains(MetadataFields.Cast)) if (!item.LockedFields.Contains(MetadataFields.Cast))

View file

@ -73,7 +73,9 @@ namespace MediaBrowser.Providers.TV
/// <returns>Task.</returns> /// <returns>Task.</returns>
public async Task Run(IProgress<double> progress, CancellationToken cancellationToken) public async Task Run(IProgress<double> progress, CancellationToken cancellationToken)
{ {
if (!_config.Configuration.EnableInternetProviders) var seriesConfig = _config.Configuration.MetadataOptions.FirstOrDefault(i => string.Equals(i.ItemType, typeof(Series).Name, StringComparison.OrdinalIgnoreCase));
if (seriesConfig != null && seriesConfig.DisabledMetadataFetchers.Contains(TvdbSeriesProvider.Current.Name, StringComparer.OrdinalIgnoreCase))
{ {
progress.Report(100); progress.Report(100);
return; return;