From 53cfb29130814b4d31611d4a7d842c6940b6b4a5 Mon Sep 17 00:00:00 2001 From: SuperPotatoMen Date: Mon, 13 Mar 2017 00:29:38 +0100 Subject: [PATCH 1/5] Fix for #1236 Fixing the broken link to app.plex.tv for the "view in plex" button --- Ombi.Helpers/PlexHelper.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Ombi.Helpers/PlexHelper.cs b/Ombi.Helpers/PlexHelper.cs index 6282687de..919c2424f 100644 --- a/Ombi.Helpers/PlexHelper.cs +++ b/Ombi.Helpers/PlexHelper.cs @@ -99,7 +99,7 @@ namespace Ombi.Helpers public static string GetPlexMediaUrl(string machineId, string mediaId) { var url = - $"https://app.plex.tv/web/app#!/server/{machineId}/details/%2Flibrary%2Fmetadata%2F{mediaId}"; + $"https://app.plex.tv/web/app#!/server/{machineId}/details?key=library%2Fmetadata%2F{mediaId}"; return url; } @@ -116,4 +116,4 @@ namespace Ombi.Helpers public int SeasonNumber { get; set; } public int EpisodeNumber { get; set; } } -} \ No newline at end of file +} From 83bb86de06162af9f10c3016515c18892bfd07b1 Mon Sep 17 00:00:00 2001 From: "Jamie.Rees" Date: Mon, 13 Mar 2017 09:05:33 +0000 Subject: [PATCH 2/5] Tooltips --- Ombi.UI/Helpers/BaseUrlHelper.cs | 8 ++++ Ombi.UI/Helpers/CustomHtmlHelper.cs | 5 +- Ombi.UI/Views/Admin/Authentication.cshtml | 46 +++++-------------- Ombi.UI/Views/Admin/Emby.cshtml | 4 +- Ombi.UI/Views/Admin/NewsletterSettings.cshtml | 19 ++++---- Ombi.UI/Views/Admin/Settings.cshtml | 37 ++++----------- .../Views/Customization/Customization.cshtml | 8 +++- Ombi.UI/Views/Shared/Partial/_Sidebar.cshtml | 4 ++ Ombi.UI/Views/SystemStatus/Status.cshtml | 17 ++++--- 9 files changed, 61 insertions(+), 87 deletions(-) diff --git a/Ombi.UI/Helpers/BaseUrlHelper.cs b/Ombi.UI/Helpers/BaseUrlHelper.cs index 5badfad5b..232cab766 100644 --- a/Ombi.UI/Helpers/BaseUrlHelper.cs +++ b/Ombi.UI/Helpers/BaseUrlHelper.cs @@ -363,6 +363,14 @@ namespace Ombi.UI.Helpers return helper.Raw(returnString); } + public static IHtmlString ToolTip(this HtmlHelpers helper, string tooltipText) + { + //< span class="customTooltip" title="It also requires users to have the Newsletter feature"> + return + helper.Raw( + $""); + } + public static IHtmlString GetBaseUrl(this HtmlHelpers helper) { return helper.Raw(GetBaseUrl()); diff --git a/Ombi.UI/Helpers/CustomHtmlHelper.cs b/Ombi.UI/Helpers/CustomHtmlHelper.cs index 1f76cd371..14f401169 100644 --- a/Ombi.UI/Helpers/CustomHtmlHelper.cs +++ b/Ombi.UI/Helpers/CustomHtmlHelper.cs @@ -41,13 +41,14 @@ namespace Ombi.UI.Helpers return helper.Raw(htmlString); } - public static IHtmlString Checkbox(this HtmlHelpers helper, bool check, string name, string display) + public static IHtmlString Checkbox(this HtmlHelpers helper, bool check, string name, string display, string tooltipText = null) { var sb = new StringBuilder(); sb.AppendLine("
"); sb.AppendLine("
"); - sb.AppendFormat("", name, display, check ? "checked=\"checked\"" : string.Empty); + sb.AppendFormat("", name, display, check ? "checked=\"checked\"" : string.Empty, + string.IsNullOrEmpty(tooltipText) ? string.Empty : helper.ToolTip(tooltipText).ToHtmlString()); sb.AppendLine("
"); sb.AppendLine("
"); return helper.Raw(sb.ToString()); diff --git a/Ombi.UI/Views/Admin/Authentication.cshtml b/Ombi.UI/Views/Admin/Authentication.cshtml index 5c0a2dda2..c4654c56b 100644 --- a/Ombi.UI/Views/Admin/Authentication.cshtml +++ b/Ombi.UI/Views/Admin/Authentication.cshtml @@ -1,4 +1,5 @@ @using Ombi.UI.Helpers +@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase @Html.Partial("Shared/Partial/_Sidebar") @{ @@ -17,40 +18,11 @@
Authentication Settings - -
-
- - @if (Model.UserAuthentication) - { - - - } - else - { - - - } - -
-
- -
-
- - @if (Model.UsePassword) - { - - - } - else - { - - - } -
-
+ @Html.Checkbox(Model.UserAuthentication, "UserAuthentication", "Enable User Authentication", "If enabled we will check the login name against a user in your local users list or Plex/Emby users.") + + + @Html.Checkbox(Model.UsePassword, "UsePassword", "Require users to login with their passwords", "If enabled, users must provide a valid password to log into Ombi")
@@ -59,7 +31,9 @@
-

A comma separated list of users that you do not want to login.

+

A comma separated list of users that you do not want to login. + @Html.ToolTip("This is a 'blacklist', if you have users that you do not want to log in, enter them here!")

+
@@ -83,7 +57,9 @@ $(function () { var base = '@Html.GetBaseUrl()'; - + $('.customTooltip').tooltipster({ + contentCloning: true + }); changeDisabledStatus($('#UsePassword'), @Model.UserAuthentication.ToString().ToLower(), $('#passLabel')); diff --git a/Ombi.UI/Views/Admin/Emby.cshtml b/Ombi.UI/Views/Admin/Emby.cshtml index 7ebceaf14..3cdaf33a1 100644 --- a/Ombi.UI/Views/Admin/Emby.cshtml +++ b/Ombi.UI/Views/Admin/Emby.cshtml @@ -47,7 +47,8 @@
- @Html.Checkbox(Model.EnableEpisodeSearching, "EnableEpisodeSearching", "Enable Episode Searching") + @Html.Checkbox(Model.EnableEpisodeSearching, "EnableEpisodeSearching", "Enable Episode Searching") + @Html.ToolTip("This will allow Ombi to search through all of the episodes stored on Emby")
@@ -81,6 +82,7 @@ + \ No newline at end of file From 3843ace4f9d1b41ca837c547e3fd3e6b75714cba Mon Sep 17 00:00:00 2001 From: "Jamie.Rees" Date: Mon, 13 Mar 2017 12:31:37 +0000 Subject: [PATCH 4/5] #1218 changed the text when we cannot display release notes for dev and EAP branches. --- Ombi.Core/StatusChecker/StatusChecker.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Ombi.Core/StatusChecker/StatusChecker.cs b/Ombi.Core/StatusChecker/StatusChecker.cs index 11710f21b..ed86e4e54 100644 --- a/Ombi.Core/StatusChecker/StatusChecker.cs +++ b/Ombi.Core/StatusChecker/StatusChecker.cs @@ -168,7 +168,7 @@ namespace Ombi.Core.StatusChecker var model = new StatusModel { DownloadUri = downloadLink, - ReleaseNotes = $"{branchDisplay} (See recent commits for details)", + ReleaseNotes = $"{branchDisplay} (See Recent Changes tab for more details)", ReleaseTitle = $"Ombi {branchDisplay}", NewVersion = branchResult.build.version, UpdateUri = downloadLink, From 87b2272bdf101e898cfee514ce7cd624b7991c0f Mon Sep 17 00:00:00 2001 From: "Jamie.Rees" Date: Tue, 14 Mar 2017 08:07:08 +0000 Subject: [PATCH 5/5] Adding more logging into the Plex Cacher --- Ombi.Services/Jobs/PlexContentCacher.cs | 15 ++++++++++++--- Ombi.UI/Modules/SearchModule.cs | 7 +++---- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Ombi.Services/Jobs/PlexContentCacher.cs b/Ombi.Services/Jobs/PlexContentCacher.cs index 6878c3367..f5879b5df 100644 --- a/Ombi.Services/Jobs/PlexContentCacher.cs +++ b/Ombi.Services/Jobs/PlexContentCacher.cs @@ -201,6 +201,8 @@ namespace Ombi.Services.Jobs results = GetLibraries(plexSettings); if (plexSettings.AdvancedSearch) { + Log.Debug("Going through all the items now"); + Log.Debug($"Item count {results.Count}"); foreach (PlexSearch t in results) { foreach (Directory1 t1 in t.Directory) @@ -236,7 +238,7 @@ namespace Ombi.Services.Jobs } if (results != null) { - + Log.Debug("done all that, moving onto the DB now"); var movies = GetPlexMovies(results); // Time to destroy the plex movies from the DB @@ -279,6 +281,7 @@ namespace Ombi.Services.Jobs } } + Log.Debug("Done movies"); var tv = GetPlexTvShows(results); // Time to destroy the plex tv from the DB PlexContent.Custom(connection => @@ -319,7 +322,7 @@ namespace Ombi.Services.Jobs }); } } - + Log.Debug("Done TV"); var albums = GetPlexAlbums(results); // Time to destroy the plex movies from the DB PlexContent.Custom(connection => @@ -360,10 +363,13 @@ namespace Ombi.Services.Jobs }); } } + Log.Debug("Done albums"); } } catch (Exception ex) { + Log.Debug("Exception:"); + Log.Debug(ex); Log.Error(ex, "Failed to obtain Plex libraries"); } @@ -372,8 +378,10 @@ namespace Ombi.Services.Jobs private List GetLibraries(PlexSettings plexSettings) { + Log.Debug("Getting Lib sections"); var sections = PlexApi.GetLibrarySections(plexSettings.PlexAuthToken, plexSettings.FullUri); - + + Log.Debug("Going through sections now"); var libs = new List(); if (sections != null) { @@ -382,6 +390,7 @@ namespace Ombi.Services.Jobs var lib = PlexApi.GetLibrary(plexSettings.PlexAuthToken, plexSettings.FullUri, dir.Key); if (lib != null) { + Log.Debug("adding lib"); libs.Add(lib); } } diff --git a/Ombi.UI/Modules/SearchModule.cs b/Ombi.UI/Modules/SearchModule.cs index dcc2b13d2..c321f4724 100644 --- a/Ombi.UI/Modules/SearchModule.cs +++ b/Ombi.UI/Modules/SearchModule.cs @@ -185,14 +185,13 @@ namespace Ombi.UI.Modules private static Logger Log = LogManager.GetCurrentClassLogger(); private long _plexMovieCacheTime = 0; - private IEnumerable _plexMovies = null; + private IEnumerable _plexMovies; private long _embyMovieCacheTime = 0; - private IEnumerable _embyMovies = null; - + private IEnumerable _embyMovies; private long _dbMovieCacheTime = 0; - private Dictionary _dbMovies = null; + private Dictionary _dbMovies; private async Task RequestLoad() {