From 03296a7ffea5c062a58c9d4fac68f7b1d9ce7ac8 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 25 May 2013 13:55:32 -0400 Subject: [PATCH] updated sqlite 1.0.86 --- .../Music/FanArtUpdatesPrescanTask.cs | 6 ++ .../Providers/Music/LastfmArtistProvider.cs | 72 ++++++++++++++++--- .../Providers/TV/TvdbPrescanTask.cs | 11 ++- ...MediaBrowser.Server.Implementations.csproj | 8 +-- .../packages.config | 2 +- .../MediaBrowser.ServerApplication.csproj | 2 +- 6 files changed, 85 insertions(+), 16 deletions(-) diff --git a/MediaBrowser.Controller/Providers/Music/FanArtUpdatesPrescanTask.cs b/MediaBrowser.Controller/Providers/Music/FanArtUpdatesPrescanTask.cs index c4766a23d0..bedab16c18 100644 --- a/MediaBrowser.Controller/Providers/Music/FanArtUpdatesPrescanTask.cs +++ b/MediaBrowser.Controller/Providers/Music/FanArtUpdatesPrescanTask.cs @@ -51,6 +51,12 @@ namespace MediaBrowser.Controller.Providers.Music /// Task. public async Task Run(IProgress 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 588f6db4fc..e03ee38d71 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 { + /// + /// Class LastfmArtistProvider + /// public class LastfmArtistProvider : LastfmBaseProvider { + /// + /// The _provider manager + /// private readonly IProviderManager _providerManager; + /// + /// The _library manager + /// private readonly ILibraryManager _libraryManager; + /// + /// Initializes a new instance of the class. + /// + /// The json serializer. + /// The HTTP client. + /// The log manager. + /// The configuration manager. + /// The provider manager. + /// The library manager. 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 } } + /// + /// Finds the id from music artist entity. + /// + /// The item. + /// System.String. private string FindIdFromMusicArtistEntity(BaseItem item) { var artist = _libraryManager.RootFolder.RecursiveChildren.OfType() @@ -88,6 +110,12 @@ namespace MediaBrowser.Controller.Providers.Music return artist != null ? artist.GetProviderId(MetadataProviders.Musicbrainz) : null; } + /// + /// Finds the id from last fm. + /// + /// The item. + /// The cancellation token. + /// Task{System.String}. private async Task 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; } + /// + /// Finds the id from music brainz. + /// + /// The item. + /// The cancellation token. + /// Task{System.String}. private async Task 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; } + /// + /// Determines whether the specified text has diacritics. + /// + /// The text. + /// true if the specified text has diacritics; otherwise, false. private bool HasDiacritics(string text) { return !string.Equals(text, RemoveDiacritics(text), StringComparison.Ordinal); } + /// + /// Removes the diacritics. + /// + /// The text. + /// System.String. 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) + /// + /// Fetches the lastfm data. + /// + /// The item. + /// The music brainz id. + /// The cancellation token. + /// Task. + 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 } } + /// + /// Supportses the specified item. + /// + /// The item. + /// true if XXXX, false otherwise 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 4dee310175..dbd45245f9 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 /// /// The _config /// - private readonly IConfigurationManager _config; + private readonly IServerConfigurationManager _config; /// /// Initializes a new instance of the class. @@ -49,7 +50,7 @@ namespace MediaBrowser.Controller.Providers.TV /// The logger. /// The HTTP client. /// The config. - 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 /// Task. public async Task Run(IProgress 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 e1f5a1aa30..82d3fec462 100644 --- a/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj +++ b/MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj @@ -86,13 +86,13 @@ - + False - ..\packages\System.Data.SQLite.1.0.85.0\lib\net45\System.Data.SQLite.dll + ..\packages\System.Data.SQLite.1.0.86.0\lib\net45\System.Data.SQLite.dll - + False - ..\packages\System.Data.SQLite.1.0.85.0\lib\net45\System.Data.SQLite.Linq.dll + ..\packages\System.Data.SQLite.1.0.86.0\lib\net45\System.Data.SQLite.Linq.dll ..\packages\Rx-Core.2.1.30214.0\lib\Net45\System.Reactive.Core.dll diff --git a/MediaBrowser.Server.Implementations/packages.config b/MediaBrowser.Server.Implementations/packages.config index 4b1a17c904..8af3d27cd6 100644 --- a/MediaBrowser.Server.Implementations/packages.config +++ b/MediaBrowser.Server.Implementations/packages.config @@ -14,5 +14,5 @@ - + \ No newline at end of file diff --git a/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj b/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj index af0fa257d9..4e3c1be330 100644 --- a/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj +++ b/MediaBrowser.ServerApplication/MediaBrowser.ServerApplication.csproj @@ -381,7 +381,7 @@ - xcopy "$(SolutionDir)\packages\System.Data.SQLite.1.0.85.0\content\net40\x86\SQLite.Interop.dll" "$(TargetDir)" /y + 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