Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

approve tv shows or movies #92

Merged
merged 1 commit into from
Mar 25, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion PlexRequests.Core/SettingModels/PlexRequestSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ public class PlexRequestSettings : Settings

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; }
}
}
3 changes: 2 additions & 1 deletion PlexRequests.Core/Setup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ private void CreateDefaultSettingsPage()
{
var defaultSettings = new PlexRequestSettings
{
RequireApproval = true,
RequireTvShowApproval = true,
RequireMovieApproval = true,
SearchForMovies = true,
SearchForTvShows = true,
WeeklyRequestLimit = 0
Expand Down
4 changes: 2 additions & 2 deletions PlexRequests.UI/Modules/SearchModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ private Response RequestMovie(int movieId)

var settings = PrService.GetSettings();
Log.Trace(settings.DumpJson());
if (!settings.RequireApproval)
if (!settings.RequireMovieApproval)
{
var cpSettings = CpService.GetSettings();

Expand Down Expand Up @@ -324,7 +324,7 @@ private Response RequestTvShow(int showId, string seasons)
model.SeasonList = seasonsList.ToArray();

var settings = PrService.GetSettings();
if (!settings.RequireApproval)
if (!settings.RequireTvShowApproval)
{
var sonarrSettings = SonarrService.GetSettings();
var sender = new TvSender(SonarrApi, SickrageApi);
Expand Down
3 changes: 2 additions & 1 deletion PlexRequests.UI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
using PlexRequests.Helpers;
using PlexRequests.Store;
using PlexRequests.Store.Repository;
using System.Diagnostics;

namespace PlexRequests.UI
{
Expand Down Expand Up @@ -68,7 +69,7 @@ static void Main(string[] args)
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"
};
Expand Down
21 changes: 18 additions & 3 deletions PlexRequests.UI/Views/Admin/Settings.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down