You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Ombi/src/Ombi.Api.Plex/PlexApi.cs

373 lines
15 KiB

using System;
Update (#4871) * Remove dead code * Localize TV requests messages on TV details page * Transform buttons with link into anchors * Sonarr sync: stop using seasonpass API * chore(release): :rocket: v4.16.13 * Fix requests when 4k available and 4k disabled Fixes #4610 * chore(release): :rocket: v4.16.14 * Hide subscribe button when request is available * Hide subscribe button when request is denied * Add Title to Partially Available Message If the Title of the show is not menitoned it can be unclear what Episodes are now available. * Better error message when test email fails due to missing recipient * feat(discover): Add original language filter * chore(release): :rocket: v4.16.15 * fix(4616): :bug: fixed mandatory fields * chore: :busts_in_silhouette: Updated Contributors [skip ci] * chore(release): :rocket: v4.16.16 * added test results into the PR pipeline * chore(release): :rocket: v4.16.17 * Add information about cache refresh * Update pr.yml [skip ci] * Update pr.yml [skip ci] * Update pr.yml [skip ci] * chore(release): :rocket: v4.17.0 * feat(discover): Add new trending source experimental feature * fix(settings): Allow toggling features when there are more than one * fix(discover): Fix new trending feature detection * fix(discover): Fix cache mix up * refactor(discover): Move movie trending feature toggle to backend * feat(discover): Default trending source to new logic * chore(release): :rocket: v4.18.0 * feat(sync): Detect reidentified movies in Emby and Jellyfin * feat(sync): Detect reidentified series in Emby and Jellyfin * Fix sync log criticity * Update pr.yml [skip ci] * Update label.yml [skip ci] * Fix formatting * Update pr.yml [skip ci] * Update label.yml [skip ci] * chore: :busts_in_silhouette: Updated Contributors [skip ci] * chore(release): :rocket: v4.19.0 * refactor(newsletter): Clarify very rare cases where newsletter doesn't publish a series * refactor(newsletter): Clarify very rare cases where newsletter doesn't publish movie * chore(release): :rocket: v4.19.1 * feat(discover): Show more relevant shows in upcoming TV * chore(release): :rocket: v4.20.0 * fix(sync): Emby+Jellyfin - sync multi-episode files of 3+ episodes * perf(sync): Emby+Jellyfin - use a more reliable filter to missing items * fix(sync): Emby+Jellyfin - sync multi-episode files of 3+ episodes [skip ci] * fix: added media type tag to media type text (#4638) [skip ci] * fix(sickrage): Fixed issue with incorrect handling of SiCKRAGE episode results returned during episode status changes, now expects array of objects from data path if present (#4648) [skip ci] * fix: Missing Poster broken link fix (#4637) [skip ci] * 🌐 Translations Update (#4622) [skip ci] * Update launch.json (#4650) [skip ci] * fix: Improve Swagger documentation (#4652) * Upgrade Swashbuckle dependency * Document /token response * Add support for Newtonsoft annotations in Swagger * Remove unecessary ActionResult [skip ci] * fix(API): Fix pagination in some edge cases (#4649) [skip ci] * 🌐 Translations Update (#4655) * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(discover): Carousel touch not working when scrolling page and recommendations and similar movie navigation (#4633) * fixed touch not working on carousels * fixed touch not working * Movie details component fixes Fixed recommendations and similar not changing the data on the component by calling the init function again on param change Moved the ngif results > 0 to the mat-expansion panel to avoid rendering the entire element if it doesn't have any results instead of having an empty panel. * removed unused line, added scroll to top on init * updated recommendation refresh implementation Changed the implementation to use the router instead in order to reload the component instead of just reloading the data. This implementation makes sure the component gets destroyed on navigation eliminating any memory leaks, reloading CSS in case of having animations on page load and generally a continuation of the experience you get when you browse into a movie from the discover page. * chore: :busts_in_silhouette: Updated Contributors [skip ci] * chore(release): :rocket: v4.20.1 [skip ci] * fix: :bug: Fixed the Request on Behalf of having blanks (#4667) * chore(release): :rocket: v4.20.2 [skip ci] * fix(plex): 🐛 Fixed an issue with the Plex Sync * chore(release): :rocket: v4.20.3 [skip ci] * fix (technical): Improved some of the date time parsing handling * fix: fixed build * chore(release): :rocket: v4.20.4 [skip ci] * feat: Upgrade to Angular14 (#4668) * refactor: :fire: removed angular-bootstrap-md dependancy * chore: update tsconfig * yeah * ng14 upgrade * refactor: migration changes * fix: fixed CLI * test: Fixed automation * chore: :busts_in_silhouette: Updated Contributors [skip ci] * perf: stop populating obsolete subscribe fields (#4625) * chore(release): :rocket: v4.21.0 [skip ci] * fix(images): Retry images with a backoff when we get a Too Many requests from TheMovieDb #4685 * chore(release): :rocket: v4.21.1 [skip ci] * 🌐 Translations Update (#4683) * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix: Landing and Login page improvements (#4690) * chore(release): :rocket: v4.21.2 [skip ci] * feat(discover): ✨ Added infinite scroll on advanced search results * feat(discover): :sparkles: Added infinite scroll on advanced search results * chore(release): :rocket: v4.22.0 [skip ci] * 🌐 Translations Update (#4694) * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(discover): :bug: Created new Image component to handle 429's from TMDB (#4698) and fixed #4635 (#4699) * chore(release): :rocket: v4.22.1 [skip ci] * fix: fixed an issue where I broke images for some users * chore(release): :rocket: v4.22.2 [skip ci] * ci(Mergify): configuration update (#4701) Signed-off-by: Jamie <tidusjar@gmail.com> [skip ci] * fix: Override Sonarr V3 Profiles endpoint (#4678) * Override Sonarr V3 Profiles endpoint [skip ci] * fix(4K) :4K request fixes (#4702) * GetRequestsByStatus wasn't implementing the MovieRequests object correctly for 4K quality requests with the ProcessingRequest status. * Fixed 4K requests not getting automatically approved if the user has the "Auto Approve Movie" role flag enabled. * Fixed "Request Date" values for the "left-panel-details" div class. Previously when the movie was exclusively 4K (regular request was absent), then "Request Date" equaled DateTime.MinValue (January 1, 0001). * Fixed "Request Status" evaluation in the "left-panel-details" div class. Now it shows the appropriate status instead of an empty spot. "Request Status" displays both regular and 4K statuses at the same time if needed. Added a comma to the end of the "RequestStatus" label to maintain design consistency with the other labels. Also added a "Denied Reason" element for 4K requests. * chore: :busts_in_silhouette: Updated Contributors [skip ci] * chore(release): :rocket: v4.22.3 [skip ci] * chore: Storybook (#4700) [skip ci] * chore: Translations [skip ci] * 🌐 Translations Update (#4704) * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] (#4713) * build: Run automation tests in docker (#4715) [skip ci] * fix: fixed trakt image not loading when base url present (#4711) [skip ci] * fix: :bug: Fixed missing externals (#4712) * chore: :busts_in_silhouette: Updated Contributors [skip ci] * chore(release): :rocket: v4.22.4 [skip ci] * test: fixed automationt tests [skip ci] * fix: Log Microsoft warnings to log file (#4723) [skip ci] * feat: ✨ Recently Requested on Discover Page (#4387) * chore(release): :rocket: v4.23.0 [skip ci] * fix: Localize recently requested on discover page (#4729) [skip ci] * 🌐 Translations Update (#4731) * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * Fix: Ombi.Api.Lidarr: Remove unused fields from ArtistAdd (#4727) When an artist is not found in Lidarr as part of requesting an album, MusicSender will make a POST request against the /api/v1/artist endpoint to add such artist. Not all fields defined in ArtistAdd are initialized, and those uninitialized will be `null` values in the JSON body of the request, as shown in this intercepted request: ``` { "addOptions": { "AlbumsToMonitor": [ "e5c48b66-44ef-3685-ad53-45dbcd7294c0" ], "monitor": 6, "monitored": true, "searchForMissingAlbums": false }, "added": "2022-08-10T06:49:32.4374278+00:00", "albumFolder": true, "artistName": "Manolo García", "cleanName": "manologarcía", "disambiguation": null, "discogsId": 0, "ended": false, "foreignArtistId": "1c8309da-9789-40bf-b9c2-e20064263820", "images": [], "links": [], "metadataProfileId": 1, "monitored": true, "overview": null, "qualityProfileId": 3, "ratings": null, "remotePoster": null, "rootFolderPath": "/media/music/", "sortName": null, "statistics": null, "status": null, "tadbId": 0, "tags": null } ``` This request will fail and Lidarr will return a 400 BadRequest error with the following message: ``` 2022-08-10 01:45:52.458 +00:00 [Error] StatusCode: BadRequest, Reason: Bad Request, RequestUri: http://lidarr:8686/api/v1/artist 2022-08-10 01:45:52.459 +00:00 [Debug] { "type": "https://tools.ietf.org/html/rfc7231#section-6.5.1", "title": "One or more validation errors occurred.", "status": 400, "traceId": "00-52e01b322a05d7c6633eca2488ef2a5c-06345b3bb8c4bb6c-00", "errors": { "$.status": [ "The JSON value could not be converted to NzbDrone.Core.Music.ArtistStatusType. Path: $.status | LineNumber: 0 | BytePositionInLine: 14." ] } } ``` Removing all the `null` fields from the JSON body fixes the problem and correctly adds the artist to Lidarr. * chore: :busts_in_silhouette: Updated Contributors [skip ci] * chore(release): :rocket: v4.23.1 [skip ci] * fix: Fix conflicting property name for Swagger (#4733) * chore(release): :rocket: v4.23.2 [skip ci] * feat: add crew on movie page (#4722) * add crew on movie page * order by director, add default image and fix click Co-authored-by: tidusjar <tidusjar@gmail.com> * 🌐 Translations Update (#4736) * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * chore(release): :rocket: v4.24.0 [skip ci] * feat: Watchlist history errors(#4741) [skip ci] * fix: fixed stats controller (#4742) * chore: :busts_in_silhouette: Updated Contributors [skip ci] * chore(release): :rocket: v4.25.0 [skip ci] * fix(webhook): Remove added trailing slash from webhook URL #4710 * chore(release): :rocket: v4.25.1 [skip ci] * feat(notifications): Add more curly variables for partially available notification * feat: Add more curly variables for partially available notification * test: Fix newly added test * chore(release): :rocket: v4.26.0 [skip ci] * feat: Recently requested improvements (#4755) * feat(discover): :sparkles: Admins can now approve the Recently Requested list * feat(discover): :zap: Images for the recently requested area are now loading faster and just better all around * test: :white_check_mark: Added automation for the new feature * chore(release): :rocket: v4.27.0 [skip ci] * fix(plex): stop the plex sync from deleting episodes when we can't find the plex key * chore(release): :rocket: v4.27.1 [skip ci] * refactor: Encapsulate common TV availability checker logic (#4753) [skip ci] * fix(sonarr): :bug: Cleaned up and removed Sonarr v3 option, sonarr v3 is now the default. This allows us to get ready for the upcoming Sonarr v4 (#4764) * chore(release): :rocket: v4.27.2 [skip ci] * 🌐 Translations Update (#4739) * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(availability): 🐛 Fixed a issue with the availability checker after the previous update. Added full test coverage around that area * chore(release): :rocket: v4.27.3 [skip ci] * test: 🧪 added full test coverage to the plex availability checker, also fixed a small few bugs in there at the same time * chore(release): :rocket: v4.27.4 [skip ci] * fix(importer): 🐛 Allow you to only import Plex Admins without the Plex Users * chore(release): :rocket: v4.27.5 [skip ci] * fix(notifications): Fixed the error when sending multiple test notifications. Added more logging when Discord complains the message is invalid * chore(release): :rocket: v4.27.6 [skip ci] * fix: Fixes default image for recently requested items. (#4767) * chore(release): :rocket: v4.27.7 [skip ci] * refactor: Upgrades nuget packages. Removes deprecated packages. Fixes build warnings. (#4769) * Upgrades nuget packages. Removes deprecated packages. Fixes build warnings. * Fixes the last few build warnings. * chore(release): :rocket: v4.27.8 [skip ci] * refactor: Rework the Plex Settings Page (#4772) [skip ci] * feat(plex): ✨ Added the ability to configure the watchlist to request the whole TV show rather than latest season (#4774) * chore(release): :rocket: v4.28.0 [skip ci] * 🌐 Translations Update (#4771) * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * 🌐 Translations Update (#4775) * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix: Reworked the version check (#4719) (#4781) [skip ci] * fix(plex): :bug: Fixed not being able to enable watchlist requests in the Plex settings * chore: :busts_in_silhouette: Updated Contributors [skip ci] * chore(release): :rocket: v4.28.1 [skip ci] * feat: Provide a flag for missing users on Plex Server (#4688) (#4778) [skip ci] * fix: Unable to Delete Jellyfin Server (#4705) (#4780) [skip ci] * fix: Partially Available prevents further TV requests (#4768) (#4779) * chore: :busts_in_silhouette: Updated Contributors [skip ci] * chore(release): :rocket: v4.29.0 [skip ci] * fix: Consistently reset loading flag when requesting movies on discover page. (#4777) [skip ci] * fix(sonarr): :bug: Fixed an issue where the language list didn't correctly load for power users in the advanced options #4782 * chore(release): :rocket: v4.29.1 [skip ci] * fix(plex): Fixed an issue where sometimes the availability checker would throw an exception when checking episodes * chore: fixed tests * chore(release): :rocket: v4.29.2 [skip ci] * fix: Only log error messages from Microsoft (#4787) [skip ci] * 🌐 Translations Update (#4784) * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(notifications): Fixed the Partially TV notifications going to the admin #4797 (#4799) * chore(release): :rocket: v4.29.3 [skip ci] * feat(sonarr): :sparkles: Add the username to a Sonarr tag when sent to Sonarr (#4802) * chore(release): :rocket: v4.30.0 [skip ci] * feat(sonarr): Added the ability to add default tags when sending to Sonarr (#4803) * chore(release): :rocket: v4.31.0 [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] (#4801) * feat(plex): Rework the Plex Settings page (#4805) * chore(release): :rocket: v4.32.0 [skip ci] * fix(plex): :bug: Fixed the issue where you couldn't add a new server on a fresh setup after the settings page rework * chore(release): :rocket: v4.32.1 [skip ci] * fix(sonarr): :bug: Sonarr V4 should work now (#4810) * fix(sonarr): :bug: Sonarr V4 should work now Auto detect the sonarr version and adjust the UI depending on V3 or V4 (Lang profiles) * fix: Fixed the load error * chore(release): :rocket: v4.32.2 [skip ci] * fix(sonarr): V4 actually works this time around * chore(release): :rocket: v4.32.3 [skip ci] * feat: Angular 15 and Dependency upgrades (#4818) * chore(release): :rocket: v4.33.0 [skip ci] * fix(plex): Added the watchlist request whole show back into the settings * chore: undid * fixed (#4833) * chore(release): :rocket: v4.33.1 [skip ci] * chore: add logo [skip ci] * feat: Radarr tags (#4815) * chore(release): :rocket: v4.34.0 [skip ci] * fix(plex-watchlist): Lookup the ID from different sources when Plex doesn't contain the metadata (#4843) * chore(release): :rocket: v4.34.1 [skip ci] * feat: Add the option for header authentication to create users (#4841) * feat: allow SSO to create new users automatically * feat: apply default user settings to SSO users * feat: add warnings to header auth toggles * chore(release): :rocket: v4.35.0 [skip ci] * fix(plex-watchlist): Index out of bounds error * chore: :busts_in_silhouette: Updated Contributors [skip ci] * chore(release): :rocket: v4.35.1 [skip ci] * fix(database): Just some tweaks, shouldn't notice any difference, maybe a less error in the log * chore(release): :rocket: v4.35.2 [skip ci] * fix(#4847): Invalid Discord request fixed, also fixed an issue where App Only users would not show as logged in on the user management page (#4848) * chore(release): :rocket: v4.35.3 [skip ci] * bug(#4854): 🐛 Fixed the Recently Requested showing requests when it should be hidden * fix(discover): :bug: Fixed the default poster not taking into account the base url in some scenarios #4845 * fix(Hide music from navbar and request list when not enabled): :bug: * chore: :busts_in_silhouette: Updated Contributors [skip ci] * chore(release): :rocket: v4.35.4 [skip ci] * fix(radarr-settings): 🐛 Fixed a typo * chore(release): :rocket: v4.35.5 [skip ci] * fix: Fixed the issue where the login page is still present after logging in with oauth * chore(release): :rocket: v4.35.6 [skip ci] * fix(wizard): :bug: Stop access to the wizard when you have already setup ombi (#4866) * chore(release): :rocket: v4.35.7 [skip ci] * fix(plex-oauth): 🐛 Fixed an issue where using OAuth you could log in as a Ombi Local user #4835 * chore(release): :rocket: v4.35.8 [skip ci] * chore: :busts_in_silhouette: Updated Contributors [skip ci] * fixed bad merge * chore(release): :rocket: v4.35.9 [skip ci] * Update .gitignore * Fixed automation --------- Signed-off-by: Jamie <tidusjar@gmail.com> [skip ci] Co-authored-by: sephrat <34862846+sephrat@users.noreply.github.com> Co-authored-by: Conventional Changelog Action <conventional.changelog.action@github.com> Co-authored-by: Teifun2 <Teifun2@users.noreply.github.com> Co-authored-by: contrib-readme-bot <contrib-readme-action@noreply.com> Co-authored-by: dr3amer <91037083+dr3am37@users.noreply.github.com> Co-authored-by: echel0n <echel0n@sickrage.ca> Co-authored-by: Marley <55280588+marleypowell@users.noreply.github.com> Co-authored-by: Igor Borges <igor@borges.dev> Co-authored-by: Lucane <Lucane@users.noreply.github.com> Co-authored-by: mkgeeky <github@mkgeeky.xyz> Co-authored-by: Miguel A Vico Moya <mvicomoya@gmail.com> Co-authored-by: Hadrien <26697460+ketsapiwiq@users.noreply.github.com> Co-authored-by: Victor Usoltsev <bernarden@users.noreply.github.com> Co-authored-by: Wesley King <kingwe92@gmail.com> Co-authored-by: Lea <me@janderedev.xyz>
1 year ago
using System.Net;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
using Newtonsoft.Json;
using Ombi.Api.Plex.Models;
using Ombi.Api.Plex.Models.Friends;
using Ombi.Api.Plex.Models.OAuth;
using Ombi.Api.Plex.Models.Server;
using Ombi.Api.Plex.Models.Status;
using Ombi.Core.Settings;
using Ombi.Core.Settings.Models.External;
using Ombi.Helpers;
using Ombi.Settings.Settings.Models;
namespace Ombi.Api.Plex
{
public class PlexApi : IPlexApi
{
public PlexApi(IApi api, ISettingsService<CustomizationSettings> settings, ISettingsService<PlexSettings> p)
{
Api = api;
_custom = settings;
_plexSettings = p;
}
private IApi Api { get; }
private readonly ISettingsService<CustomizationSettings> _custom;
private readonly ISettingsService<PlexSettings> _plexSettings;
private string _app;
private string ApplicationName
{
get
{
if (string.IsNullOrEmpty(_app))
{
var settings = _custom.GetSettings();
if (settings.ApplicationName.IsNullOrEmpty())
{
_app = "Ombi";
}
else
{
6 years ago
// Check for non-ascii characters (New .Net Core HTTPLib does not allow this)
var chars = settings.ApplicationName.ToCharArray();
var hasNonAscii = false;
foreach (var c in chars)
{
if (c > 128)
{
hasNonAscii = true;
}
}
_app = hasNonAscii ? "Ombi" : settings.ApplicationName;
}
return _app;
}
return _app;
}
}
private const string SignInUri = "https://plex.tv/users/sign_in.json";
private const string FriendsUri = "https://plex.tv/pms/friends/all";
private const string GetAccountUri = "https://plex.tv/users/account.json";
private const string ServerUri = "https://plex.tv/pms/servers.xml";
private const string WatchlistUri = "https://metadata.provider.plex.tv/";
/// <summary>
/// Sign into the Plex API
/// This is for authenticating users credentials with Plex
/// <para>NOTE: Plex "Managed" users do not work</para>
/// </summary>
/// <param name="user"></param>
/// <returns></returns>
public async Task<PlexAuthentication> SignIn(UserRequest user)
{
var userModel = new PlexUserRequest
{
user = user
};
var request = new Request(SignInUri, string.Empty, HttpMethod.Post);
await AddHeaders(request);
request.AddJsonBody(userModel);
var obj = await Api.Request<PlexAuthentication>(request);
return obj;
}
public async Task<PlexStatus> GetStatus(string authToken, string uri)
{
var request = new Request(uri, string.Empty, HttpMethod.Get);
await AddHeaders(request, authToken);
return await Api.Request<PlexStatus>(request);
}
public async Task<PlexAccount> GetAccount(string authToken)
{
var request = new Request(GetAccountUri, string.Empty, HttpMethod.Get);
await AddHeaders(request, authToken);
return await Api.Request<PlexAccount>(request);
}
public async Task<PlexServer> GetServer(string authToken)
{
var request = new Request(ServerUri, string.Empty, HttpMethod.Get, ContentType.Xml);
await AddHeaders(request, authToken);
return await Api.Request<PlexServer>(request);
}
public async Task<PlexContainer> GetLibrarySections(string authToken, string plexFullHost)
7 years ago
{
var request = new Request("library/sections", plexFullHost, HttpMethod.Get);
await AddHeaders(request, authToken);
return await Api.Request<PlexContainer>(request);
7 years ago
}
public async Task<PlexContainer> GetLibrary(string authToken, string plexFullHost, string libraryId)
7 years ago
{
var request = new Request($"library/sections/{libraryId}/all", plexFullHost, HttpMethod.Get);
request.AddQueryString("includeGuids","1");
await AddHeaders(request, authToken);
return await Api.Request<PlexContainer>(request);
7 years ago
}
public async Task<PlexLibrariesForMachineId> GetLibrariesForMachineId(string authToken, string machineId)
{
var request = new Request("", $"https://plex.tv/api/servers/{machineId}", HttpMethod.Get, ContentType.Xml);
await AddHeaders(request, authToken);
return await Api.Request<PlexLibrariesForMachineId>(request);
}
7 years ago
/// <summary>
/// 192.168.1.69:32400/library/metadata/3662/allLeaves
/// The metadata ratingkey should be in the Cache
/// Search for it and then call the above with the Directory.RatingKey
/// THEN! We need the episode metadata using result.Vide.Key ("/library/metadata/3664")
/// We then have the GUID which contains the TVDB ID plus the season and episode number: guid="com.plexapp.agents.thetvdb://269586/2/8?lang=en"
7 years ago
/// </summary>
/// <param name="authToken"></param>
/// <param name="plexFullHost"></param>
/// <param name="ratingKey"></param>
public async Task<PlexMetadata> GetEpisodeMetaData(string authToken, string plexFullHost, string ratingKey)
7 years ago
{
var request = new Request($"/library/metadata/{ratingKey}", plexFullHost, HttpMethod.Get);
await AddHeaders(request, authToken);
7 years ago
return await Api.Request<PlexMetadata>(request);
}
public async Task<PlexMetadata> GetMetadata(string authToken, string plexFullHost, string itemId)
7 years ago
{
var request = new Request($"library/metadata/{itemId}", plexFullHost, HttpMethod.Get);
await AddHeaders(request, authToken);
7 years ago
return await Api.Request<PlexMetadata>(request);
}
public async Task<PlexMetadata> GetSeasons(string authToken, string plexFullHost, string ratingKey)
7 years ago
{
var request = new Request($"library/metadata/{ratingKey}/children", plexFullHost, HttpMethod.Get);
await AddHeaders(request, authToken);
7 years ago
return await Api.Request<PlexMetadata>(request);
}
/// <summary>
/// Gets all episodes.
/// </summary>
/// <param name="authToken">The authentication token.</param>
/// <param name="host">The host.</param>
/// <param name="section">The section.</param>
/// <param name="start">The start count.</param>
/// <param name="retCount">The return count, how many items you want returned.</param>
/// <returns></returns>
public async Task<PlexContainer> GetAllEpisodes(string authToken, string host, string section, int start, int retCount)
{
var request = new Request($"/library/sections/{section}/all", host, HttpMethod.Get);
request.AddQueryString("type", "4");
AddLimitHeaders(request, start, retCount);
await AddHeaders(request, authToken);
return await Api.Request<PlexContainer>(request);
}
/// <summary>
/// Retuns all the Plex users for this account
/// NOTE: For HOME USERS. There is no username or email, the user's home name is under the title property
/// </summary>
/// <param name="authToken"></param>
/// <returns></returns>
public async Task<PlexFriends> GetUsers(string authToken)
{
var request = new Request(string.Empty, FriendsUri, HttpMethod.Get, ContentType.Xml);
await AddHeaders(request, authToken);
return await Api.Request<PlexFriends>(request);
}
public async Task<PlexMetadata> GetRecentlyAdded(string authToken, string uri, string sectionId)
{
var request = new Request($"library/sections/{sectionId}/recentlyAdded", uri, HttpMethod.Get);
await AddHeaders(request, authToken);
AddLimitHeaders(request, 0, 50);
return await Api.Request<PlexMetadata>(request);
}
public async Task<OAuthContainer> GetPin(int pinId)
{
var request = new Request($"api/v2/pins/{pinId}", "https://plex.tv/", HttpMethod.Get);
await AddHeaders(request);
var response = await Api.RequestContent(request);
if (response.Contains("errors"))
{
var errors = JsonConvert.DeserializeObject<OAuthErrorsContainer>(response, Ombi.Api.Api.Settings);
return new OAuthContainer
{
Errors = errors
};
}
var pinResult = JsonConvert.DeserializeObject<OAuthPin>(response, Ombi.Api.Api.Settings);
return new OAuthContainer
{
Result = pinResult
};
}
public async Task<Uri> GetOAuthUrl(string code, string applicationUrl)
{
var request = new Request("auth/#", "https://app.plex.tv", HttpMethod.Get);
await AddHeaders(request);
request.AddQueryString("code", code);
request.AddQueryString("context[device][product]", ApplicationName);
request.AddQueryString("context[device][environment]", "bundled");
request.AddQueryString("context[device][layout]", "desktop");
request.AddQueryString("context[device][platform]", "Web");
request.AddQueryString("context[device][device]", "Ombi");
var s = await GetSettings();
await CheckInstallId(s);
request.AddQueryString("clientID", s.InstallId.ToString("N"));
if (request.FullUri.Fragment.Equals("#"))
{
var uri = request.FullUri.ToString();
var withoutEnd = uri.Remove(uri.Length - 1, 1);
var startOfQueryLocation = withoutEnd.IndexOf('?');
var better = withoutEnd.Insert(startOfQueryLocation, "#");
request.FullUri = new Uri(better);
}
return request.FullUri;
}
public async Task<PlexAddWrapper> AddUser(string emailAddress, string serverId, string authToken, int[] libs)
{
var request = new Request(string.Empty, $"https://plex.tv/api/servers/{serverId}/shared_servers", HttpMethod.Post, ContentType.Xml);
await AddHeaders(request, authToken);
request.AddJsonBody(new
{
server_id = serverId,
shared_server = new
{
library_section_ids = libs.Length > 0 ? libs : new int[]{},
invited_email = emailAddress
},
sharing_settings = new { }
});
var result = await Api.RequestContent(request);
try
{
var add = Api.DeserializeXml<PlexAdd>(result);
return new PlexAddWrapper{Add = add};
}
catch (InvalidOperationException)
{
var error = Api.DeserializeXml<AddUserError>(result);
return new PlexAddWrapper{Error = error};
}
}
public async Task<PlexWatchlistContainer> GetWatchlist(string plexToken, CancellationToken cancellationToken)
{
var request = new Request("library/sections/watchlist/all", WatchlistUri, HttpMethod.Get);
await AddHeaders(request, plexToken);
Update (#4871) * Remove dead code * Localize TV requests messages on TV details page * Transform buttons with link into anchors * Sonarr sync: stop using seasonpass API * chore(release): :rocket: v4.16.13 * Fix requests when 4k available and 4k disabled Fixes #4610 * chore(release): :rocket: v4.16.14 * Hide subscribe button when request is available * Hide subscribe button when request is denied * Add Title to Partially Available Message If the Title of the show is not menitoned it can be unclear what Episodes are now available. * Better error message when test email fails due to missing recipient * feat(discover): Add original language filter * chore(release): :rocket: v4.16.15 * fix(4616): :bug: fixed mandatory fields * chore: :busts_in_silhouette: Updated Contributors [skip ci] * chore(release): :rocket: v4.16.16 * added test results into the PR pipeline * chore(release): :rocket: v4.16.17 * Add information about cache refresh * Update pr.yml [skip ci] * Update pr.yml [skip ci] * Update pr.yml [skip ci] * chore(release): :rocket: v4.17.0 * feat(discover): Add new trending source experimental feature * fix(settings): Allow toggling features when there are more than one * fix(discover): Fix new trending feature detection * fix(discover): Fix cache mix up * refactor(discover): Move movie trending feature toggle to backend * feat(discover): Default trending source to new logic * chore(release): :rocket: v4.18.0 * feat(sync): Detect reidentified movies in Emby and Jellyfin * feat(sync): Detect reidentified series in Emby and Jellyfin * Fix sync log criticity * Update pr.yml [skip ci] * Update label.yml [skip ci] * Fix formatting * Update pr.yml [skip ci] * Update label.yml [skip ci] * chore: :busts_in_silhouette: Updated Contributors [skip ci] * chore(release): :rocket: v4.19.0 * refactor(newsletter): Clarify very rare cases where newsletter doesn't publish a series * refactor(newsletter): Clarify very rare cases where newsletter doesn't publish movie * chore(release): :rocket: v4.19.1 * feat(discover): Show more relevant shows in upcoming TV * chore(release): :rocket: v4.20.0 * fix(sync): Emby+Jellyfin - sync multi-episode files of 3+ episodes * perf(sync): Emby+Jellyfin - use a more reliable filter to missing items * fix(sync): Emby+Jellyfin - sync multi-episode files of 3+ episodes [skip ci] * fix: added media type tag to media type text (#4638) [skip ci] * fix(sickrage): Fixed issue with incorrect handling of SiCKRAGE episode results returned during episode status changes, now expects array of objects from data path if present (#4648) [skip ci] * fix: Missing Poster broken link fix (#4637) [skip ci] * 🌐 Translations Update (#4622) [skip ci] * Update launch.json (#4650) [skip ci] * fix: Improve Swagger documentation (#4652) * Upgrade Swashbuckle dependency * Document /token response * Add support for Newtonsoft annotations in Swagger * Remove unecessary ActionResult [skip ci] * fix(API): Fix pagination in some edge cases (#4649) [skip ci] * 🌐 Translations Update (#4655) * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(discover): Carousel touch not working when scrolling page and recommendations and similar movie navigation (#4633) * fixed touch not working on carousels * fixed touch not working * Movie details component fixes Fixed recommendations and similar not changing the data on the component by calling the init function again on param change Moved the ngif results > 0 to the mat-expansion panel to avoid rendering the entire element if it doesn't have any results instead of having an empty panel. * removed unused line, added scroll to top on init * updated recommendation refresh implementation Changed the implementation to use the router instead in order to reload the component instead of just reloading the data. This implementation makes sure the component gets destroyed on navigation eliminating any memory leaks, reloading CSS in case of having animations on page load and generally a continuation of the experience you get when you browse into a movie from the discover page. * chore: :busts_in_silhouette: Updated Contributors [skip ci] * chore(release): :rocket: v4.20.1 [skip ci] * fix: :bug: Fixed the Request on Behalf of having blanks (#4667) * chore(release): :rocket: v4.20.2 [skip ci] * fix(plex): 🐛 Fixed an issue with the Plex Sync * chore(release): :rocket: v4.20.3 [skip ci] * fix (technical): Improved some of the date time parsing handling * fix: fixed build * chore(release): :rocket: v4.20.4 [skip ci] * feat: Upgrade to Angular14 (#4668) * refactor: :fire: removed angular-bootstrap-md dependancy * chore: update tsconfig * yeah * ng14 upgrade * refactor: migration changes * fix: fixed CLI * test: Fixed automation * chore: :busts_in_silhouette: Updated Contributors [skip ci] * perf: stop populating obsolete subscribe fields (#4625) * chore(release): :rocket: v4.21.0 [skip ci] * fix(images): Retry images with a backoff when we get a Too Many requests from TheMovieDb #4685 * chore(release): :rocket: v4.21.1 [skip ci] * 🌐 Translations Update (#4683) * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix: Landing and Login page improvements (#4690) * chore(release): :rocket: v4.21.2 [skip ci] * feat(discover): ✨ Added infinite scroll on advanced search results * feat(discover): :sparkles: Added infinite scroll on advanced search results * chore(release): :rocket: v4.22.0 [skip ci] * 🌐 Translations Update (#4694) * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(discover): :bug: Created new Image component to handle 429's from TMDB (#4698) and fixed #4635 (#4699) * chore(release): :rocket: v4.22.1 [skip ci] * fix: fixed an issue where I broke images for some users * chore(release): :rocket: v4.22.2 [skip ci] * ci(Mergify): configuration update (#4701) Signed-off-by: Jamie <tidusjar@gmail.com> [skip ci] * fix: Override Sonarr V3 Profiles endpoint (#4678) * Override Sonarr V3 Profiles endpoint [skip ci] * fix(4K) :4K request fixes (#4702) * GetRequestsByStatus wasn't implementing the MovieRequests object correctly for 4K quality requests with the ProcessingRequest status. * Fixed 4K requests not getting automatically approved if the user has the "Auto Approve Movie" role flag enabled. * Fixed "Request Date" values for the "left-panel-details" div class. Previously when the movie was exclusively 4K (regular request was absent), then "Request Date" equaled DateTime.MinValue (January 1, 0001). * Fixed "Request Status" evaluation in the "left-panel-details" div class. Now it shows the appropriate status instead of an empty spot. "Request Status" displays both regular and 4K statuses at the same time if needed. Added a comma to the end of the "RequestStatus" label to maintain design consistency with the other labels. Also added a "Denied Reason" element for 4K requests. * chore: :busts_in_silhouette: Updated Contributors [skip ci] * chore(release): :rocket: v4.22.3 [skip ci] * chore: Storybook (#4700) [skip ci] * chore: Translations [skip ci] * 🌐 Translations Update (#4704) * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] (#4713) * build: Run automation tests in docker (#4715) [skip ci] * fix: fixed trakt image not loading when base url present (#4711) [skip ci] * fix: :bug: Fixed missing externals (#4712) * chore: :busts_in_silhouette: Updated Contributors [skip ci] * chore(release): :rocket: v4.22.4 [skip ci] * test: fixed automationt tests [skip ci] * fix: Log Microsoft warnings to log file (#4723) [skip ci] * feat: ✨ Recently Requested on Discover Page (#4387) * chore(release): :rocket: v4.23.0 [skip ci] * fix: Localize recently requested on discover page (#4729) [skip ci] * 🌐 Translations Update (#4731) * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * Fix: Ombi.Api.Lidarr: Remove unused fields from ArtistAdd (#4727) When an artist is not found in Lidarr as part of requesting an album, MusicSender will make a POST request against the /api/v1/artist endpoint to add such artist. Not all fields defined in ArtistAdd are initialized, and those uninitialized will be `null` values in the JSON body of the request, as shown in this intercepted request: ``` { "addOptions": { "AlbumsToMonitor": [ "e5c48b66-44ef-3685-ad53-45dbcd7294c0" ], "monitor": 6, "monitored": true, "searchForMissingAlbums": false }, "added": "2022-08-10T06:49:32.4374278+00:00", "albumFolder": true, "artistName": "Manolo García", "cleanName": "manologarcía", "disambiguation": null, "discogsId": 0, "ended": false, "foreignArtistId": "1c8309da-9789-40bf-b9c2-e20064263820", "images": [], "links": [], "metadataProfileId": 1, "monitored": true, "overview": null, "qualityProfileId": 3, "ratings": null, "remotePoster": null, "rootFolderPath": "/media/music/", "sortName": null, "statistics": null, "status": null, "tadbId": 0, "tags": null } ``` This request will fail and Lidarr will return a 400 BadRequest error with the following message: ``` 2022-08-10 01:45:52.458 +00:00 [Error] StatusCode: BadRequest, Reason: Bad Request, RequestUri: http://lidarr:8686/api/v1/artist 2022-08-10 01:45:52.459 +00:00 [Debug] { "type": "https://tools.ietf.org/html/rfc7231#section-6.5.1", "title": "One or more validation errors occurred.", "status": 400, "traceId": "00-52e01b322a05d7c6633eca2488ef2a5c-06345b3bb8c4bb6c-00", "errors": { "$.status": [ "The JSON value could not be converted to NzbDrone.Core.Music.ArtistStatusType. Path: $.status | LineNumber: 0 | BytePositionInLine: 14." ] } } ``` Removing all the `null` fields from the JSON body fixes the problem and correctly adds the artist to Lidarr. * chore: :busts_in_silhouette: Updated Contributors [skip ci] * chore(release): :rocket: v4.23.1 [skip ci] * fix: Fix conflicting property name for Swagger (#4733) * chore(release): :rocket: v4.23.2 [skip ci] * feat: add crew on movie page (#4722) * add crew on movie page * order by director, add default image and fix click Co-authored-by: tidusjar <tidusjar@gmail.com> * 🌐 Translations Update (#4736) * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * chore(release): :rocket: v4.24.0 [skip ci] * feat: Watchlist history errors(#4741) [skip ci] * fix: fixed stats controller (#4742) * chore: :busts_in_silhouette: Updated Contributors [skip ci] * chore(release): :rocket: v4.25.0 [skip ci] * fix(webhook): Remove added trailing slash from webhook URL #4710 * chore(release): :rocket: v4.25.1 [skip ci] * feat(notifications): Add more curly variables for partially available notification * feat: Add more curly variables for partially available notification * test: Fix newly added test * chore(release): :rocket: v4.26.0 [skip ci] * feat: Recently requested improvements (#4755) * feat(discover): :sparkles: Admins can now approve the Recently Requested list * feat(discover): :zap: Images for the recently requested area are now loading faster and just better all around * test: :white_check_mark: Added automation for the new feature * chore(release): :rocket: v4.27.0 [skip ci] * fix(plex): stop the plex sync from deleting episodes when we can't find the plex key * chore(release): :rocket: v4.27.1 [skip ci] * refactor: Encapsulate common TV availability checker logic (#4753) [skip ci] * fix(sonarr): :bug: Cleaned up and removed Sonarr v3 option, sonarr v3 is now the default. This allows us to get ready for the upcoming Sonarr v4 (#4764) * chore(release): :rocket: v4.27.2 [skip ci] * 🌐 Translations Update (#4739) * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(availability): 🐛 Fixed a issue with the availability checker after the previous update. Added full test coverage around that area * chore(release): :rocket: v4.27.3 [skip ci] * test: 🧪 added full test coverage to the plex availability checker, also fixed a small few bugs in there at the same time * chore(release): :rocket: v4.27.4 [skip ci] * fix(importer): 🐛 Allow you to only import Plex Admins without the Plex Users * chore(release): :rocket: v4.27.5 [skip ci] * fix(notifications): Fixed the error when sending multiple test notifications. Added more logging when Discord complains the message is invalid * chore(release): :rocket: v4.27.6 [skip ci] * fix: Fixes default image for recently requested items. (#4767) * chore(release): :rocket: v4.27.7 [skip ci] * refactor: Upgrades nuget packages. Removes deprecated packages. Fixes build warnings. (#4769) * Upgrades nuget packages. Removes deprecated packages. Fixes build warnings. * Fixes the last few build warnings. * chore(release): :rocket: v4.27.8 [skip ci] * refactor: Rework the Plex Settings Page (#4772) [skip ci] * feat(plex): ✨ Added the ability to configure the watchlist to request the whole TV show rather than latest season (#4774) * chore(release): :rocket: v4.28.0 [skip ci] * 🌐 Translations Update (#4771) * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * 🌐 Translations Update (#4775) * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix: Reworked the version check (#4719) (#4781) [skip ci] * fix(plex): :bug: Fixed not being able to enable watchlist requests in the Plex settings * chore: :busts_in_silhouette: Updated Contributors [skip ci] * chore(release): :rocket: v4.28.1 [skip ci] * feat: Provide a flag for missing users on Plex Server (#4688) (#4778) [skip ci] * fix: Unable to Delete Jellyfin Server (#4705) (#4780) [skip ci] * fix: Partially Available prevents further TV requests (#4768) (#4779) * chore: :busts_in_silhouette: Updated Contributors [skip ci] * chore(release): :rocket: v4.29.0 [skip ci] * fix: Consistently reset loading flag when requesting movies on discover page. (#4777) [skip ci] * fix(sonarr): :bug: Fixed an issue where the language list didn't correctly load for power users in the advanced options #4782 * chore(release): :rocket: v4.29.1 [skip ci] * fix(plex): Fixed an issue where sometimes the availability checker would throw an exception when checking episodes * chore: fixed tests * chore(release): :rocket: v4.29.2 [skip ci] * fix: Only log error messages from Microsoft (#4787) [skip ci] * 🌐 Translations Update (#4784) * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(notifications): Fixed the Partially TV notifications going to the admin #4797 (#4799) * chore(release): :rocket: v4.29.3 [skip ci] * feat(sonarr): :sparkles: Add the username to a Sonarr tag when sent to Sonarr (#4802) * chore(release): :rocket: v4.30.0 [skip ci] * feat(sonarr): Added the ability to add default tags when sending to Sonarr (#4803) * chore(release): :rocket: v4.31.0 [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] (#4801) * feat(plex): Rework the Plex Settings page (#4805) * chore(release): :rocket: v4.32.0 [skip ci] * fix(plex): :bug: Fixed the issue where you couldn't add a new server on a fresh setup after the settings page rework * chore(release): :rocket: v4.32.1 [skip ci] * fix(sonarr): :bug: Sonarr V4 should work now (#4810) * fix(sonarr): :bug: Sonarr V4 should work now Auto detect the sonarr version and adjust the UI depending on V3 or V4 (Lang profiles) * fix: Fixed the load error * chore(release): :rocket: v4.32.2 [skip ci] * fix(sonarr): V4 actually works this time around * chore(release): :rocket: v4.32.3 [skip ci] * feat: Angular 15 and Dependency upgrades (#4818) * chore(release): :rocket: v4.33.0 [skip ci] * fix(plex): Added the watchlist request whole show back into the settings * chore: undid * fixed (#4833) * chore(release): :rocket: v4.33.1 [skip ci] * chore: add logo [skip ci] * feat: Radarr tags (#4815) * chore(release): :rocket: v4.34.0 [skip ci] * fix(plex-watchlist): Lookup the ID from different sources when Plex doesn't contain the metadata (#4843) * chore(release): :rocket: v4.34.1 [skip ci] * feat: Add the option for header authentication to create users (#4841) * feat: allow SSO to create new users automatically * feat: apply default user settings to SSO users * feat: add warnings to header auth toggles * chore(release): :rocket: v4.35.0 [skip ci] * fix(plex-watchlist): Index out of bounds error * chore: :busts_in_silhouette: Updated Contributors [skip ci] * chore(release): :rocket: v4.35.1 [skip ci] * fix(database): Just some tweaks, shouldn't notice any difference, maybe a less error in the log * chore(release): :rocket: v4.35.2 [skip ci] * fix(#4847): Invalid Discord request fixed, also fixed an issue where App Only users would not show as logged in on the user management page (#4848) * chore(release): :rocket: v4.35.3 [skip ci] * bug(#4854): 🐛 Fixed the Recently Requested showing requests when it should be hidden * fix(discover): :bug: Fixed the default poster not taking into account the base url in some scenarios #4845 * fix(Hide music from navbar and request list when not enabled): :bug: * chore: :busts_in_silhouette: Updated Contributors [skip ci] * chore(release): :rocket: v4.35.4 [skip ci] * fix(radarr-settings): 🐛 Fixed a typo * chore(release): :rocket: v4.35.5 [skip ci] * fix: Fixed the issue where the login page is still present after logging in with oauth * chore(release): :rocket: v4.35.6 [skip ci] * fix(wizard): :bug: Stop access to the wizard when you have already setup ombi (#4866) * chore(release): :rocket: v4.35.7 [skip ci] * fix(plex-oauth): 🐛 Fixed an issue where using OAuth you could log in as a Ombi Local user #4835 * chore(release): :rocket: v4.35.8 [skip ci] * chore: :busts_in_silhouette: Updated Contributors [skip ci] * fixed bad merge * chore(release): :rocket: v4.35.9 [skip ci] * Update .gitignore * Fixed automation --------- Signed-off-by: Jamie <tidusjar@gmail.com> [skip ci] Co-authored-by: sephrat <34862846+sephrat@users.noreply.github.com> Co-authored-by: Conventional Changelog Action <conventional.changelog.action@github.com> Co-authored-by: Teifun2 <Teifun2@users.noreply.github.com> Co-authored-by: contrib-readme-bot <contrib-readme-action@noreply.com> Co-authored-by: dr3amer <91037083+dr3am37@users.noreply.github.com> Co-authored-by: echel0n <echel0n@sickrage.ca> Co-authored-by: Marley <55280588+marleypowell@users.noreply.github.com> Co-authored-by: Igor Borges <igor@borges.dev> Co-authored-by: Lucane <Lucane@users.noreply.github.com> Co-authored-by: mkgeeky <github@mkgeeky.xyz> Co-authored-by: Miguel A Vico Moya <mvicomoya@gmail.com> Co-authored-by: Hadrien <26697460+ketsapiwiq@users.noreply.github.com> Co-authored-by: Victor Usoltsev <bernarden@users.noreply.github.com> Co-authored-by: Wesley King <kingwe92@gmail.com> Co-authored-by: Lea <me@janderedev.xyz>
1 year ago
var result = await Api.Request(request, cancellationToken);
Update (#4871) * Remove dead code * Localize TV requests messages on TV details page * Transform buttons with link into anchors * Sonarr sync: stop using seasonpass API * chore(release): :rocket: v4.16.13 * Fix requests when 4k available and 4k disabled Fixes #4610 * chore(release): :rocket: v4.16.14 * Hide subscribe button when request is available * Hide subscribe button when request is denied * Add Title to Partially Available Message If the Title of the show is not menitoned it can be unclear what Episodes are now available. * Better error message when test email fails due to missing recipient * feat(discover): Add original language filter * chore(release): :rocket: v4.16.15 * fix(4616): :bug: fixed mandatory fields * chore: :busts_in_silhouette: Updated Contributors [skip ci] * chore(release): :rocket: v4.16.16 * added test results into the PR pipeline * chore(release): :rocket: v4.16.17 * Add information about cache refresh * Update pr.yml [skip ci] * Update pr.yml [skip ci] * Update pr.yml [skip ci] * chore(release): :rocket: v4.17.0 * feat(discover): Add new trending source experimental feature * fix(settings): Allow toggling features when there are more than one * fix(discover): Fix new trending feature detection * fix(discover): Fix cache mix up * refactor(discover): Move movie trending feature toggle to backend * feat(discover): Default trending source to new logic * chore(release): :rocket: v4.18.0 * feat(sync): Detect reidentified movies in Emby and Jellyfin * feat(sync): Detect reidentified series in Emby and Jellyfin * Fix sync log criticity * Update pr.yml [skip ci] * Update label.yml [skip ci] * Fix formatting * Update pr.yml [skip ci] * Update label.yml [skip ci] * chore: :busts_in_silhouette: Updated Contributors [skip ci] * chore(release): :rocket: v4.19.0 * refactor(newsletter): Clarify very rare cases where newsletter doesn't publish a series * refactor(newsletter): Clarify very rare cases where newsletter doesn't publish movie * chore(release): :rocket: v4.19.1 * feat(discover): Show more relevant shows in upcoming TV * chore(release): :rocket: v4.20.0 * fix(sync): Emby+Jellyfin - sync multi-episode files of 3+ episodes * perf(sync): Emby+Jellyfin - use a more reliable filter to missing items * fix(sync): Emby+Jellyfin - sync multi-episode files of 3+ episodes [skip ci] * fix: added media type tag to media type text (#4638) [skip ci] * fix(sickrage): Fixed issue with incorrect handling of SiCKRAGE episode results returned during episode status changes, now expects array of objects from data path if present (#4648) [skip ci] * fix: Missing Poster broken link fix (#4637) [skip ci] * 🌐 Translations Update (#4622) [skip ci] * Update launch.json (#4650) [skip ci] * fix: Improve Swagger documentation (#4652) * Upgrade Swashbuckle dependency * Document /token response * Add support for Newtonsoft annotations in Swagger * Remove unecessary ActionResult [skip ci] * fix(API): Fix pagination in some edge cases (#4649) [skip ci] * 🌐 Translations Update (#4655) * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(discover): Carousel touch not working when scrolling page and recommendations and similar movie navigation (#4633) * fixed touch not working on carousels * fixed touch not working * Movie details component fixes Fixed recommendations and similar not changing the data on the component by calling the init function again on param change Moved the ngif results > 0 to the mat-expansion panel to avoid rendering the entire element if it doesn't have any results instead of having an empty panel. * removed unused line, added scroll to top on init * updated recommendation refresh implementation Changed the implementation to use the router instead in order to reload the component instead of just reloading the data. This implementation makes sure the component gets destroyed on navigation eliminating any memory leaks, reloading CSS in case of having animations on page load and generally a continuation of the experience you get when you browse into a movie from the discover page. * chore: :busts_in_silhouette: Updated Contributors [skip ci] * chore(release): :rocket: v4.20.1 [skip ci] * fix: :bug: Fixed the Request on Behalf of having blanks (#4667) * chore(release): :rocket: v4.20.2 [skip ci] * fix(plex): 🐛 Fixed an issue with the Plex Sync * chore(release): :rocket: v4.20.3 [skip ci] * fix (technical): Improved some of the date time parsing handling * fix: fixed build * chore(release): :rocket: v4.20.4 [skip ci] * feat: Upgrade to Angular14 (#4668) * refactor: :fire: removed angular-bootstrap-md dependancy * chore: update tsconfig * yeah * ng14 upgrade * refactor: migration changes * fix: fixed CLI * test: Fixed automation * chore: :busts_in_silhouette: Updated Contributors [skip ci] * perf: stop populating obsolete subscribe fields (#4625) * chore(release): :rocket: v4.21.0 [skip ci] * fix(images): Retry images with a backoff when we get a Too Many requests from TheMovieDb #4685 * chore(release): :rocket: v4.21.1 [skip ci] * 🌐 Translations Update (#4683) * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix: Landing and Login page improvements (#4690) * chore(release): :rocket: v4.21.2 [skip ci] * feat(discover): ✨ Added infinite scroll on advanced search results * feat(discover): :sparkles: Added infinite scroll on advanced search results * chore(release): :rocket: v4.22.0 [skip ci] * 🌐 Translations Update (#4694) * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(discover): :bug: Created new Image component to handle 429's from TMDB (#4698) and fixed #4635 (#4699) * chore(release): :rocket: v4.22.1 [skip ci] * fix: fixed an issue where I broke images for some users * chore(release): :rocket: v4.22.2 [skip ci] * ci(Mergify): configuration update (#4701) Signed-off-by: Jamie <tidusjar@gmail.com> [skip ci] * fix: Override Sonarr V3 Profiles endpoint (#4678) * Override Sonarr V3 Profiles endpoint [skip ci] * fix(4K) :4K request fixes (#4702) * GetRequestsByStatus wasn't implementing the MovieRequests object correctly for 4K quality requests with the ProcessingRequest status. * Fixed 4K requests not getting automatically approved if the user has the "Auto Approve Movie" role flag enabled. * Fixed "Request Date" values for the "left-panel-details" div class. Previously when the movie was exclusively 4K (regular request was absent), then "Request Date" equaled DateTime.MinValue (January 1, 0001). * Fixed "Request Status" evaluation in the "left-panel-details" div class. Now it shows the appropriate status instead of an empty spot. "Request Status" displays both regular and 4K statuses at the same time if needed. Added a comma to the end of the "RequestStatus" label to maintain design consistency with the other labels. Also added a "Denied Reason" element for 4K requests. * chore: :busts_in_silhouette: Updated Contributors [skip ci] * chore(release): :rocket: v4.22.3 [skip ci] * chore: Storybook (#4700) [skip ci] * chore: Translations [skip ci] * 🌐 Translations Update (#4704) * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] (#4713) * build: Run automation tests in docker (#4715) [skip ci] * fix: fixed trakt image not loading when base url present (#4711) [skip ci] * fix: :bug: Fixed missing externals (#4712) * chore: :busts_in_silhouette: Updated Contributors [skip ci] * chore(release): :rocket: v4.22.4 [skip ci] * test: fixed automationt tests [skip ci] * fix: Log Microsoft warnings to log file (#4723) [skip ci] * feat: ✨ Recently Requested on Discover Page (#4387) * chore(release): :rocket: v4.23.0 [skip ci] * fix: Localize recently requested on discover page (#4729) [skip ci] * 🌐 Translations Update (#4731) * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * Fix: Ombi.Api.Lidarr: Remove unused fields from ArtistAdd (#4727) When an artist is not found in Lidarr as part of requesting an album, MusicSender will make a POST request against the /api/v1/artist endpoint to add such artist. Not all fields defined in ArtistAdd are initialized, and those uninitialized will be `null` values in the JSON body of the request, as shown in this intercepted request: ``` { "addOptions": { "AlbumsToMonitor": [ "e5c48b66-44ef-3685-ad53-45dbcd7294c0" ], "monitor": 6, "monitored": true, "searchForMissingAlbums": false }, "added": "2022-08-10T06:49:32.4374278+00:00", "albumFolder": true, "artistName": "Manolo García", "cleanName": "manologarcía", "disambiguation": null, "discogsId": 0, "ended": false, "foreignArtistId": "1c8309da-9789-40bf-b9c2-e20064263820", "images": [], "links": [], "metadataProfileId": 1, "monitored": true, "overview": null, "qualityProfileId": 3, "ratings": null, "remotePoster": null, "rootFolderPath": "/media/music/", "sortName": null, "statistics": null, "status": null, "tadbId": 0, "tags": null } ``` This request will fail and Lidarr will return a 400 BadRequest error with the following message: ``` 2022-08-10 01:45:52.458 +00:00 [Error] StatusCode: BadRequest, Reason: Bad Request, RequestUri: http://lidarr:8686/api/v1/artist 2022-08-10 01:45:52.459 +00:00 [Debug] { "type": "https://tools.ietf.org/html/rfc7231#section-6.5.1", "title": "One or more validation errors occurred.", "status": 400, "traceId": "00-52e01b322a05d7c6633eca2488ef2a5c-06345b3bb8c4bb6c-00", "errors": { "$.status": [ "The JSON value could not be converted to NzbDrone.Core.Music.ArtistStatusType. Path: $.status | LineNumber: 0 | BytePositionInLine: 14." ] } } ``` Removing all the `null` fields from the JSON body fixes the problem and correctly adds the artist to Lidarr. * chore: :busts_in_silhouette: Updated Contributors [skip ci] * chore(release): :rocket: v4.23.1 [skip ci] * fix: Fix conflicting property name for Swagger (#4733) * chore(release): :rocket: v4.23.2 [skip ci] * feat: add crew on movie page (#4722) * add crew on movie page * order by director, add default image and fix click Co-authored-by: tidusjar <tidusjar@gmail.com> * 🌐 Translations Update (#4736) * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * chore(release): :rocket: v4.24.0 [skip ci] * feat: Watchlist history errors(#4741) [skip ci] * fix: fixed stats controller (#4742) * chore: :busts_in_silhouette: Updated Contributors [skip ci] * chore(release): :rocket: v4.25.0 [skip ci] * fix(webhook): Remove added trailing slash from webhook URL #4710 * chore(release): :rocket: v4.25.1 [skip ci] * feat(notifications): Add more curly variables for partially available notification * feat: Add more curly variables for partially available notification * test: Fix newly added test * chore(release): :rocket: v4.26.0 [skip ci] * feat: Recently requested improvements (#4755) * feat(discover): :sparkles: Admins can now approve the Recently Requested list * feat(discover): :zap: Images for the recently requested area are now loading faster and just better all around * test: :white_check_mark: Added automation for the new feature * chore(release): :rocket: v4.27.0 [skip ci] * fix(plex): stop the plex sync from deleting episodes when we can't find the plex key * chore(release): :rocket: v4.27.1 [skip ci] * refactor: Encapsulate common TV availability checker logic (#4753) [skip ci] * fix(sonarr): :bug: Cleaned up and removed Sonarr v3 option, sonarr v3 is now the default. This allows us to get ready for the upcoming Sonarr v4 (#4764) * chore(release): :rocket: v4.27.2 [skip ci] * 🌐 Translations Update (#4739) * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(availability): 🐛 Fixed a issue with the availability checker after the previous update. Added full test coverage around that area * chore(release): :rocket: v4.27.3 [skip ci] * test: 🧪 added full test coverage to the plex availability checker, also fixed a small few bugs in there at the same time * chore(release): :rocket: v4.27.4 [skip ci] * fix(importer): 🐛 Allow you to only import Plex Admins without the Plex Users * chore(release): :rocket: v4.27.5 [skip ci] * fix(notifications): Fixed the error when sending multiple test notifications. Added more logging when Discord complains the message is invalid * chore(release): :rocket: v4.27.6 [skip ci] * fix: Fixes default image for recently requested items. (#4767) * chore(release): :rocket: v4.27.7 [skip ci] * refactor: Upgrades nuget packages. Removes deprecated packages. Fixes build warnings. (#4769) * Upgrades nuget packages. Removes deprecated packages. Fixes build warnings. * Fixes the last few build warnings. * chore(release): :rocket: v4.27.8 [skip ci] * refactor: Rework the Plex Settings Page (#4772) [skip ci] * feat(plex): ✨ Added the ability to configure the watchlist to request the whole TV show rather than latest season (#4774) * chore(release): :rocket: v4.28.0 [skip ci] * 🌐 Translations Update (#4771) * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * 🌐 Translations Update (#4775) * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix: Reworked the version check (#4719) (#4781) [skip ci] * fix(plex): :bug: Fixed not being able to enable watchlist requests in the Plex settings * chore: :busts_in_silhouette: Updated Contributors [skip ci] * chore(release): :rocket: v4.28.1 [skip ci] * feat: Provide a flag for missing users on Plex Server (#4688) (#4778) [skip ci] * fix: Unable to Delete Jellyfin Server (#4705) (#4780) [skip ci] * fix: Partially Available prevents further TV requests (#4768) (#4779) * chore: :busts_in_silhouette: Updated Contributors [skip ci] * chore(release): :rocket: v4.29.0 [skip ci] * fix: Consistently reset loading flag when requesting movies on discover page. (#4777) [skip ci] * fix(sonarr): :bug: Fixed an issue where the language list didn't correctly load for power users in the advanced options #4782 * chore(release): :rocket: v4.29.1 [skip ci] * fix(plex): Fixed an issue where sometimes the availability checker would throw an exception when checking episodes * chore: fixed tests * chore(release): :rocket: v4.29.2 [skip ci] * fix: Only log error messages from Microsoft (#4787) [skip ci] * 🌐 Translations Update (#4784) * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] * fix(notifications): Fixed the Partially TV notifications going to the admin #4797 (#4799) * chore(release): :rocket: v4.29.3 [skip ci] * feat(sonarr): :sparkles: Add the username to a Sonarr tag when sent to Sonarr (#4802) * chore(release): :rocket: v4.30.0 [skip ci] * feat(sonarr): Added the ability to add default tags when sending to Sonarr (#4803) * chore(release): :rocket: v4.31.0 [skip ci] * fix(translations): 🌐 New translations from Crowdin [skip ci] (#4801) * feat(plex): Rework the Plex Settings page (#4805) * chore(release): :rocket: v4.32.0 [skip ci] * fix(plex): :bug: Fixed the issue where you couldn't add a new server on a fresh setup after the settings page rework * chore(release): :rocket: v4.32.1 [skip ci] * fix(sonarr): :bug: Sonarr V4 should work now (#4810) * fix(sonarr): :bug: Sonarr V4 should work now Auto detect the sonarr version and adjust the UI depending on V3 or V4 (Lang profiles) * fix: Fixed the load error * chore(release): :rocket: v4.32.2 [skip ci] * fix(sonarr): V4 actually works this time around * chore(release): :rocket: v4.32.3 [skip ci] * feat: Angular 15 and Dependency upgrades (#4818) * chore(release): :rocket: v4.33.0 [skip ci] * fix(plex): Added the watchlist request whole show back into the settings * chore: undid * fixed (#4833) * chore(release): :rocket: v4.33.1 [skip ci] * chore: add logo [skip ci] * feat: Radarr tags (#4815) * chore(release): :rocket: v4.34.0 [skip ci] * fix(plex-watchlist): Lookup the ID from different sources when Plex doesn't contain the metadata (#4843) * chore(release): :rocket: v4.34.1 [skip ci] * feat: Add the option for header authentication to create users (#4841) * feat: allow SSO to create new users automatically * feat: apply default user settings to SSO users * feat: add warnings to header auth toggles * chore(release): :rocket: v4.35.0 [skip ci] * fix(plex-watchlist): Index out of bounds error * chore: :busts_in_silhouette: Updated Contributors [skip ci] * chore(release): :rocket: v4.35.1 [skip ci] * fix(database): Just some tweaks, shouldn't notice any difference, maybe a less error in the log * chore(release): :rocket: v4.35.2 [skip ci] * fix(#4847): Invalid Discord request fixed, also fixed an issue where App Only users would not show as logged in on the user management page (#4848) * chore(release): :rocket: v4.35.3 [skip ci] * bug(#4854): 🐛 Fixed the Recently Requested showing requests when it should be hidden * fix(discover): :bug: Fixed the default poster not taking into account the base url in some scenarios #4845 * fix(Hide music from navbar and request list when not enabled): :bug: * chore: :busts_in_silhouette: Updated Contributors [skip ci] * chore(release): :rocket: v4.35.4 [skip ci] * fix(radarr-settings): 🐛 Fixed a typo * chore(release): :rocket: v4.35.5 [skip ci] * fix: Fixed the issue where the login page is still present after logging in with oauth * chore(release): :rocket: v4.35.6 [skip ci] * fix(wizard): :bug: Stop access to the wizard when you have already setup ombi (#4866) * chore(release): :rocket: v4.35.7 [skip ci] * fix(plex-oauth): 🐛 Fixed an issue where using OAuth you could log in as a Ombi Local user #4835 * chore(release): :rocket: v4.35.8 [skip ci] * chore: :busts_in_silhouette: Updated Contributors [skip ci] * fixed bad merge * chore(release): :rocket: v4.35.9 [skip ci] * Update .gitignore * Fixed automation --------- Signed-off-by: Jamie <tidusjar@gmail.com> [skip ci] Co-authored-by: sephrat <34862846+sephrat@users.noreply.github.com> Co-authored-by: Conventional Changelog Action <conventional.changelog.action@github.com> Co-authored-by: Teifun2 <Teifun2@users.noreply.github.com> Co-authored-by: contrib-readme-bot <contrib-readme-action@noreply.com> Co-authored-by: dr3amer <91037083+dr3am37@users.noreply.github.com> Co-authored-by: echel0n <echel0n@sickrage.ca> Co-authored-by: Marley <55280588+marleypowell@users.noreply.github.com> Co-authored-by: Igor Borges <igor@borges.dev> Co-authored-by: Lucane <Lucane@users.noreply.github.com> Co-authored-by: mkgeeky <github@mkgeeky.xyz> Co-authored-by: Miguel A Vico Moya <mvicomoya@gmail.com> Co-authored-by: Hadrien <26697460+ketsapiwiq@users.noreply.github.com> Co-authored-by: Victor Usoltsev <bernarden@users.noreply.github.com> Co-authored-by: Wesley King <kingwe92@gmail.com> Co-authored-by: Lea <me@janderedev.xyz>
1 year ago
if (result.StatusCode.Equals(HttpStatusCode.Unauthorized))
{
return new PlexWatchlistContainer
{
AuthError = true
};
}
var receivedString = await result.Content.ReadAsStringAsync(cancellationToken);
return JsonConvert.DeserializeObject<PlexWatchlistContainer>(receivedString);
}
public async Task<PlexWatchlistMetadataContainer> GetWatchlistMetadata(string ratingKey, string plexToken, CancellationToken cancellationToken)
{
var request = new Request($"library/metadata/{ratingKey}", WatchlistUri, HttpMethod.Get);
await AddHeaders(request, plexToken);
var result = await Api.Request<PlexWatchlistMetadataContainer>(request, cancellationToken);
return result;
}
/// <summary>
/// Adds the required headers and also the authorization header
/// </summary>
/// <param name="request"></param>
/// <param name="authToken"></param>
private async Task AddHeaders(Request request, string authToken)
{
request.AddHeader("X-Plex-Token", authToken);
await AddHeaders(request);
}
/// <summary>
/// Adds the main required headers to the Plex Request
/// </summary>
/// <param name="request"></param>
private async Task AddHeaders(Request request)
{
var s = await GetSettings();
await CheckInstallId(s);
request.AddHeader("X-Plex-Client-Identifier", s.InstallId.ToString("N"));
request.AddHeader("X-Plex-Product", ApplicationName);
request.AddHeader("X-Plex-Version", "3");
request.AddHeader("X-Plex-Device", "Ombi");
request.AddHeader("X-Plex-Platform", "Web");
7 years ago
request.AddContentHeader("Content-Type", request.ContentType == ContentType.Json ? "application/json" : "application/xml");
request.AddHeader("Accept", "application/json");
}
private void AddLimitHeaders(Request request, int from, int to)
{
request.AddHeader("X-Plex-Container-Start", from.ToString());
request.AddHeader("X-Plex-Container-Size", to.ToString());
}
private async Task CheckInstallId(PlexSettings s)
{
if (s?.InstallId == Guid.Empty || s.InstallId == Guid.Empty)
{
s.InstallId = Guid.NewGuid();
await _plexSettings.SaveSettingsAsync(s);
}
}
private PlexSettings _settings;
private async Task<PlexSettings> GetSettings()
{
return _settings ?? (_settings = await _plexSettings.GetSettingsAsync());
}
}
}