mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-19 04:49:33 -07:00
feat(request-limits): ✨ Added the new request limit options into the user importer
This commit is contained in:
parent
03bc23a74e
commit
01d4f4d718
6 changed files with 59 additions and 9 deletions
|
@ -117,7 +117,11 @@ namespace Ombi.Schedule.Jobs.Emby
|
|||
ProviderUserId = embyUser.Id,
|
||||
Alias = isConnectUser ? embyUser.Name : string.Empty,
|
||||
MovieRequestLimit = userManagementSettings.MovieRequestLimit,
|
||||
MovieRequestLimitType = userManagementSettings.MovieRequestLimitType,
|
||||
EpisodeRequestLimit = userManagementSettings.EpisodeRequestLimit,
|
||||
EpisodeRequestLimitType = userManagementSettings.EpisodeRequestLimitType,
|
||||
MusicRequestLimit = userManagementSettings.MusicRequestLimit,
|
||||
MusicRequestLimitType = userManagementSettings.MusicRequestLimitType,
|
||||
StreamingCountry = userManagementSettings.DefaultStreamingCountry
|
||||
};
|
||||
var result = await _userManager.CreateAsync(newUser);
|
||||
|
|
|
@ -104,7 +104,11 @@ namespace Ombi.Schedule.Jobs.Plex
|
|||
Email = plexUser?.Email ?? string.Empty,
|
||||
Alias = string.Empty,
|
||||
MovieRequestLimit = userManagementSettings.MovieRequestLimit,
|
||||
MovieRequestLimitType = userManagementSettings.MovieRequestLimitType,
|
||||
EpisodeRequestLimit = userManagementSettings.EpisodeRequestLimit,
|
||||
EpisodeRequestLimitType = userManagementSettings.EpisodeRequestLimitType,
|
||||
MusicRequestLimit = userManagementSettings.MusicRequestLimit,
|
||||
MusicRequestLimitType = userManagementSettings.MusicRequestLimitType,
|
||||
StreamingCountry = userManagementSettings.DefaultStreamingCountry
|
||||
};
|
||||
_log.LogInformation("Creating Plex user {0}", newUser.UserName);
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System.Collections.Generic;
|
||||
using Ombi.Store.Entities;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Ombi.Settings.Settings.Models
|
||||
{
|
||||
|
@ -9,7 +10,11 @@ namespace Ombi.Settings.Settings.Models
|
|||
public bool ImportEmbyUsers { get; set; }
|
||||
public bool ImportJellyfinUsers { get; set; }
|
||||
public int MovieRequestLimit { get; set; }
|
||||
public RequestLimitType MovieRequestLimitType { get; set; } = RequestLimitType.Week;
|
||||
public int EpisodeRequestLimit { get; set; }
|
||||
public RequestLimitType EpisodeRequestLimitType { get; set; } = RequestLimitType.Week;
|
||||
public int MusicRequestLimit { get; set; }
|
||||
public RequestLimitType MusicRequestLimitType { get; set; } = RequestLimitType.Week;
|
||||
public string DefaultStreamingCountry { get; set; } = "US";
|
||||
public List<string> DefaultRoles { get; set; } = new List<string>();
|
||||
public List<string> BannedPlexUserIds { get; set; } = new List<string>();
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { ISettings } from "./ICommon";
|
||||
import { RequestLimitType } from ".";
|
||||
|
||||
export interface IExternalSettings extends ISettings {
|
||||
ssl: boolean;
|
||||
|
@ -247,10 +248,14 @@ export interface IUserManagementSettings extends ISettings {
|
|||
defaultRoles: string[];
|
||||
movieRequestLimit: number;
|
||||
episodeRequestLimit: number;
|
||||
musicRequestLimit: number;
|
||||
bannedPlexUserIds: string[];
|
||||
bannedEmbyUserIds: string[];
|
||||
bannedJellyfinUserIds: string[];
|
||||
defaultStreamingCountry: string;
|
||||
movieRequestLimitType: RequestLimitType;
|
||||
episodeRequestLimitType: RequestLimitType;
|
||||
musicRequestLimitType: RequestLimitType;
|
||||
}
|
||||
|
||||
export interface IAbout {
|
||||
|
|
|
@ -49,8 +49,8 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<h4>Default Roles</h4>
|
||||
|
||||
<h3>Default Roles</h3>
|
||||
<hr>
|
||||
<div *ngFor="let c of claims">
|
||||
<div class="form-group">
|
||||
<div>
|
||||
|
@ -60,7 +60,10 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<h4>Default Request Limits</h4>
|
||||
<h3>Default Request Limits</h3>
|
||||
|
||||
<hr>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="movieRequestLimit" class="control-label">Movie Request Limit</label>
|
||||
<div>
|
||||
|
@ -68,12 +71,38 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<mat-label>Movie Request Limit Type</mat-label>
|
||||
<mat-select id="movieRequestLimitType" [(value)]="settings.movieRequestLimitType">
|
||||
<mat-option *ngFor="let value of requestLimitTypes" [value]="value">
|
||||
{{RequestLimitType[value]}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="episodeRequestLimit" class="control-label">Episode Request Limit</label>
|
||||
<div>
|
||||
<input type="text" [(ngModel)]="settings.episodeRequestLimit" class="form-control form-small form-control-custom" id="episodeRequestLimit" name="episodeRequestLimit" value="{{settings?.episodeRequestLimit}}">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<mat-label>Episode Request Limit Type</mat-label>
|
||||
<mat-select id="episodeRequestLimitType" [(value)]="settings.episodeRequestLimitType">
|
||||
<mat-option *ngFor="let value of requestLimitTypes" [value]="value">
|
||||
{{RequestLimitType[value]}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<div class="form-group">
|
||||
<label for="episodeRequestLimit" class="control-label">Music Request Limit</label>
|
||||
<div>
|
||||
<input type="text" [(ngModel)]="settings.musicRequestLimit" class="form-control form-small form-control-custom" id="musicRequestLimit" name="musicRequestLimit" value="{{settings?.musicRequestLimit}}">
|
||||
</div>
|
||||
</div>
|
||||
<mat-label>Music Request Limit Type</mat-label>
|
||||
<mat-select id="musicRequestLimitType" [(value)]="settings.musicRequestLimitType">
|
||||
<mat-option *ngFor="let value of requestLimitTypes" [value]="value">
|
||||
{{RequestLimitType[value]}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
|
||||
<mat-form-field>
|
||||
<mat-label [translate]="'UserPreferences.StreamingCountry'"></mat-label>
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { Component, OnInit } from "@angular/core";
|
||||
import { EmbyService, IdentityService, JellyfinService, JobService, NotificationService, PlexService, SettingsService } from "../../services";
|
||||
import { ICheckbox, IUserManagementSettings, RequestLimitType } from "../../interfaces";
|
||||
|
||||
import { ICheckbox, IUserManagementSettings } from "../../interfaces";
|
||||
import { IUsersModel } from "../../interfaces";
|
||||
import { EmbyService, JellyfinService, IdentityService, JobService, NotificationService, PlexService, SettingsService } from "../../services";
|
||||
|
||||
@Component({
|
||||
templateUrl: "./usermanagement.component.html",
|
||||
|
@ -31,6 +31,9 @@ export class UserManagementComponent implements OnInit {
|
|||
public enableImportButton = false;
|
||||
public countries: string[];
|
||||
|
||||
public requestLimitTypes: RequestLimitType[] = [RequestLimitType.Day, RequestLimitType.Week, RequestLimitType.Month];
|
||||
public RequestLimitType = RequestLimitType;
|
||||
|
||||
constructor(private readonly settingsService: SettingsService,
|
||||
private readonly notificationService: NotificationService,
|
||||
private readonly identityService: IdentityService,
|
||||
|
@ -120,7 +123,7 @@ export class UserManagementComponent implements OnInit {
|
|||
if (x === true) {
|
||||
this.notificationService.success("Successfully saved the User Management Settings");
|
||||
} else {
|
||||
this.notificationService.success( "There was an error when saving the Ombi settings");
|
||||
this.notificationService.success( "There was an error when saving the settings");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue