diff --git a/src/Ombi.Helpers/EmbyHelper.cs b/src/Ombi.Helpers/EmbyHelper.cs index 567bcfe7e..a9967f21f 100644 --- a/src/Ombi.Helpers/EmbyHelper.cs +++ b/src/Ombi.Helpers/EmbyHelper.cs @@ -7,11 +7,16 @@ namespace Ombi.Helpers { public class EmbyHelper { - public static string GetEmbyMediaUrl(string mediaId) + public static string GetEmbyMediaUrl(string mediaId, string customerServerUrl = null) { - var url = - $"http://app.emby.media/#!/itemdetails.html?id={mediaId}"; - return url; + if (customerServerUrl.HasValue()) + { + return $"{customerServerUrl}#!/itemdetails.html?id={mediaId}"; + } + else + { + return $"https://app.emby.media/#!/itemdetails.html?id={mediaId}"; + } } } } diff --git a/src/Ombi.Schedule/Jobs/Emby/EmbyContentSync.cs b/src/Ombi.Schedule/Jobs/Emby/EmbyContentSync.cs index 7002eec41..4972f940f 100644 --- a/src/Ombi.Schedule/Jobs/Emby/EmbyContentSync.cs +++ b/src/Ombi.Schedule/Jobs/Emby/EmbyContentSync.cs @@ -87,7 +87,7 @@ namespace Ombi.Schedule.Jobs.Emby await _api.GetCollection(movie.Id, server.ApiKey, server.AdministratorId, server.FullUri); foreach (var item in movieInfo.Items) { - await ProcessMovies(item, mediaToAdd); + await ProcessMovies(item, mediaToAdd, server); } processed++; @@ -96,7 +96,7 @@ namespace Ombi.Schedule.Jobs.Emby { processed++; // Regular movie - await ProcessMovies(movie, mediaToAdd); + await ProcessMovies(movie, mediaToAdd, server); } } @@ -138,7 +138,7 @@ namespace Ombi.Schedule.Jobs.Emby Title = tvShow.Name, Type = EmbyMediaType.Series, EmbyId = tvShow.Id, - Url = EmbyHelper.GetEmbyMediaUrl(tvShow.Id), + Url = EmbyHelper.GetEmbyMediaUrl(tvShow.Id, server.ServerHostname), AddedAt = DateTime.UtcNow }); } @@ -164,7 +164,7 @@ namespace Ombi.Schedule.Jobs.Emby await _repo.AddRange(mediaToAdd); } - private async Task ProcessMovies(EmbyMovie movieInfo, ICollection content) + private async Task ProcessMovies(EmbyMovie movieInfo, ICollection content, EmbyServers server) { // Check if it exists var existingMovie = await _repo.GetByEmbyId(movieInfo.Id); @@ -179,7 +179,7 @@ namespace Ombi.Schedule.Jobs.Emby Title = movieInfo.Name, Type = EmbyMediaType.Movie, EmbyId = movieInfo.Id, - Url = EmbyHelper.GetEmbyMediaUrl(movieInfo.Id), + Url = EmbyHelper.GetEmbyMediaUrl(movieInfo.Id, server.ServerHostname), AddedAt = DateTime.UtcNow, }); } diff --git a/src/Ombi.Settings/Settings/Models/External/EmbySettings.cs b/src/Ombi.Settings/Settings/Models/External/EmbySettings.cs index 96df77281..595733dc1 100644 --- a/src/Ombi.Settings/Settings/Models/External/EmbySettings.cs +++ b/src/Ombi.Settings/Settings/Models/External/EmbySettings.cs @@ -14,6 +14,7 @@ namespace Ombi.Core.Settings.Models.External public string Name { get; set; } public string ApiKey { get; set; } public string AdministratorId { get; set; } + public string ServerHostname { get; set; } public bool EnableEpisodeSearching { get; set; } } } \ No newline at end of file diff --git a/src/Ombi/ClientApp/app/interfaces/ISettings.ts b/src/Ombi/ClientApp/app/interfaces/ISettings.ts index 1f62a2c8d..070dabb8d 100644 --- a/src/Ombi/ClientApp/app/interfaces/ISettings.ts +++ b/src/Ombi/ClientApp/app/interfaces/ISettings.ts @@ -41,6 +41,7 @@ export interface IEmbyServer extends IExternalSettings { apiKey: string; administratorId: string; enableEpisodeSearching: boolean; + serverHostname: string; } export interface IPlexSettings extends ISettings { diff --git a/src/Ombi/ClientApp/app/settings/emby/emby.component.html b/src/Ombi/ClientApp/app/settings/emby/emby.component.html index ec966acf5..62188aaf6 100644 --- a/src/Ombi/ClientApp/app/settings/emby/emby.component.html +++ b/src/Ombi/ClientApp/app/settings/emby/emby.component.html @@ -63,6 +63,18 @@ + +
+ +
+ + Current URL: "{{server.serverHostname}}/#!/itemdetails.html?id=1" + Current URL: "https://app.emby.media/#!/itemdetails.html?id=1 +
+
diff --git a/src/Ombi/ClientApp/app/wizard/emby/emby.component.ts b/src/Ombi/ClientApp/app/wizard/emby/emby.component.ts index d7114e489..f22fa915b 100644 --- a/src/Ombi/ClientApp/app/wizard/emby/emby.component.ts +++ b/src/Ombi/ClientApp/app/wizard/emby/emby.component.ts @@ -41,6 +41,7 @@ export class EmbyComponent implements OnInit { port: 8096, ssl: false, subDir: "", + serverHostname: "", }); }