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.
pull/1267/head
tidusjar 8 years ago
parent 9ca3ee4058
commit 2b27559277

@ -53,9 +53,9 @@ namespace Ombi.Core.Migration.Migrations
}
public int Version => 22000;
private ISettingsService<CustomizationSettings> Customization { get; }
private ISettingsService<CustomizationSettings> Customization { get; }
private ISettingsService<PlexSettings> PlexSettings { get; }
private IRepository<RecentlyAddedLog> Log { get; }
private IRepository<RecentlyAddedLog> Log { get; }
private IRepository<PlexContent> PlexContent { get; }
private IRepository<PlexEpisodes> PlexEpisodes { get; }
@ -68,6 +68,7 @@ namespace Ombi.Core.Migration.Migrations
AddNewColumns(con);
UpdateSchema(con, Version);
UpdateRecentlyAdded(con);
}
private void UpdateRecentlyAdded(IDbConnection con)
@ -124,10 +125,9 @@ namespace Ombi.Core.Migration.Migrations
{
var settings = Customization.GetSettings();
settings.EnableIssues = true;
settings.EnableIssues = true;
settings.EnableNetflixResults = true;
Customization.SaveSettings(settings);
}
}
}

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

@ -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);

@ -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,

@ -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) {

@ -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>

@ -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 />

Loading…
Cancel
Save