Unverified Commit cd8a8980 authored by Jamie's avatar Jamie Committed by GitHub

Merge pull request #3200 from tidusjar/develop

Develop
parents 9940156f 7a72496c
# Changelog
## (unreleased)
### **New Features**
- Added better support for Jellyfin, we will now auto detect if it's a jellyfin server after pressing the discover button. [tidusjar]
- Update aspnetcore.yml. [Jamie]
- Update aspnetcore.yml. [Jamie]
- Update aspnetcore.yml. [Jamie]
- Update aspnetcore.yml. [Jamie]
- Update aspnetcore.yml. [Jamie]
- Update and rename .github/workflows to .github/.github/workflows/test.workflow. [Jamie]
- Update aspnetcore.yml. [Jamie]
- Update aspnetcore.yml. [Jamie]
- Update aspnetcore.yml. [Jamie]
- Added a bit more logging into the recently added scan. [tidusjar]
- Update emby.component.html. [sorano]
- Update EmbyHelper.cs. [sorano]
- Update CHANGELOG.md. [Jamie]
### **Fixes**
- Fixed #3078. [tidusjar]
- Fixes issue #3195 The new string extension method ToHttpsUrl ensures that URLs starting with "https" are no longer turned into "httpss" The commit also replaces all occurances of the error prone .Replace("http", "https") in the whole solution. [msdeibel]
- Create test.workflow. [Jamie]
- Delete test.workflow. [Jamie]
- New translations en.json (Norwegian) [Jamie]
- New translations en.json (Norwegian) [Jamie]
- Fix for #3183. [tidusjar]
- Fixed an issue where running the recently added sync via the UI was running the full sync. [tidusjar]
- Fixed #3143. [Jamie Rees]
- New translations en.json (French) [Jamie]
- New translations en.json (French) [Jamie]
- New translations en.json (Russian) [Jamie]
- New translations en.json (Russian) [Jamie]
- New translations en.json (Russian) [Jamie]
- New translations en.json (French) [Jamie]
- New translations en.json (Russian) [Jamie]
- New translations en.json (Russian) [Jamie]
- New translations en.json (Russian) [Jamie]
- New translations en.json (Russian) [Jamie]
- New translations en.json (Russian) [Jamie]
- New translations en.json (Polish) [Jamie]
- Fixed the issue when we are logging errors in the logs incorrectly. [Jamie]
- Removed the lanuage profile from the Lidarr integration. [tidusjar]
- Try and clear up the issue #2998. [tidusjar]
- Fixed an issue where shows that have no aired, episodes are not marked as monitored in Sonarr. [tidusjar]
- Fixed an error when finishing the content sync. [tidusjar]
- Fixed issue where using the API to request a movie/tv show would throw an exception when only using the API Key #3091. [tidusjar]
- Put "Ombi" back as the product name for Plex oAuth. [tidusjar]
## v3.0.4680 (2019-07-17)
### **New Features**
- Update CHANGELOG.md. [Jamie]
### **Fixes**
- Fixed the database lock issues - [TidusJar]
- Fixed the issue with [Plex OAuth](https://forums.plex.tv/t/plex-oauth-not-working-with-tautulli-ombi-etc/433945) - [TidusJar]
- Fix Plex's (intentional) mistake #3073. [Jamie Rees]
- #2994 Fixed the startup issue. [tidusjar]
- #2994 - enable multithreading in the sql config. [Jamie Rees]
## v3.0.4659 (2019-07-02)
### **New Features**
- Added further logging into the API's (debug logging) [tidusjar]
- Update appsettings.json. [Jamie]
- Added transactions around all of the CUD operations. [Jamie Rees]
- Update CHANGELOG.md. [Jamie]
- Update stale.yml. [Jamie]
- Update README.md. [Dyson Parkes]
## v3.0.4654 (2019-07-02)
- Added stalebot. [tidusjar]
### **New Features**
- Added some validation around the new crons. [Jamie Rees]
- Added further logging into the API's (debug logging) [tidusjar]
- Added some defensive coding around when we create an artist for #2915. [tidusjar]
- Added transactions around all of the CUD operations. [Jamie Rees]
- Update README.md. [Jamie]
- Added some validation around the new crons. [Jamie Rees]
- Update README.md. [Jamie]
- Added some defensive coding around when we create an artist for #2915. [tidusjar]
- Update JobSetup.cs. [Jamie]
......@@ -40,10 +137,28 @@
- Update dependancies. [TidusJar]
- Update stale.yml. [Jamie]
- Update README.md. [Dyson Parkes]
- Update README.md. [Jamie]
- Update README.md. [Jamie]
- Update CHANGELOG.md. [Jamie]
- Added stalebot. [tidusjar]
### **Fixes**
- Add back in the login time. [tidusjar]
- New translations en.json (Spanish) [Jamie]
- New translations en.json (Spanish) [Jamie]
- New translations en.json (Spanish) [Jamie]
- New translations en.json (Spanish) [Jamie]
- New translations en.json (Swedish) [Jamie]
......@@ -322,6 +437,12 @@
- Converted the Plex Jobs to use Quartz. [Jamie]
- Remove the need for the schedules.db #2994. [tidusjar]
- Create FUNDING.yml. [Jamie]
- Logging and slight change to the string matching now not dependant on Thread Culture #2866. [tidusjar]
## v3.0.4256 (2019-02-19)
......
......@@ -46,6 +46,17 @@ namespace Ombi.Api.Emby
return obj;
}
public async Task<PublicInfo> GetPublicInformation(string baseUrl)
{
var request = new Request("emby/System/Info/public", baseUrl, HttpMethod.Get);
AddHeaders(request, string.Empty);
var obj = await Api.Request<PublicInfo>(request);
return obj;
}
public async Task<EmbyUser> LogIn(string username, string password, string apiKey, string baseUri)
{
var request = new Request("emby/users/authenticatebyname", baseUri, HttpMethod.Post);
......@@ -124,6 +135,7 @@ namespace Ombi.Api.Emby
{
return await GetInformation<MovieInformation>(mediaId, apiKey, userId, baseUrl);
}
public async Task<EpisodeInformation> GetEpisodeInformation(string mediaId, string apiKey, string userId, string baseUrl)
{
return await GetInformation<EpisodeInformation>(mediaId, apiKey, userId, baseUrl);
......
......@@ -29,5 +29,6 @@ namespace Ombi.Api.Emby
Task<SeriesInformation> GetSeriesInformation(string mediaId, string apiKey, string userId, string baseUrl);
Task<MovieInformation> GetMovieInformation(string mediaId, string apiKey, string userId, string baseUrl);
Task<EpisodeInformation> GetEpisodeInformation(string mediaId, string apiKey, string userId, string baseUrl);
Task<PublicInfo> GetPublicInformation(string baseUrl);
}
}
\ No newline at end of file
namespace Ombi.Api.Emby.Models
{
public class PublicInfo
{
public string LocalAddress { get; set; }
public string ServerName { get; set; }
public string Version { get; set; }
/// <summary>
/// Only populated for Jellyfin
/// </summary>
public string ProductName { get; set; }
public bool IsJellyfin => !string.IsNullOrEmpty(ProductName) && ProductName.Contains("Jellyfin");
public string OperatingSystem { get; set; }
public string Id { get; set; }
}
}
\ No newline at end of file
......@@ -20,7 +20,6 @@ namespace Ombi.Api.Lidarr
Task<AlbumResponse> MontiorAlbum(int albumId, string apiKey, string baseUrl);
Task<List<AlbumResponse>> GetAllAlbumsByArtistId(int artistId, string apiKey, string baseUrl);
Task<List<MetadataProfile>> GetMetadataProfile(string apiKey, string baseUrl);
Task<List<LanguageProfiles>> GetLanguageProfile(string apiKey, string baseUrl);
Task<LidarrStatus> Status(string apiKey, string baseUrl);
Task<CommandResult> AlbumSearch(int[] albumIds, string apiKey, string baseUrl);
Task<AlbumByForeignId> AlbumInformation(string albumId, string apiKey, string baseUrl);
......
......@@ -158,13 +158,6 @@ namespace Ombi.Api.Lidarr
return Api.Request<List<AlbumResponse>>(request);
}
public Task<List<LanguageProfiles>> GetLanguageProfile(string apiKey, string baseUrl)
{
var request = new Request($"{ApiVersion}/languageprofile", baseUrl, HttpMethod.Get);
AddHeaders(request, apiKey);
return Api.Request<List<LanguageProfiles>>(request);
}
public Task<List<MetadataProfile>> GetMetadataProfile(string apiKey, string baseUrl)
{
var request = new Request($"{ApiVersion}/metadataprofile", baseUrl, HttpMethod.Get);
......
......@@ -17,7 +17,6 @@ namespace Ombi.Api.Lidarr.Models
public Image[] images { get; set; }
public string remotePoster { get; set; }
public int qualityProfileId { get; set; }
public int languageProfileId { get; set; }
public int metadataProfileId { get; set; }
public bool albumFolder { get; set; }
public bool monitored { get; set; }
......
namespace Ombi.Api.Lidarr.Models
{
public class LanguageProfiles
{
public string name { get; set; }
public int id { get; set; }
}
}
\ No newline at end of file
......@@ -223,11 +223,11 @@ namespace Ombi.Api.Plex
await AddHeaders(request);
request.AddQueryString("code", code);
request.AddQueryString("context[device][product]", "Plex Web"); // Note this is to work around Plex's shit https://forums.plex.tv/t/plex-oauth-not-working-with-tautulli-ombi-etc/433945
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]", "Plex");
request.AddQueryString("context[device][device]", "Ombi");
var s = await GetSettings();
await CheckInstallId(s);
......@@ -293,9 +293,9 @@ namespace Ombi.Api.Plex
var s = await GetSettings();
await CheckInstallId(s);
request.AddHeader("X-Plex-Client-Identifier", s.InstallId.ToString("N"));
request.AddHeader("X-Plex-Product", "Plex Web");
request.AddHeader("X-Plex-Product", ApplicationName);
request.AddHeader("X-Plex-Version", "3");
request.AddHeader("X-Plex-Device", "Plex");
request.AddHeader("X-Plex-Device", "Ombi");
request.AddHeader("X-Plex-Platform", "Web");
request.AddContentHeader("Content-Type", request.ContentType == ContentType.Json ? "application/json" : "application/xml");
request.AddHeader("Accept", "application/json");
......
......@@ -17,6 +17,7 @@ using Ombi.Api.Lidarr.Models;
using Ombi.Core.Authentication;
using Ombi.Core.Settings;
using Ombi.Helpers;
using Ombi.Core.Helpers;
using Ombi.Settings.Settings.Models;
using Ombi.Settings.Settings.Models.External;
using Ombi.Store.Entities;
......@@ -166,7 +167,7 @@ namespace Ombi.Core.Engine
Rating = a.ratings?.value ?? 0m,
ReleaseDate = a.releaseDate,
Title = a.title,
Disk = a.images?.FirstOrDefault(x => x.coverType.Equals("disc"))?.url?.Replace("http", "https"),
Disk = a.images?.FirstOrDefault(x => x.coverType.Equals("disc"))?.url?.ToHttpsUrl(),
Genres = a.genres,
AlbumType = a.albumType,
ArtistName = a.artist.artistName,
......@@ -187,7 +188,7 @@ namespace Ombi.Core.Engine
//vm.ArtistName = a.artist?.artistName;
}
vm.Cover = a.images?.FirstOrDefault(x => x.coverType.Equals("cover"))?.url?.Replace("http", "https");
vm.Cover = a.images?.FirstOrDefault(x => x.coverType.Equals("cover"))?.url?.ToHttpsUrl();
await Rules.StartSpecificRules(vm, SpecificRules.LidarrAlbum);
......@@ -205,7 +206,7 @@ namespace Ombi.Core.Engine
Rating = a.ratings?.value ?? 0m,
ReleaseDate = a.releaseDate,
Title = a.title,
Disk = a.images?.FirstOrDefault(x => x.coverType.Equals("disc"))?.url?.Replace("http", "https"),
Disk = a.images?.FirstOrDefault(x => x.coverType.Equals("disc"))?.url?.ToHttpsUrl(),
Genres = a.genres
};
if (a.artistId > 0)
......@@ -223,7 +224,7 @@ namespace Ombi.Core.Engine
vm.ArtistName = a.artist?.artistName;
}
vm.Cover = a.images?.FirstOrDefault(x => x.coverType.Equals("cover"))?.url?.Replace("http", "https");
vm.Cover = a.images?.FirstOrDefault(x => x.coverType.Equals("cover"))?.url?.ToHttpsUrl();
if (vm.Cover.IsNullOrEmpty())
{
vm.Cover = a.remoteCover;
......
using System.Security.Principal;
using System;
using System.Security.Principal;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Ombi.Core.Authentication;
......@@ -23,8 +24,8 @@ namespace Ombi.Core.Rule.Rules.Request
public async Task<RuleResult> Execute(BaseRequest obj)
{
var user = await _manager.Users.FirstOrDefaultAsync(x => x.UserName == User.Identity.Name);
if (await _manager.IsInRoleAsync(user, OmbiRoles.Admin))
var user = await _manager.Users.FirstOrDefaultAsync(x => x.UserName.Equals(User.Identity.Name, StringComparison.InvariantCultureIgnoreCase));
if (await _manager.IsInRoleAsync(user, OmbiRoles.Admin) || user.IsSystemUser)
{
obj.Approved = true;
return Success();
......
using System;
using Ombi.Store.Entities;
using System.IO;
using System.Security.Claims;
......@@ -25,8 +26,8 @@ namespace Ombi.Core.Rule.Rules.Request
public async Task<RuleResult> Execute(BaseRequest obj)
{
var user = await _manager.Users.FirstOrDefaultAsync(x => x.UserName == User.Identity.Name);
if (await _manager.IsInRoleAsync(user, OmbiRoles.Admin))
var user = await _manager.Users.FirstOrDefaultAsync(x => x.UserName.Equals(User.Identity.Name, StringComparison.InvariantCultureIgnoreCase));
if (await _manager.IsInRoleAsync(user, OmbiRoles.Admin) || user.IsSystemUser)
return Success();
if (obj.RequestType == RequestType.Movie)
......
......@@ -68,11 +68,11 @@ namespace Ombi.Core.Rule.Rules.Search
var server = s.Servers.FirstOrDefault(x => x.ServerHostname != null);
if ((server?.ServerHostname ?? string.Empty).HasValue())
{
obj.EmbyUrl = $"{server.ServerHostname}#!/itemdetails.html?id={item.EmbyId}";
obj.EmbyUrl = EmbyHelper.GetEmbyMediaUrl(item.EmbyId, server?.ServerHostname, s.IsJellyfin);
}
else
{
obj.EmbyUrl = $"https://app.emby.media/#!/itemdetails.html?id={item.EmbyId}";
obj.EmbyUrl = EmbyHelper.GetEmbyMediaUrl(item.EmbyId, null, s.IsJellyfin);
}
if (obj.Type == RequestType.TvShow)
......
......@@ -50,7 +50,7 @@ namespace Ombi.Core.Rule.Rules.Specific
}
}
if (await UserManager.IsInRoleAsync(requestedUser, OmbiRoles.Admin))
if (await UserManager.IsInRoleAsync(requestedUser, OmbiRoles.Admin) || requestedUser.IsSystemUser)
{
sendNotification = false; // Don't bother sending a notification if the user is an admin
}
......
......@@ -110,7 +110,6 @@ namespace Ombi.Core.Senders
artistName = model.ArtistName,
cleanName = model.ArtistName.ToLowerInvariant().RemoveSpaces(),
images = new Image[] { },
languageProfileId = settings.LanguageProfileId,
links = new Link[] {},
metadataProfileId = settings.MetadataProfileId,
qualityProfileId = qualityToUse,
......
......@@ -346,6 +346,11 @@ namespace Ombi.Core.Senders
existingSeason.monitored = true;
seriesChanges = true;
}
// Now update the episodes that need updating
foreach (var epToUpdate in episodesToUpdate.Where(x => x.seasonNumber == season.SeasonNumber))
{
await SonarrApi.UpdateEpisode(epToUpdate, s.ApiKey, s.FullUri);
}
}
else
{
......
using NUnit.Framework;
namespace Ombi.Helpers.Tests
{
[TestFixture]
public class StringHelperTests
{
[Test]
public void ToHttpsUrl_ShouldReturnsHttpsUrl_HttpUrl()
{
var sourceUrl = "http://www.test.url";
var expectedUrl = "https://www.test.url";
Assert.AreEqual(expectedUrl, sourceUrl.ToHttpsUrl(), "Should return the source URL as https");
}
[Test]
public void ToHttpsUrl_ShouldReturnsUnchangedUrl_HttpsUrl()
{
var sourceUrl = "https://www.test.url";
var expectedUrl = "https://www.test.url";
Assert.AreEqual(expectedUrl, sourceUrl.ToHttpsUrl(), "Should return the unchanged https URL");
}
[Test]
public void ToHttpsUrl_ShouldReturnsUnchangedUrl_NonHttpUrl()
{
var sourceUrl = "ftp://www.test.url";
var expectedUrl = "ftp://www.test.url";
Assert.AreEqual(expectedUrl, sourceUrl.ToHttpsUrl(), "Should return the unchanged non-http URL");
}
[Test]
public void ToHttpsUrl_ShouldReturnsUnchangedUrl_InvalidUrl()
{
var sourceUrl = "http:/www.test.url";
var expectedUrl = "http:/www.test.url";
Assert.AreEqual(expectedUrl, sourceUrl.ToHttpsUrl(), "Should return the unchanged invalid URL");
}
}
}
\ No newline at end of file
using System;
using System.Globalization;
using System.Collections.Generic;
using System.Text;
namespace Ombi.Helpers
namespace Ombi.Helpers
{
public class EmbyHelper
{
public static string GetEmbyMediaUrl(string mediaId, string customerServerUrl = null)
public static string GetEmbyMediaUrl(string mediaId, string customerServerUrl = null, bool isJellyfin = false)
{
string path = "item/item";
if (isJellyfin)
{
path = "itemdetails";
}
if (customerServerUrl.HasValue())
{
return $"{customerServerUrl}#!/itemdetails.html?id={mediaId}";
return $"{customerServerUrl}#!/{path}.html?id={mediaId}";
}
else
{
return $"https://app.emby.media/#!/itemdetails.html?id={mediaId}";
return $"https://app.emby.media/#!/{path}.html?id={mediaId}";
}
}
}
......
......@@ -128,5 +128,10 @@ namespace Ombi.Helpers
{
return string.Concat(str.Where(c => !chars.Contains(c)));
}
public static string ToHttpsUrl(this string currentUrl)
{
return currentUrl.Replace("http://", "https://");
}
}
}
\ No newline at end of file
......@@ -29,7 +29,7 @@ namespace Ombi.Mapping.Profiles
.ForMember(dest => dest.Runtime, opts => opts.MapFrom(src => src.show.runtime.ToString()))
.ForMember(dest => dest.SeriesId, opts => opts.MapFrom(src => src.show.id))
.ForMember(dest => dest.Title, opts => opts.MapFrom(src => src.show.name))
.ForMember(dest => dest.Banner, opts => opts.MapFrom(src => !string.IsNullOrEmpty(src.show.image.medium) ? src.show.image.medium.Replace("http", "https") : string.Empty))
.ForMember(dest => dest.Banner, opts => opts.MapFrom(src => !string.IsNullOrEmpty(src.show.image.medium) ? src.show.image.medium.ToHttpsUrl() : string.Empty))
.ForMember(dest => dest.Status, opts => opts.MapFrom(src => src.show.status));
CreateMap<TvMazeShow, SearchTvShowViewModel>()
......@@ -46,7 +46,7 @@ namespace Ombi.Mapping.Profiles
.ForMember(dest => dest.Title, opts => opts.MapFrom(src => src.name))
.ForMember(dest => dest.Banner,
opts => opts.MapFrom(src => !string.IsNullOrEmpty(src.image.medium)
? src.image.medium.Replace("http", "https")
? src.image.medium.ToHttpsUrl()
: string.Empty))
.ForMember(dest => dest.Status, opts => opts.MapFrom(src => src.status));
......
......@@ -12,6 +12,7 @@ using Ombi.Notifications.Models;
using Ombi.Settings.Settings.Models;
using Ombi.Settings.Settings.Models.Notifications;
using Ombi.Store.Entities;
using Ombi.Store.Entities.Requests;
using Ombi.Store.Repository;
using Ombi.Store.Repository.Requests;
......@@ -21,13 +22,14 @@ namespace Ombi.Notifications.Agents
{
public MobileNotification(IOneSignalApi api, ISettingsService<MobileNotificationSettings> sn, ILogger<MobileNotification> log, INotificationTemplatesRepository r,
IMovieRequestRepository m, ITvRequestRepository t, ISettingsService<CustomizationSettings> s, IRepository<NotificationUserId> notification,
UserManager<OmbiUser> um, IRepository<RequestSubscription> sub, IMusicRequestRepository music,
UserManager<OmbiUser> um, IRepository<RequestSubscription> sub, IMusicRequestRepository music, IRepository<Issues> issueRepository,
IRepository<UserNotificationPreferences> userPref) : base(sn, r, m, t, s, log, sub, music, userPref)
{
_api = api;
_logger = log;
_notifications = notification;
_userManager = um;
_issueRepository = issueRepository;
}
public override string NotificationName => "MobileNotification";
......@@ -36,6 +38,7 @@ namespace Ombi.Notifications.Agents
private readonly ILogger<MobileNotification> _logger;
private readonly IRepository<NotificationUserId> _notifications;
private readonly UserManager<OmbiUser> _userManager;
private readonly IRepository<Issues> _issueRepository;
protected override bool ValidateConfiguration(MobileNotificationSettings settings)
{
......@@ -95,8 +98,9 @@ namespace Ombi.Notifications.Agents
var isAdmin = bool.Parse(isAdminString);
if (isAdmin)
{
model.Substitutes.TryGetValue("IssueId", out var issueId);
// Send to user
var playerIds = GetUsers(model, NotificationType.IssueComment);
var playerIds = await GetUsersForIssue(model, int.Parse(issueId), NotificationType.IssueComment);
await Send(playerIds, notification, settings, model);
}
else
......@@ -250,6 +254,7 @@ namespace Ombi.Notifications.Agents
}
return playerIds;
}
private List<string> GetUsers(NotificationOptions model, NotificationType type)
{
var notificationIds = new List<NotificationUserId>();
......@@ -261,14 +266,36 @@ namespace Ombi.Notifications.Agents
}
if (model.UserId.HasValue() && (!notificationIds?.Any() ?? true))
{
var user= _userManager.Users.Include(x => x.NotificationUserIds).FirstOrDefault(x => x.Id == model.UserId);
var user = _userManager.Users.Include(x => x.NotificationUserIds).FirstOrDefault(x => x.Id == model.UserId);
notificationIds = user.NotificationUserIds;
}
if (!notificationIds?.Any() ?? true)
{
_logger.LogInformation(
$"there are no admins to send a notification for {type}, for agent {NotificationAgent.Mobile}");
$"there are no users to send a notification for {type}, for agent {NotificationAgent.Mobile}");
return null;
}
var playerIds = notificationIds.Select(x => x.PlayerId).ToList();
return playerIds;
}
private async Task<List<string>> GetUsersForIssue(NotificationOptions model, int issueId, NotificationType type)
{
var notificationIds = new List<NotificationUserId>();
var issue = await _issueRepository.GetAll()
.FirstOrDefaultAsync(x => x.Id == issueId);
// Get the user that raised the issue to send the notification to
var userRaised = await _userManager.Users.Include(x => x.NotificationUserIds).FirstOrDefaultAsync(x => x.Id == issue.UserReportedId);
notificationIds = userRaised.NotificationUserIds;
if (!notificationIds?.Any() ?? true)
{
_logger.LogInformation(
$"there are no users to send a notification for {type}, for agent {NotificationAgent.Mobile}");
return null;
}
var playerIds = notificationIds.Select(x => x.PlayerId).ToList();
......
......@@ -45,11 +45,11 @@ namespace Ombi.Schedule.Jobs.Emby
{
try
{
await StartServerCache(server);
await StartServerCache(server, embySettings);
}
catch (Exception e)
{
_logger.LogError(e, "Exception when caching Emby for server {0}", server.Name);
_logger.LogError(e, "Exception when caching {1} for server {0}", server.Name, embySettings.IsJellyfin ? "Jellyfin" : "Emby");
}
}
......@@ -60,7 +60,7 @@ namespace Ombi.Schedule.Jobs.Emby
}
private async Task StartServerCache(EmbyServers server)
private async Task StartServerCache(EmbyServers server, EmbySettings settings)
{
if (!ValidateSettings(server))
return;
......@@ -135,7 +135,7 @@ namespace Ombi.Schedule.Jobs.Emby
Title = tvShow.Name,
Type = EmbyMediaType.Series,
EmbyId = tvShow.Id,
Url = EmbyHelper.GetEmbyMediaUrl(tvShow.Id, server.ServerHostname),
Url = EmbyHelper.GetEmbyMediaUrl(tvShow.Id, server.ServerHostname, settings.IsJellyfin),
AddedAt = DateTime.UtcNow
});
}
......
......@@ -682,7 +682,7 @@ namespace Ombi.Schedule.Jobs.Ombi
var banner = info.image?.original;
if (!string.IsNullOrEmpty(banner))
{
banner = banner.Replace("http", "https"); // Always use the Https banners
banner = banner.ToHttpsUrl(); // Always use the Https banners
}
var tvInfo = await _movieApi.GetTVInfo(t.TheMovieDbId);
......@@ -804,7 +804,7 @@ namespace Ombi.Schedule.Jobs.Ombi
var banner = info.image?.original;
if (!string.IsNullOrEmpty(banner))
{
banner = banner.Replace("http", "https"); // Always use the Https banners
banner = banner.ToHttpsUrl(); // Always use the Https banners
}
var tvInfo = await _movieApi.GetTVInfo(t.TheMovieDbId);
......
......@@ -21,6 +21,7 @@ using Ombi.Store.Entities;
using Ombi.Store.Repository;
using Ombi.Updater;
using Quartz;
using SharpCompress.Common;