diff --git a/src/.idea/.idea.Ombi/.idea/contentModel.xml b/src/.idea/.idea.Ombi/.idea/contentModel.xml
index 71b5f9704..4affa7aee 100644
--- a/src/.idea/.idea.Ombi/.idea/contentModel.xml
+++ b/src/.idea/.idea.Ombi/.idea/contentModel.xml
@@ -1408,6 +1408,7 @@
+
@@ -1431,6 +1432,7 @@
+
@@ -1471,6 +1473,9 @@
+
+
+
diff --git a/src/.idea/.idea.Ombi/.idea/workspace.xml b/src/.idea/.idea.Ombi/.idea/workspace.xml
index 5e9403b12..1ad475803 100644
--- a/src/.idea/.idea.Ombi/.idea/workspace.xml
+++ b/src/.idea/.idea.Ombi/.idea/workspace.xml
@@ -2,7 +2,17 @@
-
+
+
+
+
+
+
+
+
+
+
+
@@ -13,103 +23,210 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
@@ -121,40 +238,56 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
+
-
-
-
-
-
-
-
-
-
-
+
+
-
+
+
+
+
+
@@ -165,6 +298,17 @@
+
+
+
+
+
+
+
+
+
+
+
@@ -183,6 +327,13 @@
+
+
+
+
+
+
+
@@ -193,8 +344,10 @@
+
+
@@ -294,12 +447,12 @@
1563957157468
-
+
-
+
@@ -311,7 +464,8 @@
-
+
+
@@ -319,15 +473,15 @@
-
+
-
-
+
+
-
+
@@ -362,8 +516,76 @@
+
+ file://$PROJECT_DIR$/Ombi.Core/Engine/V2/MultiSearchEngine.cs
+ 59
+
+
+
+
+
+
+
+
+
+
+
+ file://$PROJECT_DIR$/Ombi.Core/Engine/V2/MultiSearchEngine.cs
+ 49
+
+
+
+
+
+
+
+
+
+
+
+ file://$PROJECT_DIR$/Ombi.Api.MusicBrainz/MusicBrainzApi.cs
+ 30
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ artist
+ C#
+ RiderImportsList:
+ EXPRESSION
+
+
+ artist.id
+ C#
+ RiderImportsList:
+ EXPRESSION
+
+
+ artist.name
+ C#
+ RiderImportsList:
+ EXPRESSION
+
+
@@ -524,8 +746,8 @@
-
-
+
+
@@ -569,5 +791,251 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/.idea/config/applicationhost.config b/src/.idea/config/applicationhost.config
index de10173b6..c5af21960 100644
--- a/src/.idea/config/applicationhost.config
+++ b/src/.idea/config/applicationhost.config
@@ -974,18 +974,20 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Ombi.Api.MusicBrainz/Models/Artist/ArtistInformation.cs b/src/Ombi.Api.MusicBrainz/Models/Artist/ArtistInformation.cs
index 4453da632..a14f15d15 100644
--- a/src/Ombi.Api.MusicBrainz/Models/Artist/ArtistInformation.cs
+++ b/src/Ombi.Api.MusicBrainz/Models/Artist/ArtistInformation.cs
@@ -39,7 +39,7 @@ namespace Ombi.Api.MusicBrainz.Models.Artist
public class LifeSpan
{
public bool ended { get; set; }
- public object end { get; set; }
+ public string end { get; set; }
public string begin { get; set; }
}
diff --git a/src/Ombi.Core/Engine/Interfaces/IMusicSearchEngineV2.cs b/src/Ombi.Core/Engine/Interfaces/IMusicSearchEngineV2.cs
new file mode 100644
index 000000000..73c45347e
--- /dev/null
+++ b/src/Ombi.Core/Engine/Interfaces/IMusicSearchEngineV2.cs
@@ -0,0 +1,10 @@
+using System.Threading.Tasks;
+using Ombi.Core.Models.Search.V2.Music;
+
+namespace Ombi.Core.Engine.Interfaces
+{
+ public interface IMusicSearchEngineV2
+ {
+ Task GetArtistInformation(string artistId);
+ }
+}
\ No newline at end of file
diff --git a/src/Ombi.Core/Engine/V2/MusicSearchEngineV2.cs b/src/Ombi.Core/Engine/V2/MusicSearchEngineV2.cs
new file mode 100644
index 000000000..244fac221
--- /dev/null
+++ b/src/Ombi.Core/Engine/V2/MusicSearchEngineV2.cs
@@ -0,0 +1,45 @@
+using System.Security.Principal;
+using System.Threading.Tasks;
+using Ombi.Api.MusicBrainz;
+using Ombi.Core.Authentication;
+using Ombi.Core.Engine.Interfaces;
+using Ombi.Core.Models.Requests;
+using Ombi.Core.Models.Search.V2.Music;
+using Ombi.Core.Rule.Interfaces;
+using Ombi.Core.Settings;
+using Ombi.Helpers;
+using Ombi.Settings.Settings.Models;
+using Ombi.Store.Entities;
+using Ombi.Store.Repository;
+
+namespace Ombi.Core.Engine.V2
+{
+ public class MusicSearchEngineV2 : BaseMediaEngine, IMusicSearchEngineV2
+ {
+ private readonly IMusicBrainzApi _musicBrainzApi;
+
+ public MusicSearchEngineV2(IPrincipal identity, IRequestServiceMain requestService, IRuleEvaluator rules,
+ OmbiUserManager um, ICacheService cache, ISettingsService ombiSettings,
+ IRepository sub, IMusicBrainzApi musicBrainzApi)
+ : base(identity, requestService, rules, um, cache, ombiSettings, sub)
+ {
+ _musicBrainzApi = musicBrainzApi;
+ }
+
+ public async Task GetArtistInformation(string artistId)
+ {
+ var artist = await _musicBrainzApi.GetArtistInformation(artistId);
+
+ return new ArtistInformation{
+ Id = artistId,
+ Name = artist.name,
+ Country = artist.country,
+ Region = artist.begin_area?.name,
+ Type = artist.type,
+ StartYear = artist.lifespan?.begin ?? "",
+ EndYear = artist.lifespan?.end?? "",
+ };
+
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Ombi.Core/Models/Search/V2/Music/ArtistInformation.cs b/src/Ombi.Core/Models/Search/V2/Music/ArtistInformation.cs
new file mode 100644
index 000000000..6d4580655
--- /dev/null
+++ b/src/Ombi.Core/Models/Search/V2/Music/ArtistInformation.cs
@@ -0,0 +1,13 @@
+namespace Ombi.Core.Models.Search.V2.Music
+{
+ public class ArtistInformation
+ {
+ public string Name { get; set; }
+ public string Id { get; set; }
+ public string StartYear { get; set; }
+ public string EndYear { get; set; }
+ public string Type { get; set; }
+ public string Country { get; set; }
+ public string Region { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/src/Ombi.DependencyInjection/IocExtensions.cs b/src/Ombi.DependencyInjection/IocExtensions.cs
index fbb90bf5e..ec48e6e3d 100644
--- a/src/Ombi.DependencyInjection/IocExtensions.cs
+++ b/src/Ombi.DependencyInjection/IocExtensions.cs
@@ -109,6 +109,7 @@ namespace Ombi.DependencyInjection
services.AddTransient();
services.AddTransient();
services.AddTransient();
+ services.AddTransient();
}
public static void RegisterHttp(this IServiceCollection services)
diff --git a/src/Ombi/ClientApp/src/app/media-details/components/artist/artist-details.component.ts b/src/Ombi/ClientApp/src/app/media-details/components/artist/artist-details.component.ts
index 713b35e05..e78eb12e5 100644
--- a/src/Ombi/ClientApp/src/app/media-details/components/artist/artist-details.component.ts
+++ b/src/Ombi/ClientApp/src/app/media-details/components/artist/artist-details.component.ts
@@ -21,14 +21,14 @@ export class ArtistDetailsComponent {
public isAdmin: boolean;
public advancedOptions: IAdvancedData;
- private theMovidDbId: number;
+ private artistId: string;
constructor(private searchService: SearchV2Service, private route: ActivatedRoute,
private sanitizer: DomSanitizer, private imageService: ImageService,
public dialog: MatDialog, private requestService: RequestService,
public messageService: MessageService, private auth: AuthService) {
this.route.params.subscribe((params: any) => {
- this.theMovidDbId = params.artistId;
+ this.artistId = params.artistId;
this.load();
});
}
@@ -36,29 +36,30 @@ export class ArtistDetailsComponent {
public load() {
this.isAdmin = this.auth.hasRole("admin") || this.auth.hasRole("poweruser");
- this.searchService.getFullMovieDetails(this.theMovidDbId).subscribe(async x => {
- this.movie = x;
- if (this.movie.requestId > 0) {
- // Load up this request
- this.hasRequest = true;
- this.movieRequest = await this.requestService.getMovieRequest(this.movie.requestId);
- }
- this.imageService.getMovieBanner(this.theMovidDbId.toString()).subscribe(x => {
- this.movie.background = this.sanitizer.bypassSecurityTrustStyle
- ("url(" + x + ")");
- });
- });
+ this.searchService.getArtistInformation(this.artistId).subscribe();
+ // this.searchService.getFullMovieDetails(this.theMovidDbId).subscribe(async x => {
+ // this.movie = x;
+ // if (this.movie.requestId > 0) {
+ // // Load up this request
+ // this.hasRequest = true;
+ // this.movieRequest = await this.requestService.getMovieRequest(this.movie.requestId);
+ // }
+ // this.imageService.getMovieBanner(this.theMovidDbId.toString()).subscribe(x => {
+ // this.movie.background = this.sanitizer.bypassSecurityTrustStyle
+ // ("url(" + x + ")");
+ // });
+ // });
}
public async request() {
- const result = await this.requestService.requestMovie({ theMovieDbId: this.theMovidDbId, languageCode: null }).toPromise();
- if (result.result) {
- this.movie.requested = true;
- this.messageService.send(result.message, "Ok");
- } else {
- this.messageService.send(result.errorMessage, "Ok");
- }
+ // const result = await this.requestService.requestMovie({ theMovieDbId: this.theMovidDbId, languageCode: null }).toPromise();
+ // if (result.result) {
+ // this.movie.requested = true;
+ // this.messageService.send(result.message, "Ok");
+ // } else {
+ // this.messageService.send(result.errorMessage, "Ok");
+ // }
}
public openDialog() {
diff --git a/src/Ombi/ClientApp/src/app/services/searchV2.service.ts b/src/Ombi/ClientApp/src/app/services/searchV2.service.ts
index e57044b59..8de68edb7 100644
--- a/src/Ombi/ClientApp/src/app/services/searchV2.service.ts
+++ b/src/Ombi/ClientApp/src/app/services/searchV2.service.ts
@@ -98,4 +98,8 @@ export class SearchV2Service extends ServiceHelpers {
public getMoviesByActor(actorId: number): Observable {
return this.http.get(`${this.url}/actor/${actorId}/movie`, { headers: this.headers });
}
+
+ public getArtistInformation(artistId: string): Observable {
+ return this.http.get(`${this.url}/artist/${artistId}`);
+ }
}
diff --git a/src/Ombi/Controllers/V2/SearchController.cs b/src/Ombi/Controllers/V2/SearchController.cs
index 9bc532129..475aef58b 100644
--- a/src/Ombi/Controllers/V2/SearchController.cs
+++ b/src/Ombi/Controllers/V2/SearchController.cs
@@ -13,6 +13,7 @@ using Ombi.Core.Engine.V2;
using Ombi.Core.Engine.Interfaces;
using Ombi.Core.Models.Search;
using Ombi.Core.Models.Search.V2;
+using Ombi.Core.Models.Search.V2.Music;
using Ombi.Models;
namespace Ombi.Controllers.V2
@@ -23,7 +24,7 @@ namespace Ombi.Controllers.V2
public class SearchController : ControllerBase
{
public SearchController(IMultiSearchEngine multiSearchEngine, ITvSearchEngine tvSearchEngine,
- IMovieEngineV2 v2Movie, ITVSearchEngineV2 v2Tv, IMusicBrainzApi musicApi)
+ IMovieEngineV2 v2Movie, ITVSearchEngineV2 v2Tv, IMusicSearchEngineV2 musicEngine)
{
_multiSearchEngine = multiSearchEngine;
_tvSearchEngine = tvSearchEngine;
@@ -31,14 +32,14 @@ namespace Ombi.Controllers.V2
_movieEngineV2 = v2Movie;
_movieEngineV2.ResultLimit = 12;
_tvEngineV2 = v2Tv;
- music = musicApi;
+ _musicEngine = musicEngine;
}
private readonly IMultiSearchEngine _multiSearchEngine;
private readonly IMovieEngineV2 _movieEngineV2;
private readonly ITVSearchEngineV2 _tvEngineV2;
private readonly ITvSearchEngine _tvSearchEngine;
- private readonly IMusicBrainzApi music;
+ private readonly IMusicSearchEngineV2 _musicEngine;
///
/// Returns search results for both TV and Movies
@@ -339,12 +340,12 @@ namespace Ombi.Controllers.V2
}
- [HttpGet("artist/{name}")]
+ [HttpGet("artist/{artistId}")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesDefaultResponseType]
- public async Task> GetArtists(string name)
+ public async Task GetArtistInformation(string artistId)
{
- return await music.SearchArtist(name);
+ return await _musicEngine.GetArtistInformation(artistId);
}
}