diff options
6 files changed, 85 insertions, 16 deletions
diff --git a/MediaBrowser.Controller/Providers/Music/FanArtUpdatesPrescanTask.cs b/MediaBrowser.Controller/Providers/Music/FanArtUpdatesPrescanTask.cs index c4766a23d..bedab16c1 100644 --- a/MediaBrowser.Controller/Providers/Music/FanArtUpdatesPrescanTask.cs +++ b/MediaBrowser.Controller/Providers/Music/FanArtUpdatesPrescanTask.cs @@ -51,6 +51,12 @@ namespace MediaBrowser.Controller.Providers.Music /// <returns>Task.</returns> public async Task Run(IProgress<double> progress, CancellationToken cancellationToken) { + if (!_config.Configuration.EnableInternetProviders) + { + progress.Report(100); + return; + } + var path = FanArtArtistProvider.GetArtistDataPath(_config.CommonApplicationPaths); var timestampFile = Path.Combine(path, "time.txt"); diff --git a/MediaBrowser.Controller/Providers/Music/LastfmArtistProvider.cs b/MediaBrowser.Controller/Providers/Music/LastfmArtistProvider.cs index 588f6db4f..e03ee38d7 100644 --- a/MediaBrowser.Controller/Providers/Music/LastfmArtistProvider.cs +++ b/MediaBrowser.Controller/Providers/Music/LastfmArtistProvider.cs @@ -1,8 +1,4 @@ -using System; -using System.Globalization; -using System.Net; -using System.Text; -using MediaBrowser.Common.Net; +using MediaBrowser.Common.Net; using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities.Audio; @@ -11,20 +7,41 @@ using MediaBrowser.Model.Entities; using MediaBrowser.Model.Logging; using MediaBrowser.Model.Net; using MediaBrowser.Model.Serialization; +using System; +using System.Globalization; using System.IO; using System.Linq; +using System.Net; +using System.Text; using System.Threading; using System.Threading.Tasks; using System.Xml; -using Mediabrowser.Model.Entities; namespace MediaBrowser.Controller.Providers.Music { + /// <summary> + /// Class LastfmArtistProvider + /// </summary> public class LastfmArtistProvider : LastfmBaseProvider { + /// <summary> + /// The _provider manager + /// </summary> private readonly IProviderManager _providerManager; + /// <summary> + /// The _library manager + /// </summary> private readonly ILibraryManager _libraryManager; + /// <summary> + /// Initializes a new instance of the <see cref="LastfmArtistProvider"/> class. + /// </summary> + /// <param name="jsonSerializer">The json serializer.</param> + /// <param name="httpClient">The HTTP client.</param> + /// <param name="logManager">The log manager.</param> + /// <param name="configurationManager">The configuration manager.</param> + /// <param name="providerManager">The provider manager.</param> + /// <param name="libraryManager">The library manager.</param> public LastfmArtistProvider(IJsonSerializer jsonSerializer, IHttpClient httpClient, ILogManager logManager, IServerConfigurationManager configurationManager, IProviderManager providerManager, ILibraryManager libraryManager) : base(jsonSerializer, httpClient, logManager, configurationManager) { @@ -80,6 +97,11 @@ namespace MediaBrowser.Controller.Providers.Music } } + /// <summary> + /// Finds the id from music artist entity. + /// </summary> + /// <param name="item">The item.</param> + /// <returns>System.String.</returns> private string FindIdFromMusicArtistEntity(BaseItem item) { var artist = _libraryManager.RootFolder.RecursiveChildren.OfType<MusicArtist>() @@ -88,6 +110,12 @@ namespace MediaBrowser.Controller.Providers.Music return artist != null ? artist.GetProviderId(MetadataProviders.Musicbrainz) : null; } + /// <summary> + /// Finds the id from last fm. + /// </summary> + /// <param name="item">The item.</param> + /// <param name="cancellationToken">The cancellation token.</param> + /// <returns>Task{System.String}.</returns> private async Task<string> FindIdFromLastFm(BaseItem item, CancellationToken cancellationToken) { //Execute the Artist search against our name and assume first one is the one we want @@ -128,6 +156,12 @@ namespace MediaBrowser.Controller.Providers.Music return null; } + /// <summary> + /// Finds the id from music brainz. + /// </summary> + /// <param name="item">The item.</param> + /// <param name="cancellationToken">The cancellation token.</param> + /// <returns>Task{System.String}.</returns> private async Task<string> FindIdFromMusicBrainz(BaseItem item, CancellationToken cancellationToken) { // They seem to throw bad request failures on any term with a slash @@ -166,11 +200,21 @@ namespace MediaBrowser.Controller.Providers.Music return null; } + /// <summary> + /// Determines whether the specified text has diacritics. + /// </summary> + /// <param name="text">The text.</param> + /// <returns><c>true</c> if the specified text has diacritics; otherwise, <c>false</c>.</returns> private bool HasDiacritics(string text) { return !string.Equals(text, RemoveDiacritics(text), StringComparison.Ordinal); } + /// <summary> + /// Removes the diacritics. + /// </summary> + /// <param name="text">The text.</param> + /// <returns>System.String.</returns> private string RemoveDiacritics(string text) { return string.Concat( @@ -180,10 +224,17 @@ namespace MediaBrowser.Controller.Providers.Music ).Normalize(NormalizationForm.FormC); } - protected override async Task FetchLastfmData(BaseItem item, string id, CancellationToken cancellationToken) + /// <summary> + /// Fetches the lastfm data. + /// </summary> + /// <param name="item">The item.</param> + /// <param name="musicBrainzId">The music brainz id.</param> + /// <param name="cancellationToken">The cancellation token.</param> + /// <returns>Task.</returns> + protected override async Task FetchLastfmData(BaseItem item, string musicBrainzId, CancellationToken cancellationToken) { // Get artist info with provided id - var url = RootUrl + string.Format("method=artist.getInfo&mbid={0}&api_key={1}&format=json", UrlEncode(id), ApiKey); + var url = RootUrl + string.Format("method=artist.getInfo&mbid={0}&api_key={1}&format=json", UrlEncode(musicBrainzId), ApiKey); LastfmGetArtistResult result; @@ -221,6 +272,11 @@ namespace MediaBrowser.Controller.Providers.Music } } + /// <summary> + /// Supportses the specified item. + /// </summary> + /// <param name="item">The item.</param> + /// <returns><c>true</c> if XXXX, <c>false</c> otherwise</returns> public override bool Supports(BaseItem item) { return item is MusicArtist; diff --git a/MediaBrowser.Controller/Providers/TV/TvdbPrescanTask.cs b/MediaBrowser.Controller/Providers/TV/TvdbPrescanTask.cs index 4dee31017..dbd45245f 100644 --- a/MediaBrowser.Controller/Providers/TV/TvdbPrescanTask.cs +++ b/MediaBrowser.Controller/Providers/TV/TvdbPrescanTask.cs @@ -1,5 +1,6 @@ using MediaBrowser.Common.Configuration; using MediaBrowser.Common.Net; +using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Extensions; using MediaBrowser.Controller.Library; using MediaBrowser.Model.Logging; @@ -41,7 +42,7 @@ namespace MediaBrowser.Controller.Providers.TV /// <summary> /// The _config /// </summary> - private readonly IConfigurationManager _config; + private readonly IServerConfigurationManager _config; /// <summary> /// Initializes a new instance of the <see cref="TvdbPrescanTask"/> class. @@ -49,7 +50,7 @@ namespace MediaBrowser.Controller.Providers.TV /// <param name="logger">The logger.</param> /// <param name="httpClient">The HTTP client.</param> /// <param name="config">The config.</param> - public TvdbPrescanTask(ILogger logger, IHttpClient httpClient, IConfigurationManager config) + public TvdbPrescanTask(ILogger logger, IHttpClient httpClient, IServerConfigurationManager config) { _logger = logger; _httpClient = httpClient; @@ -64,6 +65,12 @@ namespace MediaBrowser.Controller.Providers.TV /// <returns>Task.</returns> public async Task Run(IProgress<double> progress, CancellationToken cancellationToken) { + if (!_config.Configuration.EnableInternetProviders) + { + progress.Report(100); + return; + } + var path = RemoteSeriesProvider.GetSeriesDataPath(_config.CommonApplicationPaths); var timestampFile = Path.Combine(path, "time.txt"); diff --git a/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj b/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj index e1f5a1aa3..82d3fec46 100644 --- a/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj +++ b/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj @@ -86,13 +86,13 @@ </Reference> <Reference Include="System" /> <Reference Include="System.Core" /> - <Reference Include="System.Data.SQLite, Version=1.0.85.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL"> + <Reference Include="System.Data.SQLite, Version=1.0.86.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\packages\System.Data.SQLite.1.0.85.0\lib\net45\System.Data.SQLite.dll</HintPath> + <HintPath>..\packages\System.Data.SQLite.1.0.86.0\lib\net45\System.Data.SQLite.dll</HintPath> </Reference> - <Reference Include="System.Data.SQLite.Linq, Version=1.0.85.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL"> + <Reference Include="System.Data.SQLite.Linq, Version=1.0.86.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\packages\System.Data.SQLite.1.0.85.0\lib\net45\System.Data.SQLite.Linq.dll</HintPath> + <HintPath>..\packages\System.Data.SQLite.1.0.86.0\lib\net45\System.Data.SQLite.Linq.dll</HintPath> </Reference> <Reference Include="System.Reactive.Core"> <HintPath>..\packages\Rx-Core.2.1.30214.0\lib\Net45\System.Reactive.Core.dll</HintPath> diff --git a/MediaBrowser.Server.Implementations/packages.config b/MediaBrowser.Server.Implementations/packages.config index 4b1a17c90..8af3d27cd 100644 --- a/MediaBrowser.Server.Implementations/packages.config +++ b/MediaBrowser.Server.Implementations/packages.config @@ -14,5 +14,5 @@ <package id="ServiceStack.Redis" version="3.9.43" targetFramework="net45" /> <package id="ServiceStack.Text" version="3.9.45" targetFramework="net45" /> <package id="SharpZipLib" version="0.86.0" targetFramework="net45" /> - <package id="System.Data.SQLite" version="1.0.85.0" targetFramework="net45" /> + <package id="System.Data.SQLite" version="1.0.86.0" targetFramework="net45" /> </packages>
\ No newline at end of file diff --git a/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj b/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj index af0fa257d..4e3c1be33 100644 --- a/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj +++ b/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj @@ -381,7 +381,7 @@ </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <PropertyGroup> - <PostBuildEvent>xcopy "$(SolutionDir)\packages\System.Data.SQLite.1.0.85.0\content\net40\x86\SQLite.Interop.dll" "$(TargetDir)" /y + <PostBuildEvent>xcopy "$(SolutionDir)\packages\System.Data.SQLite.1.0.86.0\content\net40\x86\SQLite.Interop.dll" "$(TargetDir)" /y if $(ConfigurationName) == Release ( rmdir "$(SolutionDir)..\Deploy\Server\System" /s /q |
