Merge pull request #95 from tidusjar/dev

Dev
pull/98/head^2 v1.5.1
Jamie 9 years ago
commit b7ce53c993

@ -32,7 +32,8 @@ namespace PlexRequests.Core.SettingModels
public bool SearchForMovies { get; set; }
public bool SearchForTvShows { get; set; }
public bool RequireApproval { get; set; }
public bool RequireMovieApproval { get; set; }
public bool RequireTvShowApproval { get; set; }
public int WeeklyRequestLimit { get; set; }
}
}

@ -62,7 +62,8 @@ namespace PlexRequests.Core
{
var defaultSettings = new PlexRequestSettings
{
RequireApproval = true,
RequireTvShowApproval = true,
RequireMovieApproval = true,
SearchForMovies = true,
SearchForTvShows = true,
WeeklyRequestLimit = 0

@ -468,7 +468,7 @@ namespace PlexRequests.UI.Modules
Log.Info("Saved email settings, result: {0}", result);
return Response.AsJson(result
? new JsonResponseModel { Result = true, Message = "Successfully Updated the Settings for Pushbullet Notifications!" }
? new JsonResponseModel { Result = true, Message = "Successfully Updated the Settings for Pushover Notifications!" }
: new JsonResponseModel { Result = false, Message = "Could not update the settings, take a look at the logs." });
}

@ -218,7 +218,7 @@ namespace PlexRequests.UI.Modules
var settings = PrService.GetSettings();
Log.Trace(settings.DumpJson());
if (!settings.RequireApproval)
if (!settings.RequireMovieApproval)
{
var cpSettings = CpService.GetSettings();
@ -234,6 +234,9 @@ namespace PlexRequests.UI.Modules
Log.Debug("Adding movie to database requests (No approval required)");
RequestService.AddRequest(model);
var notificationModel = new NotificationModel { Title = model.Title, User = model.RequestedBy, DateTime = DateTime.Now, NotificationType = NotificationType.NewRequest };
NotificationService.Publish(notificationModel);
return Response.AsJson(new JsonResponseModel { Result = true });
}
return Response.AsJson(new JsonResponseModel { Result = false, Message = "Something went wrong adding the movie to CouchPotato! Please check your settings." });
@ -324,7 +327,7 @@ namespace PlexRequests.UI.Modules
model.SeasonList = seasonsList.ToArray();
var settings = PrService.GetSettings();
if (!settings.RequireApproval)
if (!settings.RequireTvShowApproval)
{
var sonarrSettings = SonarrService.GetSettings();
var sender = new TvSender(SonarrApi, SickrageApi);
@ -339,6 +342,9 @@ namespace PlexRequests.UI.Modules
return Response.AsJson(new JsonResponseModel { Result = true });
}
var notify1 = new NotificationModel { Title = model.Title, User = model.RequestedBy, DateTime = DateTime.Now, NotificationType = NotificationType.NewRequest };
NotificationService.Publish(notify1);
return Response.AsJson(new JsonResponseModel { Result = false, Message = "Something went wrong adding the movie to Sonarr! Please check your settings." });
}
@ -353,6 +359,9 @@ namespace PlexRequests.UI.Modules
Log.Debug("Adding tv to database requests (No approval required & SickRage)");
RequestService.AddRequest(model);
var notify2 = new NotificationModel { Title = model.Title, User = model.RequestedBy, DateTime = DateTime.Now, NotificationType = NotificationType.NewRequest };
NotificationService.Publish(notify2);
return Response.AsJson(new JsonResponseModel { Result = true });
}
return Response.AsJson(new JsonResponseModel { Result = false, Message = result?.message != null ? "<b>Message From SickRage: </b>" + result.message : "Something went wrong adding the movie to SickRage! Please check your settings." });

@ -37,6 +37,7 @@ using PlexRequests.Core.SettingModels;
using PlexRequests.Helpers;
using PlexRequests.Store;
using PlexRequests.Store.Repository;
using System.Diagnostics;
namespace PlexRequests.UI
{
@ -68,7 +69,7 @@ namespace PlexRequests.UI
if (port == -1)
port = GetStartupPort();
var options = new StartOptions($"http://+:{port}")
var options = new StartOptions(Debugger.IsAttached ? $"http://localhost:{port}" : $"http://+:{port}")
{
ServerFactory = "Microsoft.Owin.Host.HttpListener"
};

@ -55,13 +55,28 @@
<div class="form-group">
<div class="checkbox">
<label>
@if (Model.RequireApproval)
@if (Model.RequireMovieApproval)
{
<input type="checkbox" id="RequireApproval" name="RequireApproval" checked="checked"><text>Require approval of requests</text>
<input type="checkbox" id="RequireMovieApproval" name="RequireMovieApproval" checked="checked"><text>Require approval of Movie requests</text>
}
else
{
<input type="checkbox" id="RequireApproval" name="RequireApproval"><text>Require approval of requests</text>
<input type="checkbox" id="RequireMovieApproval" name="RequireMovieApproval"><text>Require approval of Movie requests</text>
}
</label>
</div>
</div>
<div class="form-group">
<div class="checkbox">
<label>
@if (Model.RequireTvShowApproval)
{
<input type="checkbox" id="RequireTvShowApproval" name="RequireTvShowApproval" checked="checked"><text>Require approval of TV show requests</text>
}
else
{
<input type="checkbox" id="RequireTvShowApproval" name="RequireTvShowApproval"><text>Require approval of TV show requests</text>
}
</label>

@ -3,9 +3,9 @@ configuration: Release
assembly_info:
patch: true
file: '**\AssemblyInfo.*'
assembly_version: '1.5.0'
assembly_version: '1.5.1'
assembly_file_version: '{version}'
assembly_informational_version: '1.5.0'
assembly_informational_version: '1.5.1'
before_build:
- cmd: appveyor-retry nuget restore
build:

Loading…
Cancel
Save