1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-11-25 04:02:48 +01:00

New: Add name field to release profiles

This commit is contained in:
Robert Dailey 2021-02-02 18:51:06 -06:00 committed by GitHub
parent f3f2648ce5
commit 5e4c9dfe60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 51 additions and 2 deletions

View File

@ -29,6 +29,7 @@ function EditReleaseProfileModalContent(props) {
const {
id,
name,
enabled,
required,
ignored,
@ -46,6 +47,20 @@ function EditReleaseProfileModalContent(props) {
<ModalBody>
<Form {...otherProps}>
<FormGroup>
<FormLabel>Name</FormLabel>
<FormInputGroup
type={inputTypes.TEXT}
name="name"
{...name}
placeholder="Optional name"
canEdit={true}
onChange={onInputChange}
/>
</FormGroup>
<FormGroup>
<FormLabel>Enable Profile</FormLabel>

View File

@ -9,3 +9,11 @@
flex-wrap: wrap;
margin-top: 5px;
}
.name {
@add-mixin truncate;
margin-bottom: 20px;
font-weight: 300;
font-size: 24px;
}

View File

@ -56,6 +56,7 @@ class ReleaseProfile extends Component {
render() {
const {
id,
name,
enabled,
required,
ignored,
@ -79,6 +80,14 @@ class ReleaseProfile extends Component {
overlayContent={true}
onPress={this.onEditReleaseProfilePress}
>
{
name ?
<div className={styles.name}>
{name}
</div> :
null
}
<div>
{
split(required).map((item) => {
@ -184,6 +193,7 @@ class ReleaseProfile extends Component {
ReleaseProfile.propTypes = {
id: PropTypes.number.isRequired,
name: PropTypes.string,
enabled: PropTypes.bool.isRequired,
required: PropTypes.string.isRequired,
ignored: PropTypes.string.isRequired,

View File

@ -0,0 +1,14 @@
using FluentMigrator;
using NzbDrone.Core.Datastore.Migration.Framework;
namespace NzbDrone.Core.Datastore.Migration
{
[Migration(154)]
public class add_name_release_profile : NzbDroneMigrationBase
{
protected override void MainDbUpgrade()
{
Alter.Table("ReleaseProfiles").AddColumn("Name").AsString().Nullable().WithDefaultValue(null);
}
}
}

View File

@ -5,6 +5,7 @@ namespace NzbDrone.Core.Profiles.Releases
{
public class ReleaseProfile : ModelBase
{
public string Name { get; set; }
public bool Enabled { get; set; }
public string Required { get; set; }
public string Ignored { get; set; }

View File

@ -7,6 +7,7 @@ namespace Sonarr.Api.V3.Profiles.Release
{
public class ReleaseProfileResource : RestResource
{
public string Name { get; set; }
public bool Enabled { get; set; }
public string Required { get; set; }
public string Ignored { get; set; }
@ -30,7 +31,7 @@ namespace Sonarr.Api.V3.Profiles.Release
return new ReleaseProfileResource
{
Id = model.Id,
Name = model.Name,
Enabled = model.Enabled,
Required = model.Required,
Ignored = model.Ignored,
@ -48,7 +49,7 @@ namespace Sonarr.Api.V3.Profiles.Release
return new ReleaseProfile
{
Id = resource.Id,
Name = resource.Name,
Enabled = resource.Enabled,
Required = resource.Required,
Ignored = resource.Ignored,