From 87ebe3910782e768d6c7fc976255e49bccaf439c Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 13 Mar 2014 23:23:58 -0400 Subject: [PATCH] implement music identification --- MediaBrowser.Api/ItemLookupService.cs | 27 ++++ MediaBrowser.Dlna/MediaBrowser.Dlna.csproj | 3 + .../Music/MusicBrainzAlbumProvider.cs | 80 ++++++++++- .../Music/MusicBrainzArtistProvider.cs | 130 ++++++++++++------ 4 files changed, 199 insertions(+), 41 deletions(-) diff --git a/MediaBrowser.Api/ItemLookupService.cs b/MediaBrowser.Api/ItemLookupService.cs index a32a1ad03b..62596287e2 100644 --- a/MediaBrowser.Api/ItemLookupService.cs +++ b/MediaBrowser.Api/ItemLookupService.cs @@ -3,6 +3,7 @@ using MediaBrowser.Common.IO; using MediaBrowser.Controller; using MediaBrowser.Controller.Dto; using MediaBrowser.Controller.Entities; +using MediaBrowser.Controller.Entities.Audio; using MediaBrowser.Controller.Entities.Movies; using MediaBrowser.Controller.Entities.TV; using MediaBrowser.Controller.Library; @@ -67,6 +68,18 @@ namespace MediaBrowser.Api { } + [Route("/Items/RemoteSearch/MusicArtist", "POST")] + [Api(Description = "Gets external id infos for an item")] + public class GetMusicArtistRemoteSearchResults : RemoteSearchQuery, IReturn> + { + } + + [Route("/Items/RemoteSearch/MusicAlbum", "POST")] + [Api(Description = "Gets external id infos for an item")] + public class GetMusicAlbumRemoteSearchResults : RemoteSearchQuery, IReturn> + { + } + [Route("/Items/RemoteSearch/Person", "POST")] [Api(Description = "Gets external id infos for an item")] public class GetPersonRemoteSearchResults : RemoteSearchQuery, IReturn> @@ -167,6 +180,20 @@ namespace MediaBrowser.Api return ToOptimizedResult(result); } + public object Post(GetMusicAlbumRemoteSearchResults request) + { + var result = _providerManager.GetRemoteSearchResults(request, CancellationToken.None).Result; + + return ToOptimizedResult(result); + } + + public object Post(GetMusicArtistRemoteSearchResults request) + { + var result = _providerManager.GetRemoteSearchResults(request, CancellationToken.None).Result; + + return ToOptimizedResult(result); + } + public object Get(GetRemoteSearchImage request) { var result = GetRemoteImage(request).Result; diff --git a/MediaBrowser.Dlna/MediaBrowser.Dlna.csproj b/MediaBrowser.Dlna/MediaBrowser.Dlna.csproj index 75879b3da2..a7ee05cf32 100644 --- a/MediaBrowser.Dlna/MediaBrowser.Dlna.csproj +++ b/MediaBrowser.Dlna/MediaBrowser.Dlna.csproj @@ -96,6 +96,9 @@ MediaBrowser.Model + + +