From cdd995652b1cfb0e2ca92f027fee73cd7041f19e Mon Sep 17 00:00:00 2001 From: tidusjar Date: Wed, 1 Feb 2017 21:19:42 +0000 Subject: [PATCH 1/2] Fixed #1038 --- Ombi.UI/Modules/RequestsModule.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ombi.UI/Modules/RequestsModule.cs b/Ombi.UI/Modules/RequestsModule.cs index 699b19b67..08d6d81ce 100644 --- a/Ombi.UI/Modules/RequestsModule.cs +++ b/Ombi.UI/Modules/RequestsModule.cs @@ -254,7 +254,7 @@ namespace Ombi.UI.Modules Status = tv.Status, ImdbId = tv.ImdbId, Id = tv.Id, - PosterPath = tv.PosterPath.Contains("http:") ? tv.PosterPath.Replace("http:", "https:") : tv.PosterPath, // We make the poster path https on request, but this is just incase + PosterPath = tv.PosterPath?.Contains("http:") ?? false ? tv.PosterPath?.Replace("http:", "https:") : tv.PosterPath ?? string.Empty, // We make the poster path https on request, but this is just incase ReleaseDate = tv.ReleaseDate, ReleaseDateTicks = tv.ReleaseDate.Ticks, RequestedDate = tv.RequestedDate, From 21788818951fc8e2084a378797baa08e82cc7997 Mon Sep 17 00:00:00 2001 From: smcpeck Date: Fri, 24 Feb 2017 16:14:16 -0600 Subject: [PATCH 2/2] Headphones - added releaseID to generic RequestedModel and passing that through to HP request. Their API doesn't request via the MusicBrainzId. --- Ombi.Core/HeadphonesSender.cs | 2 +- Ombi.Store/RequestedModel.cs | 2 ++ Ombi.UI/Modules/SearchModule.cs | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Ombi.Core/HeadphonesSender.cs b/Ombi.Core/HeadphonesSender.cs index f3dab3850..043ea4e2a 100644 --- a/Ombi.Core/HeadphonesSender.cs +++ b/Ombi.Core/HeadphonesSender.cs @@ -62,7 +62,7 @@ namespace Ombi.Core // Artist is now active // Add album - var albumResult = await Api.AddAlbum(Settings.ApiKey, Settings.FullUri, request.MusicBrainzId); + var albumResult = await Api.AddAlbum(Settings.ApiKey, Settings.FullUri, request.ReleaseId); if (!albumResult) { Log.Error("Couldn't add the album to headphones"); diff --git a/Ombi.Store/RequestedModel.cs b/Ombi.Store/RequestedModel.cs index c54d68e5c..c2130d277 100644 --- a/Ombi.Store/RequestedModel.cs +++ b/Ombi.Store/RequestedModel.cs @@ -68,6 +68,8 @@ namespace Ombi.Store [JsonIgnore] public bool CanApprove => !Approved && !Available; + public string ReleaseId { get; set; } + public bool UserHasRequested(string username) { return AllUsers.Any(x => x.Equals(username, StringComparison.OrdinalIgnoreCase)); diff --git a/Ombi.UI/Modules/SearchModule.cs b/Ombi.UI/Modules/SearchModule.cs index 76fc5fb62..3be96d360 100644 --- a/Ombi.UI/Modules/SearchModule.cs +++ b/Ombi.UI/Modules/SearchModule.cs @@ -1412,6 +1412,7 @@ namespace Ombi.UI.Modules { Title = albumInfo.title, MusicBrainzId = albumInfo.id, + ReleaseId = releaseId, Overview = albumInfo.disambiguation, PosterPath = img, Type = RequestType.Album,