!wip on music

pull/3895/head
Jamie Rees 5 years ago
parent 7ce5074926
commit 0a192c5e83

@ -26,7 +26,7 @@
<entry file="file://$PROJECT_DIR$/Ombi.Core/Engine/V2/MusicSearchEngineV2.cs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="240">
<caret line="15" column="1" lean-forward="true" selection-start-line="15" selection-start-column="1" selection-end-line="15" selection-end-column="1" />
<caret line="15" column="1" selection-start-line="15" selection-start-column="1" selection-end-line="15" selection-end-column="1" />
<folding>
<marker date="1563971976383" expanded="true" signature="6:402" ph="..." />
<marker date="1563971976383" expanded="true" signature="512:1600" ph="{...}" />
@ -42,7 +42,7 @@
<entry file="file://$PROJECT_DIR$/Ombi.Core/Engine/Interfaces/IMusicSearchEngineV2.cs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="48">
<caret line="3" column="37" lean-forward="true" selection-start-line="3" selection-start-column="37" selection-end-line="3" selection-end-column="37" />
<caret line="3" column="37" selection-start-line="3" selection-start-column="37" selection-end-line="3" selection-end-column="37" />
<folding>
<marker date="1563971976358" expanded="true" signature="6:69" ph="..." />
<marker date="1563971976358" expanded="true" signature="108:237" ph="{...}" />
@ -99,7 +99,7 @@
<entry file="file://$PROJECT_DIR$/Ombi/Controllers/V2/SearchController.cs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="290">
<caret line="54" column="48" lean-forward="true" selection-start-line="54" selection-start-column="48" selection-end-line="54" selection-end-column="48" />
<caret line="54" column="48" selection-start-line="54" selection-start-column="48" selection-end-line="54" selection-end-column="48" />
<folding>
<marker date="1563972058760" expanded="false" signature="6:492" ph="..." />
<marker date="1563972058760" expanded="true" signature="523:13818" ph="{...}" />
@ -175,7 +175,7 @@
<entry file="file://$PROJECT_DIR$/Ombi.Core/Engine/V2/MultiSearchEngine.cs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="146">
<caret line="47" column="58" lean-forward="true" selection-start-line="47" selection-start-column="58" selection-end-line="47" selection-end-column="58" />
<caret line="47" column="58" selection-start-line="47" selection-start-column="58" selection-end-line="47" selection-end-column="58" />
<folding>
<marker date="1563908151735" expanded="false" signature="6:540" ph="..." />
<marker date="1563908151735" expanded="true" signature="571:3867" ph="{...}" />
@ -216,8 +216,8 @@
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/Ombi.Api.MusicBrainz/MusicBrainzApi.cs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="288">
<caret line="30" column="21" selection-start-line="30" selection-start-column="21" selection-end-line="30" selection-end-column="21" />
<state relative-caret-position="320">
<caret line="32" selection-start-line="32" selection-end-line="32" />
<folding>
<marker date="1563915793306" expanded="false" signature="6:281" ph="..." />
<marker date="1563915793306" expanded="true" signature="313:1888" ph="{...}" />
@ -447,12 +447,12 @@
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1563957157468</updated>
<workItem from="1563957162999" duration="5139000" />
<workItem from="1563957162999" duration="5401000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="5139000" />
<option name="totallyTimeSpent" value="5401000" />
</component>
<component name="TodoView">
<todo-panel id="selected-file">
@ -465,7 +465,6 @@
</component>
<component name="ToolWindowManager">
<frame x="977" y="-1093" width="1936" height="1056" extended-state="6" />
<editor active="true" />
<layout>
<window_info id="Favorites" order="0" side_tool="true" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
@ -481,7 +480,7 @@
<window_info anchor="bottom" id="Message" order="7" />
<window_info anchor="bottom" id="Find" order="8" />
<window_info anchor="bottom" id="Run" order="9" weight="0.32977587" />
<window_info active="true" anchor="bottom" id="Debug" order="10" sideWeight="0.49973363" visible="true" weight="0.29775882" />
<window_info anchor="bottom" id="Debug" order="10" sideWeight="0.49973363" weight="0.29775882" />
<window_info anchor="bottom" id="Cvs" order="11" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="12" weight="0.4" />
<window_info anchor="bottom" id="TODO" order="13" weight="0.32977587" />
@ -850,7 +849,7 @@
<entry file="file://$PROJECT_DIR$/Ombi.Core/Engine/V2/MusicSearchEngineV2.cs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="240">
<caret line="15" column="1" lean-forward="true" selection-start-line="15" selection-start-column="1" selection-end-line="15" selection-end-column="1" />
<caret line="15" column="1" selection-start-line="15" selection-start-column="1" selection-end-line="15" selection-end-column="1" />
<folding>
<marker date="1563971976383" expanded="true" signature="6:402" ph="..." />
<marker date="1563971976383" expanded="true" signature="512:1600" ph="{...}" />
@ -878,7 +877,7 @@
<entry file="file://$PROJECT_DIR$/Ombi.Core/Engine/Interfaces/IMusicSearchEngineV2.cs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="48">
<caret line="3" column="37" lean-forward="true" selection-start-line="3" selection-start-column="37" selection-end-line="3" selection-end-column="37" />
<caret line="3" column="37" selection-start-line="3" selection-start-column="37" selection-end-line="3" selection-end-column="37" />
<folding>
<marker date="1563971976358" expanded="true" signature="6:69" ph="..." />
<marker date="1563971976358" expanded="true" signature="108:237" ph="{...}" />
@ -913,7 +912,7 @@
<entry file="file://$PROJECT_DIR$/Ombi/Controllers/V2/SearchController.cs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="290">
<caret line="54" column="48" lean-forward="true" selection-start-line="54" selection-start-column="48" selection-end-line="54" selection-end-column="48" />
<caret line="54" column="48" selection-start-line="54" selection-start-column="48" selection-end-line="54" selection-end-column="48" />
<folding>
<marker date="1563972058760" expanded="false" signature="6:492" ph="..." />
<marker date="1563972058760" expanded="true" signature="523:13818" ph="{...}" />
@ -985,7 +984,7 @@
<entry file="file://$PROJECT_DIR$/Ombi.Core/Engine/V2/MultiSearchEngine.cs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="146">
<caret line="47" column="58" lean-forward="true" selection-start-line="47" selection-start-column="58" selection-end-line="47" selection-end-column="58" />
<caret line="47" column="58" selection-start-line="47" selection-start-column="58" selection-end-line="47" selection-end-column="58" />
<folding>
<marker date="1563908151735" expanded="false" signature="6:540" ph="..." />
<marker date="1563908151735" expanded="true" signature="571:3867" ph="{...}" />
@ -1022,8 +1021,8 @@
</entry>
<entry file="file://$PROJECT_DIR$/Ombi.Api.MusicBrainz/MusicBrainzApi.cs">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="288">
<caret line="30" column="21" selection-start-line="30" selection-start-column="21" selection-end-line="30" selection-end-column="21" />
<state relative-caret-position="320">
<caret line="32" selection-start-line="32" selection-end-line="32" />
<folding>
<marker date="1563915793306" expanded="false" signature="6:281" ph="..." />
<marker date="1563915793306" expanded="true" signature="313:1888" ph="{...}" />

@ -1,8 +1,6 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Ombi.Api.MusicBrainz.Models.Artist;
using Ombi.Api.MusicBrainz.Models.Browse;
using Ombi.Api.MusicBrainz.Models.Search;
using Hqub.MusicBrainz.API.Entities;
namespace Ombi.Api.MusicBrainz
{
@ -10,6 +8,6 @@ namespace Ombi.Api.MusicBrainz
{
Task<IEnumerable<Artist>> SearchArtist(string artistQuery);
Task<IEnumerable<Release>> GetReleaseForArtist(string artistId);
Task<ArtistInformation> GetArtistInformation(string artistId);
Task<Artist> GetArtistInformation(string artistId);
}
}

@ -1,58 +0,0 @@
using Newtonsoft.Json;
namespace Ombi.Api.MusicBrainz.Models.Artist
{
public class ArtistInformation
{
public Begin_Area begin_area { get; set; }
[JsonProperty("gender-id")]
public object genderid { get; set; }
public string type { get; set; }
[JsonProperty("life-span")]
public LifeSpan lifespan { get; set; }
public string name { get; set; }
[JsonProperty("type-id")]
public string typeid { get; set; }
public object end_area { get; set; }
public object[] ipis { get; set; }
[JsonProperty("sort-name")]
public string sortname { get; set; }
public string[] isnis { get; set; }
public object gender { get; set; }
public string id { get; set; }
public Area area { get; set; }
public string disambiguation { get; set; }
public string country { get; set; }
}
public class Begin_Area
{
public string disambiguation { get; set; }
[JsonProperty("sort-name")]
public string sortname { get; set; }
public string id { get; set; }
public string name { get; set; }
}
public class LifeSpan
{
public bool ended { get; set; }
public string end { get; set; }
public string begin { get; set; }
}
public class Area
{
public string name { get; set; }
[JsonProperty("sort-name")]
public string sortname { get; set; }
public string disambiguation { get; set; }
public string id { get; set; }
[JsonProperty("iso-3166-1-codes")]
public string[] iso31661codes { get; set; }
}
}

@ -1,106 +0,0 @@
using System.Collections.Generic;
using Newtonsoft.Json;
namespace Ombi.Api.MusicBrainz.Models.Browse
{
public class CoverArtArchive
{
public bool back { get; set; }
public bool artwork { get; set; }
public bool darkened { get; set; }
public int count { get; set; }
public bool front { get; set; }
}
public class TextRepresentation
{
public string script { get; set; }
public string language { get; set; }
}
public class Recording
{
public int length { get; set; }
public string disambiguation { get; set; }
public string title { get; set; }
public string id { get; set; }
public bool video { get; set; }
}
public class Track
{
public string title { get; set; }
public Recording recording { get; set; }
public string number { get; set; }
public string id { get; set; }
public int? length { get; set; }
public int position { get; set; }
}
public class Medium
{
[JsonProperty(PropertyName = "track-count")]
public int TrackCount { get; set; }
public string title { get; set; }
[JsonProperty(PropertyName = "track-offset")]
public int TrackOffset { get; set; }
public int position { get; set; }
[JsonProperty(PropertyName = "format-id")]
public string FormatId { get; set; }
public string format { get; set; }
public List<Track> tracks { get; set; }
}
public class Area
{
public string id { get; set; }
[JsonProperty(PropertyName = "sort-name")]
public string SortName { get; set; }
public string disambiguation { get; set; }
public string name { get; set; }
[JsonProperty(PropertyName = "iso-3166-1-codes")]
public List<string> Iso31661Codes { get; set; }
[JsonProperty(PropertyName = "iso-3166-2-codes")]
public List<string> Iso31662Codes { get; set; }
}
public class ReleaseEvent
{
public string date { get; set; }
public Area area { get; set; }
}
public class Release
{
public string quality { get; set; }
public string asin { get; set; }
public string date { get; set; }
public string status { get; set; }
public string barcode { get; set; }
[JsonProperty(PropertyName = "cover-art-archive")]
public CoverArtArchive CoverArtArchive { get; set; }
public string packaging { get; set; }
[JsonProperty(PropertyName = "packaging-id")]
public string PackagingId { get; set; }
[JsonProperty(PropertyName = "status-id")]
public string StatusId { get; set; }
public string disambiguation { get; set; }
public string country { get; set; }
[JsonProperty(PropertyName = "text-representation")]
public TextRepresentation TextRepresentation { get; set; }
public string title { get; set; }
public List<Medium> media { get; set; }
public string id { get; set; }
[JsonProperty(PropertyName = "release-events")]
public List<ReleaseEvent> ReleaseEvents { get; set; }
}
public class ReleaseResult
{
[JsonProperty(PropertyName = "release-count")]
public int ReleaseCount { get; set; }
[JsonProperty(PropertyName = "release-offset")]
public int ReleaseOffset { get; set; }
public List<Release> releases { get; set; }
}
}

@ -1,15 +0,0 @@
using System;
using System.Collections.Generic;
namespace Ombi.Api.MusicBrainz.Models
{
public class MusicBrainzResult<T>
{
public DateTime created { get; set; }
public int count { get; set; }
public int offset { get; set; }
[JsonPropertyNameBasedOnItemClass]
public List<T> Data { get; set; }
}
}

@ -1,83 +0,0 @@
using Newtonsoft.Json;
namespace Ombi.Api.MusicBrainz.Models.Search
{
[JsonPluralName("artists")]
public class Artist
{
public string id { get; set; }
public string type { get; set; }
[JsonProperty(PropertyName = "type-id")]
public string typeid { get; set; }
public int score { get; set; }
public string name { get; set; }
[JsonProperty(PropertyName = "sort-name")]
public string sortname { get; set; }
public string country { get; set; }
public Area area { get; set; }
[JsonProperty(PropertyName = "begin-area")]
public BeginArea beginarea { get; set; }
[JsonProperty(PropertyName = "life-span")]
public LifeSpan2 lifespan { get; set; }
public Tag[] tags { get; set; }
[JsonProperty(PropertyName = "isni-list")]
public IsniList[] isnilist { get; set; }
public string disambiguation { get; set; }
}
public class Area
{
public string id { get; set; }
public string type { get; set; }
[JsonProperty(PropertyName = "type-id")]
public string typeid { get; set; }
public string name { get; set; }
[JsonProperty(PropertyName = "sort-name")]
public string sortname { get; set; }
[JsonProperty(PropertyName = "life-span")]
public LifeSpan lifespan { get; set; }
}
public class LifeSpan
{
public object ended { get; set; }
}
public class BeginArea
{
public string id { get; set; }
public string type { get; set; }
[JsonProperty(PropertyName = "type-id")]
public string typeid { get; set; }
public string name { get; set; }
[JsonProperty(PropertyName = "sort-name")]
public string sortname { get; set; }
[JsonProperty(PropertyName = "life-span")]
public LifeSpan1 lifespan { get; set; }
}
public class LifeSpan1
{
public object ended { get; set; }
}
public class LifeSpan2
{
public string begin { get; set; }
public object ended { get; set; }
}
public class Tag
{
public int count { get; set; }
public string name { get; set; }
}
public class IsniList
{
public string isni { get; set; }
}
}

@ -3,52 +3,39 @@ using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
using Ombi.Api.MusicBrainz.Models;
using Ombi.Api.MusicBrainz.Models.Artist;
using Ombi.Api.MusicBrainz.Models.Browse;
using Ombi.Api.MusicBrainz.Models.Search;
using Hqub.MusicBrainz.API;
using Hqub.MusicBrainz.API.Entities;
namespace Ombi.Api.MusicBrainz
{
public class MusicBrainzApi : IMusicBrainzApi
{
public MusicBrainzApi(IApi api)
{
_api = api;
}
private readonly IApi _api;
private const string _baseUrl = "https://musicbrainz.org/ws/2/";
public async Task<IEnumerable<Artist>> SearchArtist(string artistQuery)
{
var request = new Request("artist", _baseUrl, HttpMethod.Get);
request.AddQueryString("query", artistQuery);
AddHeaders(request);
var albums = await _api.Request<MusicBrainzResult<Artist>>(request);
return albums.Data.Where(x => !x.type.Equals("Person", StringComparison.CurrentCultureIgnoreCase));
var artist = await Hqub.MusicBrainz.API.Entities.Artist.SearchAsync(artistQuery, 10);
return artist.Items.Where(x => !x.Type.Equals("Person", StringComparison.CurrentCultureIgnoreCase));
}
public async Task<ArtistInformation> GetArtistInformation(string artistId)
public async Task<Artist> GetArtistInformation(string artistId)
{
var request = new Request($"artist/{artistId}", _baseUrl, HttpMethod.Get);
AddHeaders(request);
return await _api.Request<ArtistInformation>(request);
var artist = await Artist.GetAsync(artistId, "artist-rels", "url-rels", "releases", "release-groups");
return artist;
}
public async Task<IEnumerable<Release>> GetReleaseForArtist(string artistId)
{
var request = new Request("release", _baseUrl, HttpMethod.Get);
// Build an advanced query to search for the release.
var query = new QueryParameters<Release>()
{
{ "arid", artistId },
{ "status", "official" }
};
// Search for a release by title.
var releases = await Release.SearchAsync(query);
request.AddQueryString("artist", artistId);
request.AddQueryString("inc", "recordings");
AddHeaders(request);
var releases = await _api.Request<ReleaseResult>(request);
return releases.releases;
return releases.Items;
}
private void AddHeaders(Request req)

@ -4,6 +4,10 @@
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="MusicBrainzAPI" Version="2.0.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Ombi.Api\Ombi.Api.csproj" />
</ItemGroup>

@ -51,8 +51,8 @@ namespace Ombi.Core.Engine.V2
model.Add(new MultiSearchResult
{
MediaType = "Artist",
Title = artist.name,
Id = artist.id
Title = artist.Name,
Id = artist.Id
});
}
}

@ -1,3 +1,4 @@
using System.Collections.Generic;
using System.Security.Principal;
using System.Threading.Tasks;
using Ombi.Api.MusicBrainz;
@ -30,16 +31,31 @@ namespace Ombi.Core.Engine.V2
{
var artist = await _musicBrainzApi.GetArtistInformation(artistId);
return new ArtistInformation{
var info = 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?? "",
Name = artist.Name,
Country = artist.Country,
Region = artist.Area?.Name,
Type = artist.Type,
StartYear = artist.LifeSpan?.Begin ?? "",
EndYear = artist.LifeSpan?.End?? "",
Disambiguation = artist.Disambiguation,
ReleaseGroups = new List<ReleaseGroup>()
};
// TODO FINISH MAPPING
foreach (var g in artist.ReleaseGroups)
{
info.ReleaseGroups.Add(new ReleaseGroup
{
Type = g.PrimaryType,
Id = g.Id,
Title = g.Title,
ReleaseDate = g.FirstReleaseDate
});
}
return info;
}
}
}

@ -1,3 +1,5 @@
using System.Collections.Generic;
namespace Ombi.Core.Models.Search.V2.Music
{
public class ArtistInformation
@ -9,5 +11,30 @@ namespace Ombi.Core.Models.Search.V2.Music
public string Type { get; set; }
public string Country { get; set; }
public string Region { get; set; }
public string Disambiguation { get; set; }
public List<ReleaseGroup> ReleaseGroups { get; set; }
public List<ArtistLinks> Links { get; set; }
}
public class ArtistLinks
{
public string Image { get; set; }
public string Imdb { get; set; }
public string LastFm { get; set; }
public string Discogs { get; set; }
public string BandsInTown { get; set; }
public string Website { get; set; }
public string YouTube { get; set; }
public string Facebook { get; set; }
public string Twitter { get; set; }
}
public class ReleaseGroup
{
public string Id { get; set; }
public string Title { get; set; }
public string ReleaseDate { get; set; }
public string Type { get; set; }
}
}

@ -14,6 +14,7 @@
<PackageReference Include="Hangfire" Version="1.7.0" />
<PackageReference Include="Microsoft.AspNetCore.Cryptography.KeyDerivation" Version="2.2.0" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="2.2.4" />
<PackageReference Include="MusicBrainzAPI" Version="2.0.1" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.2" />
<PackageReference Include="System.Diagnostics.Process" Version="4.3.0" />
</ItemGroup>

@ -0,0 +1,9 @@
export interface IArtistSearchResult {
name: string;
id: string;
startYear: string;
endYear: string;
type: string;
country: string;
region: string;
}

@ -1,11 +1,10 @@
<div *ngIf="!movie" class="justify-content-md-center top-spacing loading-spinner">
<div *ngIf="!artist" class="justify-content-md-center top-spacing loading-spinner">
<mat-spinner [color]="'accent'"></mat-spinner>
</div>
<div *ngIf="movie" class="dark-theme">
<div *ngIf="artist" class="dark-theme">
<top-banner [background]="movie.background" [available]="movie.available" [title]="movie.title"
[releaseDate]="movie.releaseDate" [tagline]="movie.tagline"></top-banner>
<top-banner [title]="artist.name"></top-banner>
<section id="info-wrapper">
<div class="small-middle-container">

@ -1,28 +1,25 @@
import { Component, ViewEncapsulation } from "@angular/core";
import { Component } from "@angular/core";
import { ImageService, SearchV2Service, RequestService, MessageService } from "../../../services";
import { ActivatedRoute } from "@angular/router";
import { DomSanitizer } from "@angular/platform-browser";
import { ISearchMovieResultV2 } from "../../../interfaces/ISearchMovieResultV2";
import { MatDialog } from "@angular/material";
import { YoutubeTrailerComponent } from "../shared/youtube-trailer.component";
import { AuthService } from "../../../auth/auth.service";
import { IMovieRequests, RequestType, IAdvancedData } from "../../../interfaces";
import { DenyDialogComponent } from "../shared/deny-dialog/deny-dialog.component";
import { NewIssueComponent } from "../shared/new-issue/new-issue.component";
import { IArtistSearchResult } from "../../../interfaces/IMusicSearchResultV2";
@Component({
templateUrl: "./artist-details.component.html",
styleUrls: ["../../media-details.component.scss"],
})
export class ArtistDetailsComponent {
public movie: ISearchMovieResultV2;
public hasRequest: boolean;
public movieRequest: IMovieRequests;
public isAdmin: boolean;
public advancedOptions: IAdvancedData;
private artistId: string;
public artist: IArtistSearchResult;
public isAdmin: boolean;
constructor(private searchService: SearchV2Service, private route: ActivatedRoute,
private sanitizer: DomSanitizer, private imageService: ImageService,
public dialog: MatDialog, private requestService: RequestService,
@ -34,22 +31,8 @@ export class ArtistDetailsComponent {
}
public load() {
this.isAdmin = this.auth.hasRole("admin") || this.auth.hasRole("poweruser");
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 + ")");
// });
// });
this.searchService.getArtistInformation(this.artistId).subscribe(x => this.artist = x);
}
public async request() {
@ -65,52 +48,52 @@ export class ArtistDetailsComponent {
public openDialog() {
this.dialog.open(YoutubeTrailerComponent, {
width: '560px',
data: this.movie.videos.results[0].key
// data: this.movie.videos.results[0].key
});
}
public async deny() {
const dialogRef = this.dialog.open(DenyDialogComponent, {
width: '250px',
data: {requestId: this.movieRequest.id, requestType: RequestType.movie}
// data: {requestId: this.movieRequest.id, requestType: RequestType.movie}
});
dialogRef.afterClosed().subscribe(result => {
this.movieRequest.denied = result;
if(this.movieRequest.denied) {
this.movie.approved = false;
}
// this.movieRequest.denied = result;
// if(this.movieRequest.denied) {
// this.movie.approved = false;
// }
});
}
public async issue() {
const dialogRef = this.dialog.open(NewIssueComponent, {
width: '500px',
data: {requestId: this.movieRequest ? this.movieRequest.id : null, requestType: RequestType.movie, imdbid: this.movie.imdbId}
// data: {requestId: this.movieRequest ? this.movieRequest.id : null, requestType: RequestType.movie, imdbid: this.movie.imdbId}
});
}
public async approve() {
const result = await this.requestService.approveMovie({ id: this.movieRequest.id }).toPromise();
if (result.result) {
this.movie.approved = false;
this.messageService.send("Successfully Approved", "Ok");
} else {
this.messageService.send(result.errorMessage, "Ok");
}
// const result = await this.requestService.approveMovie({ id: this.movieRequest.id }).toPromise();
// if (result.result) {
// this.movie.approved = false;
// this.messageService.send("Successfully Approved", "Ok");
// } else {
// this.messageService.send(result.errorMessage, "Ok");
// }
}
public async markAvailable() {
const result = await this.requestService.markMovieAvailable({id: this.movieRequest.id}).toPromise();
if (result.result) {
this.movie.available = true;
this.messageService.send(result.message, "Ok");
} else {
this.messageService.send(result.errorMessage, "Ok");
}
// const result = await this.requestService.markMovieAvailable({id: this.movieRequest.id}).toPromise();
// if (result.result) {
// // this.movie.available = true;
// this.messageService.send(result.message, "Ok");
// } else {
// this.messageService.send(result.errorMessage, "Ok");
// }
}
public setAdvancedOptions(data: any) {
this.advancedOptions = data;
// this.advancedOptions = data;
}
}

@ -9,6 +9,7 @@ import { ServiceHelpers } from "./service.helpers";
import { ISearchMovieResultV2 } from "../interfaces/ISearchMovieResultV2";
import { ISearchTvResultV2, IMovieCollectionsViewModel, IActorCredits } from "../interfaces/ISearchTvResultV2";
import { IArtistSearchResult } from "../interfaces/IMusicSearchResultV2";
@Injectable()
export class SearchV2Service extends ServiceHelpers {
@ -99,7 +100,7 @@ export class SearchV2Service extends ServiceHelpers {
return this.http.get<IActorCredits>(`${this.url}/actor/${actorId}/movie`, { headers: this.headers });
}
public getArtistInformation(artistId: string): Observable<any> {
return this.http.get<any>(`${this.url}/artist/${artistId}`);
public getArtistInformation(artistId: string): Observable<IArtistSearchResult> {
return this.http.get<IArtistSearchResult>(`${this.url}/artist/${artistId}`);
}
}

@ -5,8 +5,6 @@ using Microsoft.AspNetCore.Http;
using System.Threading.Tasks;
using System.Collections.Generic;
using Ombi.Api.MusicBrainz;
using Ombi.Api.MusicBrainz.Models.Search;
using Ombi.Core;
using Ombi.Api.TheMovieDb.Models;
using Ombi.Core.Engine.V2;

Loading…
Cancel
Save