diff --git a/PlexRequests.Core/SettingModels/HeadphonesSettings.cs b/PlexRequests.Core/SettingModels/HeadphonesSettings.cs index 0da4971d7..e77abca47 100644 --- a/PlexRequests.Core/SettingModels/HeadphonesSettings.cs +++ b/PlexRequests.Core/SettingModels/HeadphonesSettings.cs @@ -33,7 +33,7 @@ namespace PlexRequests.Core.SettingModels { public class HeadphonesSettings : Settings { - public string Enabled { get; set; } + public bool Enabled { get; set; } public string Ip { get; set; } public int Port { get; set; } public int ApiKey { get; set; } diff --git a/PlexRequests.Core/SettingModels/PlexRequestSettings.cs b/PlexRequests.Core/SettingModels/PlexRequestSettings.cs index aebb720af..76266cc07 100644 --- a/PlexRequests.Core/SettingModels/PlexRequestSettings.cs +++ b/PlexRequests.Core/SettingModels/PlexRequestSettings.cs @@ -36,8 +36,10 @@ namespace PlexRequests.Core.SettingModels public bool SearchForMovies { get; set; } public bool SearchForTvShows { get; set; } + public bool SearchForMusic { get; set; } public bool RequireMovieApproval { get; set; } public bool RequireTvShowApproval { get; set; } + public bool RequireMusicApproval { get; set; } public bool UsersCanViewOnlyOwnRequests { get; set; } public int WeeklyRequestLimit { get; set; } public string NoApprovalUsers { get; set; } diff --git a/PlexRequests.Store/RequestedModel.cs b/PlexRequests.Store/RequestedModel.cs index 34a9f181c..839968cd0 100644 --- a/PlexRequests.Store/RequestedModel.cs +++ b/PlexRequests.Store/RequestedModel.cs @@ -10,6 +10,11 @@ namespace PlexRequests.Store [Table("Requested")] public class RequestedModel : Entity { + public RequestedModel() + { + RequestedUsers = new List(); + } + // ReSharper disable once IdentifierTypo public int ProviderId { get; set; } public string ImdbId { get; set; } @@ -48,7 +53,8 @@ namespace PlexRequests.Store public enum RequestType { Movie, - TvShow + TvShow, + Album } public enum IssueState diff --git a/PlexRequests.UI/Content/custom.css b/PlexRequests.UI/Content/custom.css index 51130e9e9..b3b556265 100644 --- a/PlexRequests.UI/Content/custom.css +++ b/PlexRequests.UI/Content/custom.css @@ -140,6 +140,42 @@ label { #tvList .mix { display: none; } +.scroll-top-wrapper { + position: fixed; + opacity: 0; + visibility: hidden; + overflow: hidden; + text-align: center; + z-index: 99999999; + background-color: #4e5d6c; + color: #eeeeee; + width: 50px; + height: 48px; + line-height: 48px; + right: 30px; + bottom: 30px; + padding-top: 2px; + border-top-left-radius: 10px; + border-top-right-radius: 10px; + border-bottom-right-radius: 10px; + border-bottom-left-radius: 10px; + -webkit-transition: all 0.5s ease-in-out; + -moz-transition: all 0.5s ease-in-out; + -ms-transition: all 0.5s ease-in-out; + -o-transition: all 0.5s ease-in-out; + transition: all 0.5s ease-in-out; } + +.scroll-top-wrapper:hover { + background-color: #637689; } + +.scroll-top-wrapper.show { + visibility: visible; + cursor: pointer; + opacity: 1.0; } + +.scroll-top-wrapper i.fa { + line-height: inherit; } + .no-search-results { text-align: center; } @@ -150,4 +186,4 @@ label { .no-search-results .no-search-results-text { margin: 20px 0; color: #ccc; } - + diff --git a/PlexRequests.UI/Content/custom.scss b/PlexRequests.UI/Content/custom.scss index f2703ee4a..9b60351c7 100644 --- a/PlexRequests.UI/Content/custom.scss +++ b/PlexRequests.UI/Content/custom.scss @@ -1,4 +1,5 @@ $form-color: #4e5d6c; +$form-color-lighter: #637689; $primary-colour: #df691a; $primary-colour-outline: #ff761b; $info-colour: #5bc0de; @@ -175,13 +176,53 @@ label { } #movieList .mix { - display: none; + display: none; } #tvList .mix { - display: none; + display: none; } +$border-radius: 10px; + +.scroll-top-wrapper { + position: fixed; + opacity: 0; + visibility: hidden; + overflow: hidden; + text-align: center; + z-index: 99999999; + background-color: $form-color; + color: #eeeeee; + width: 50px; + height: 48px; + line-height: 48px; + right: 30px; + bottom: 30px; + padding-top: 2px; + border-top-left-radius: $border-radius; + border-top-right-radius: $border-radius; + border-bottom-right-radius: $border-radius; + border-bottom-left-radius: $border-radius; + -webkit-transition: all 0.5s ease-in-out; + -moz-transition: all 0.5s ease-in-out; + -ms-transition: all 0.5s ease-in-out; + -o-transition: all 0.5s ease-in-out; + transition: all 0.5s ease-in-out; +} +.scroll-top-wrapper:hover { + background-color: $form-color-lighter; +} +.scroll-top-wrapper.show { + visibility:visible; + cursor:pointer; + opacity: 1.0; +} +.scroll-top-wrapper i.fa { + line-height: inherit; +} + + .no-search-results { text-align: center; } @@ -194,4 +235,4 @@ label { .no-search-results .no-search-results-text { margin: 20px 0; color: #ccc; -} +} \ No newline at end of file diff --git a/PlexRequests.UI/Modules/AdminModule.cs b/PlexRequests.UI/Modules/AdminModule.cs index 87bc29da9..41716ba2f 100644 --- a/PlexRequests.UI/Modules/AdminModule.cs +++ b/PlexRequests.UI/Modules/AdminModule.cs @@ -59,7 +59,7 @@ namespace PlexRequests.UI.Modules { public class AdminModule : NancyModule { - private ISettingsService RpService { get; } + private ISettingsService PrService { get; } private ISettingsService CpService { get; } private ISettingsService AuthService { get; } private ISettingsService PlexService { get; } @@ -78,7 +78,7 @@ namespace PlexRequests.UI.Modules private INotificationService NotificationService { get; } private static Logger Log = LogManager.GetCurrentClassLogger(); - public AdminModule(ISettingsService rpService, + public AdminModule(ISettingsService prService, ISettingsService cpService, ISettingsService auth, ISettingsService plex, @@ -96,7 +96,7 @@ namespace PlexRequests.UI.Modules INotificationService notify, ISettingsService headphones) : base("admin") { - RpService = rpService; + PrService = prService; CpService = cpService; AuthService = auth; PlexService = plex; @@ -186,7 +186,7 @@ namespace PlexRequests.UI.Modules private Negotiator Admin() { - var settings = RpService.GetSettings(); + var settings = PrService.GetSettings(); Log.Trace("Getting Settings:"); Log.Trace(settings.DumpJson()); @@ -197,7 +197,7 @@ namespace PlexRequests.UI.Modules { var model = this.Bind(); - RpService.SaveSettings(model); + PrService.SaveSettings(model); return Context.GetRedirect("~/admin"); diff --git a/PlexRequests.UI/Modules/RequestsModule.cs b/PlexRequests.UI/Modules/RequestsModule.cs index f1cda331f..b1bfd1dcf 100644 --- a/PlexRequests.UI/Modules/RequestsModule.cs +++ b/PlexRequests.UI/Modules/RequestsModule.cs @@ -131,7 +131,8 @@ namespace PlexRequests.UI.Modules } var viewModel = dbTv.Select(tv => { - if (!string.IsNullOrEmpty(tv.RequestedBy) && !tv.RequestedUsers.Any(x => x.Equals(tv.RequestedBy, StringComparison.OrdinalIgnoreCase))) + if (!string.IsNullOrEmpty(tv.RequestedBy) && + !tv.RequestedUsers.Any(x => x.Equals(tv.RequestedBy, StringComparison.OrdinalIgnoreCase))) { tv.RequestedUsers.Add(tv.RequestedBy); } diff --git a/PlexRequests.UI/Modules/UserLoginModule.cs b/PlexRequests.UI/Modules/UserLoginModule.cs index cfadd2b8f..bd6643071 100644 --- a/PlexRequests.UI/Modules/UserLoginModule.cs +++ b/PlexRequests.UI/Modules/UserLoginModule.cs @@ -170,7 +170,7 @@ namespace PlexRequests.UI.Modules var users = Api.GetUsers(authToken); Log.Debug("Plex Users: "); Log.Debug(users.DumpJson()); - var allUsers = users.User?.Where(x => !string.IsNullOrEmpty(x.Username)); + var allUsers = users?.User?.Where(x => !string.IsNullOrEmpty(x.Username)); return allUsers != null && allUsers.Any(x => x.Username.Equals(username, StringComparison.CurrentCultureIgnoreCase)); } diff --git a/PlexRequests.UI/Program.cs b/PlexRequests.UI/Program.cs index c8f863f40..5f07f7436 100644 --- a/PlexRequests.UI/Program.cs +++ b/PlexRequests.UI/Program.cs @@ -69,7 +69,7 @@ namespace PlexRequests.UI if (port == -1) port = GetStartupPort(); - var options = new StartOptions(Debugger.IsAttached ? $"http://localhost:{port}" : $"http://+:{port}") + var options = new StartOptions( $"http://+:{port}") { ServerFactory = "Microsoft.Owin.Host.HttpListener" }; diff --git a/PlexRequests.UI/Views/Admin/Settings.cshtml b/PlexRequests.UI/Views/Admin/Settings.cshtml index 1f3257c49..d8e08431e 100644 --- a/PlexRequests.UI/Views/Admin/Settings.cshtml +++ b/PlexRequests.UI/Views/Admin/Settings.cshtml @@ -52,6 +52,20 @@ +
+
+ +
+
+
+
+ + +
+

A comma separated list of users whose requests do not require approval.

@@ -108,13 +137,13 @@
@*
- -
- -
-
//TODO: Need to implement this*@ + +
+ +
+ //TODO: Need to implement this*@
diff --git a/PlexRequests.UI/Views/Shared/_Layout.cshtml b/PlexRequests.UI/Views/Shared/_Layout.cshtml index 154477934..486acedd5 100644 --- a/PlexRequests.UI/Views/Shared/_Layout.cshtml +++ b/PlexRequests.UI/Views/Shared/_Layout.cshtml @@ -87,8 +87,37 @@ -
- @RenderBody() +
+ @RenderBody() +
+
+ + +
+ \ No newline at end of file