Added a new setting for the Netflix option, we can now disable it appearing in the search.

Stopped the Emby newsletter sending out all TV shows every time.
This commit is contained in:
tidusjar 2017-03-18 22:00:52 +00:00
parent 9ca3ee4058
commit 2b27559277
7 changed files with 16 additions and 8 deletions

View file

@ -68,6 +68,7 @@ namespace Ombi.Core.Migration.Migrations
AddNewColumns(con);
UpdateSchema(con, Version);
UpdateRecentlyAdded(con);
}
private void UpdateRecentlyAdded(IDbConnection con)
@ -125,9 +126,8 @@ namespace Ombi.Core.Migration.Migrations
var settings = Customization.GetSettings();
settings.EnableIssues = true;
settings.EnableNetflixResults = true;
Customization.SaveSettings(settings);
}
}
}

View file

@ -55,6 +55,6 @@ namespace Ombi.Core.SettingModels
public bool NewSearch { get; set; }
public bool EnableIssues { get; set; }
public bool EnableNetflixResults { get; set; }
}
}

View file

@ -116,6 +116,7 @@ namespace Ombi.Services.Jobs.RecentlyAddedNewsletter
var filteredMovies = movie.Where(m => recentlyAdded.All(x => x.ProviderId != m.ProviderId)).ToList();
var filteredEp = episodes.Where(m => recentlyAdded.All(x => x.ProviderId != m.ProviderId)).ToList();
var filteredSeries = series.Where(m => recentlyAdded.All(x => x.ProviderId != m.ProviderId)).ToList();
var info = new List<EmbyRecentlyAddedModel>();
foreach (var m in filteredMovies)
@ -133,7 +134,7 @@ namespace Ombi.Services.Jobs.RecentlyAddedNewsletter
newsletter.MovieCount = info.Count;
info.Clear();
foreach (var t in series)
foreach (var t in filteredSeries)
{
var i = Api.GetInformation(t.EmbyId, Ombi.Api.Models.Emby.EmbyMediaType.Series,
embySettings.ApiKey, embySettings.AdministratorId, embySettings.FullUri);

View file

@ -49,7 +49,8 @@ using PlexMediaType = Ombi.Store.Models.Plex.PlexMediaType;
namespace Ombi.Services.Jobs.RecentlyAddedNewsletter
{
public class PlexRecentlyAddedNewsletter : HtmlTemplateGenerator, IPlexNewsletter
public class
PlexRecentlyAddedNewsletter : HtmlTemplateGenerator, IPlexNewsletter
{
public PlexRecentlyAddedNewsletter(IPlexApi api, ISettingsService<PlexSettings> plexSettings,
ISettingsService<EmailNotificationSettings> email,

View file

@ -24,6 +24,7 @@ Function.prototype.bind = function (parent) {
$(function () {
var netflixEnabled = $('#enableNetflix').text() == 'True';
var useNewSearch = $('#useNewSearch').text() == 'True';
var searchSource = useNewSearch ? $("#search-templateNew").html() : $("#search-template").html();
var seasonsSource = $("#seasons-template").html();
@ -416,6 +417,9 @@ $(function () {
};
function checkNetflix(title, id) {
if (!netflixEnabled) {
return;
}
var url = createBaseUrl(base, '/searchextension/netflix/' + title);
$.ajax(url).success(function (results) {

View file

@ -106,6 +106,7 @@
@*@Html.Checkbox(Model.Settings.NewSearch, "NewSearch", "Use New Search")*@
@Html.Checkbox(Model.Settings.EnableIssues, "EnableIssues", "Enable Issues")
@Html.Checkbox(Model.Settings.EnableNetflixResults, "EnableNetflixResults", "Enable Netflix results to be shown in the search")
<div class="form-group">
<div>
<button type="submit" id="save" class="btn btn-primary-outline">Submit</button>

View file

@ -14,6 +14,7 @@
<div>
<div hidden="hidden" id="useNewSearch">@Model.CustomizationSettings.NewSearch</div>
<div hidden="hidden" id="enableNetflix">@Model.CustomizationSettings.EnableNetflixResults</div>
<h1 id="searchTitle">@UI.Search_Title</h1>
<h4>@string.Format(UI.Search_Paragraph, Model.Emby ? "Emby" : "Plex")</h4>
<br />