mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-15 17:43:49 -07:00
Fixed: Last UI reference to nameSlug, remove from model
This commit is contained in:
parent
afc4aeb25f
commit
b0070e0229
17 changed files with 6 additions and 279 deletions
|
@ -66,7 +66,6 @@ class AddNewArtistSearchResult extends Component {
|
||||||
const {
|
const {
|
||||||
foreignArtistId,
|
foreignArtistId,
|
||||||
artistName,
|
artistName,
|
||||||
nameSlug,
|
|
||||||
year,
|
year,
|
||||||
disambiguation,
|
disambiguation,
|
||||||
artistType,
|
artistType,
|
||||||
|
@ -79,7 +78,7 @@ class AddNewArtistSearchResult extends Component {
|
||||||
isSmallScreen
|
isSmallScreen
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
const linkProps = isExistingArtist ? { to: `/artist/${nameSlug}` } : { onPress: this.onPress };
|
const linkProps = isExistingArtist ? { to: `/artist/${foreignArtistId}` } : { onPress: this.onPress };
|
||||||
let albums = '1 Album';
|
let albums = '1 Album';
|
||||||
|
|
||||||
if (albumCount > 1) {
|
if (albumCount > 1) {
|
||||||
|
@ -193,7 +192,6 @@ class AddNewArtistSearchResult extends Component {
|
||||||
AddNewArtistSearchResult.propTypes = {
|
AddNewArtistSearchResult.propTypes = {
|
||||||
foreignArtistId: PropTypes.string.isRequired,
|
foreignArtistId: PropTypes.string.isRequired,
|
||||||
artistName: PropTypes.string.isRequired,
|
artistName: PropTypes.string.isRequired,
|
||||||
nameSlug: PropTypes.string.isRequired,
|
|
||||||
year: PropTypes.number,
|
year: PropTypes.number,
|
||||||
disambiguation: PropTypes.string,
|
disambiguation: PropTypes.string,
|
||||||
artistType: PropTypes.string,
|
artistType: PropTypes.string,
|
||||||
|
|
|
@ -19,7 +19,6 @@ class AlbumStudioRow extends Component {
|
||||||
const {
|
const {
|
||||||
artistId,
|
artistId,
|
||||||
status,
|
status,
|
||||||
nameSlug,
|
|
||||||
foreignArtistId,
|
foreignArtistId,
|
||||||
artistName,
|
artistName,
|
||||||
monitored,
|
monitored,
|
||||||
|
@ -84,7 +83,6 @@ class AlbumStudioRow extends Component {
|
||||||
AlbumStudioRow.propTypes = {
|
AlbumStudioRow.propTypes = {
|
||||||
artistId: PropTypes.number.isRequired,
|
artistId: PropTypes.number.isRequired,
|
||||||
status: PropTypes.string.isRequired,
|
status: PropTypes.string.isRequired,
|
||||||
nameSlug: PropTypes.string.isRequired,
|
|
||||||
foreignArtistId: PropTypes.string.isRequired,
|
foreignArtistId: PropTypes.string.isRequired,
|
||||||
artistName: PropTypes.string.isRequired,
|
artistName: PropTypes.string.isRequired,
|
||||||
monitored: PropTypes.bool.isRequired,
|
monitored: PropTypes.bool.isRequired,
|
||||||
|
|
|
@ -20,7 +20,6 @@ function createMapStateToProps() {
|
||||||
...artist,
|
...artist,
|
||||||
artistId: artist.id,
|
artistId: artist.id,
|
||||||
artistName: artist.artistName,
|
artistName: artist.artistName,
|
||||||
nameSlug: artist.nameSlug,
|
|
||||||
monitored: artist.monitored,
|
monitored: artist.monitored,
|
||||||
status: artist.status,
|
status: artist.status,
|
||||||
isSaving: artist.isSaving,
|
isSaving: artist.isSaving,
|
||||||
|
|
|
@ -66,7 +66,6 @@ class ArtistIndexRow extends Component {
|
||||||
monitored,
|
monitored,
|
||||||
status,
|
status,
|
||||||
artistName,
|
artistName,
|
||||||
nameSlug,
|
|
||||||
foreignArtistId,
|
foreignArtistId,
|
||||||
artistType,
|
artistType,
|
||||||
qualityProfile,
|
qualityProfile,
|
||||||
|
@ -79,7 +78,6 @@ class ArtistIndexRow extends Component {
|
||||||
trackCount,
|
trackCount,
|
||||||
trackFileCount,
|
trackFileCount,
|
||||||
totalTrackCount,
|
totalTrackCount,
|
||||||
latestAlbum,
|
|
||||||
path,
|
path,
|
||||||
sizeOnDisk,
|
sizeOnDisk,
|
||||||
tags,
|
tags,
|
||||||
|
@ -361,7 +359,6 @@ ArtistIndexRow.propTypes = {
|
||||||
monitored: PropTypes.bool.isRequired,
|
monitored: PropTypes.bool.isRequired,
|
||||||
status: PropTypes.string.isRequired,
|
status: PropTypes.string.isRequired,
|
||||||
artistName: PropTypes.string.isRequired,
|
artistName: PropTypes.string.isRequired,
|
||||||
nameSlug: PropTypes.string.isRequired,
|
|
||||||
foreignArtistId: PropTypes.string.isRequired,
|
foreignArtistId: PropTypes.string.isRequired,
|
||||||
artistType: PropTypes.string,
|
artistType: PropTypes.string,
|
||||||
qualityProfile: PropTypes.object.isRequired,
|
qualityProfile: PropTypes.object.isRequired,
|
||||||
|
|
|
@ -1,126 +0,0 @@
|
||||||
import React from 'react';
|
|
||||||
import getProgressBarKind from 'Utilities/Artist/getProgressBarKind';
|
|
||||||
import ProgressBar from 'Components/ProgressBar';
|
|
||||||
import VirtualTableRowCell from 'Components/Table/Cells/VirtualTableRowCell';
|
|
||||||
import RelativeDateCellConnector from 'Components/Table/Cells/RelativeDateCellConnector';
|
|
||||||
import QualityProfileNameConnector from 'Settings/Profiles/Quality/QualityProfileNameConnector';
|
|
||||||
import ArtistNameLink from 'Artist/ArtistNameLink';
|
|
||||||
import ArtistIndexItemConnector from 'Artist/Index/ArtistIndexItemConnector';
|
|
||||||
import ArtistIndexActionsCell from './ArtistIndexActionsCell';
|
|
||||||
import ArtistStatusCell from './ArtistStatusCell';
|
|
||||||
|
|
||||||
export default function artistIndexCellRenderers(cellProps) {
|
|
||||||
const {
|
|
||||||
cellKey,
|
|
||||||
dataKey,
|
|
||||||
rowData,
|
|
||||||
...otherProps
|
|
||||||
} = cellProps;
|
|
||||||
|
|
||||||
const {
|
|
||||||
id,
|
|
||||||
monitored,
|
|
||||||
status,
|
|
||||||
name,
|
|
||||||
nameSlug,
|
|
||||||
foreignArtistId,
|
|
||||||
qualityProfileId,
|
|
||||||
nextAiring,
|
|
||||||
previousAiring,
|
|
||||||
albumCount,
|
|
||||||
trackCount,
|
|
||||||
trackFileCount
|
|
||||||
} = rowData;
|
|
||||||
|
|
||||||
const progress = trackCount ? trackFileCount / trackCount * 100 : 100;
|
|
||||||
|
|
||||||
if (dataKey === 'status') {
|
|
||||||
return (
|
|
||||||
<ArtistStatusCell
|
|
||||||
key={cellKey}
|
|
||||||
monitored={monitored}
|
|
||||||
status={status}
|
|
||||||
component={VirtualTableRowCell}
|
|
||||||
{...otherProps}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dataKey === 'sortName') {
|
|
||||||
return (
|
|
||||||
<VirtualTableRowCell
|
|
||||||
key={cellKey}
|
|
||||||
{...otherProps}
|
|
||||||
>
|
|
||||||
<ArtistNameLink
|
|
||||||
foreignArtistId={foreignArtistId}
|
|
||||||
name={name}
|
|
||||||
/>
|
|
||||||
</VirtualTableRowCell>
|
|
||||||
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dataKey === 'qualityProfileId') {
|
|
||||||
return (
|
|
||||||
<VirtualTableRowCell
|
|
||||||
key={cellKey}
|
|
||||||
{...otherProps}
|
|
||||||
>
|
|
||||||
<QualityProfileNameConnector
|
|
||||||
qualityProfileId={qualityProfileId}
|
|
||||||
/>
|
|
||||||
</VirtualTableRowCell>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dataKey === 'nextAiring') {
|
|
||||||
return (
|
|
||||||
<RelativeDateCellConnector
|
|
||||||
key={cellKey}
|
|
||||||
date={nextAiring}
|
|
||||||
component={VirtualTableRowCell}
|
|
||||||
{...otherProps}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dataKey === 'albumCount') {
|
|
||||||
return (
|
|
||||||
<VirtualTableRowCell
|
|
||||||
key={cellKey}
|
|
||||||
{...otherProps}
|
|
||||||
>
|
|
||||||
{albumCount}
|
|
||||||
</VirtualTableRowCell>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dataKey === 'trackProgress') {
|
|
||||||
return (
|
|
||||||
<VirtualTableRowCell
|
|
||||||
key={cellKey}
|
|
||||||
{...otherProps}
|
|
||||||
>
|
|
||||||
<ProgressBar
|
|
||||||
progress={progress}
|
|
||||||
kind={getProgressBarKind(status, monitored, progress)}
|
|
||||||
showText={true}
|
|
||||||
text={`${trackFileCount} / ${trackCount}`}
|
|
||||||
width={125}
|
|
||||||
/>
|
|
||||||
</VirtualTableRowCell>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dataKey === 'actions') {
|
|
||||||
return (
|
|
||||||
<ArtistIndexItemConnector
|
|
||||||
key={cellKey}
|
|
||||||
component={ArtistIndexActionsCell}
|
|
||||||
id={id}
|
|
||||||
{...otherProps}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -63,7 +63,6 @@ namespace Lidarr.Api.V1.Artist
|
||||||
public DateTime Added { get; set; }
|
public DateTime Added { get; set; }
|
||||||
public AddArtistOptions AddOptions { get; set; }
|
public AddArtistOptions AddOptions { get; set; }
|
||||||
public Ratings Ratings { get; set; }
|
public Ratings Ratings { get; set; }
|
||||||
public string NameSlug { get; set; }
|
|
||||||
|
|
||||||
//TODO: Add series statistics as a property of the series (instead of individual properties)
|
//TODO: Add series statistics as a property of the series (instead of individual properties)
|
||||||
}
|
}
|
||||||
|
@ -102,7 +101,6 @@ namespace Lidarr.Api.V1.Artist
|
||||||
|
|
||||||
CleanName = model.CleanName,
|
CleanName = model.CleanName,
|
||||||
ForeignArtistId = model.ForeignArtistId,
|
ForeignArtistId = model.ForeignArtistId,
|
||||||
NameSlug = model.NameSlug,
|
|
||||||
RootFolderPath = model.RootFolderPath,
|
RootFolderPath = model.RootFolderPath,
|
||||||
Genres = model.Genres,
|
Genres = model.Genres,
|
||||||
Tags = model.Tags,
|
Tags = model.Tags,
|
||||||
|
@ -142,7 +140,6 @@ namespace Lidarr.Api.V1.Artist
|
||||||
ArtistType = resource.ArtistType,
|
ArtistType = resource.ArtistType,
|
||||||
CleanName = resource.CleanName,
|
CleanName = resource.CleanName,
|
||||||
ForeignArtistId = resource.ForeignArtistId,
|
ForeignArtistId = resource.ForeignArtistId,
|
||||||
NameSlug = resource.NameSlug,
|
|
||||||
RootFolderPath = resource.RootFolderPath,
|
RootFolderPath = resource.RootFolderPath,
|
||||||
Genres = resource.Genres,
|
Genres = resource.Genres,
|
||||||
Tags = resource.Tags,
|
Tags = resource.Tags,
|
||||||
|
|
|
@ -67,15 +67,6 @@ namespace NzbDrone.Core.Test.MetadataSource.SkyHook
|
||||||
Assert.Throws<BadRequestException>(() => Subject.GetArtistInfo("aaaaaa-aaa-aaaa-aaaa", 1));
|
Assert.Throws<BadRequestException>(() => Subject.GetArtistInfo("aaaaaa-aaa-aaaa-aaaa", 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
|
||||||
[Ignore("We don't return a dothack from Metadata")]
|
|
||||||
public void should_not_have_period_at_start_of_name_slug()
|
|
||||||
{
|
|
||||||
var details = Subject.GetArtistInfo("b6db95cd-88d9-492f-bbf6-a34e0e89b2e5", 1);
|
|
||||||
|
|
||||||
details.Item1.NameSlug.Should().Be("dothack");
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ValidateArtist(Artist artist)
|
private void ValidateArtist(Artist artist)
|
||||||
{
|
{
|
||||||
artist.Should().NotBeNull();
|
artist.Should().NotBeNull();
|
||||||
|
@ -84,7 +75,6 @@ namespace NzbDrone.Core.Test.MetadataSource.SkyHook
|
||||||
artist.SortName.Should().Be(Parser.Parser.NormalizeTitle(artist.Name));
|
artist.SortName.Should().Be(Parser.Parser.NormalizeTitle(artist.Name));
|
||||||
artist.Overview.Should().NotBeNullOrWhiteSpace();
|
artist.Overview.Should().NotBeNullOrWhiteSpace();
|
||||||
artist.Images.Should().NotBeEmpty();
|
artist.Images.Should().NotBeEmpty();
|
||||||
artist.NameSlug.Should().NotBeNullOrWhiteSpace();
|
|
||||||
//series.TvRageId.Should().BeGreaterThan(0);
|
//series.TvRageId.Should().BeGreaterThan(0);
|
||||||
artist.ForeignArtistId.Should().NotBeNullOrWhiteSpace();
|
artist.ForeignArtistId.Should().NotBeNullOrWhiteSpace();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,76 +0,0 @@
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using FizzWare.NBuilder;
|
|
||||||
using FluentAssertions;
|
|
||||||
using FluentValidation.Validators;
|
|
||||||
using NUnit.Framework;
|
|
||||||
using NzbDrone.Common.Extensions;
|
|
||||||
using NzbDrone.Core.Test.Framework;
|
|
||||||
using NzbDrone.Core.Music;
|
|
||||||
using NzbDrone.Test.Common;
|
|
||||||
|
|
||||||
namespace NzbDrone.Core.Test.TvTests
|
|
||||||
{
|
|
||||||
[TestFixture]
|
|
||||||
public class ArtistNameSlugValidatorFixture : CoreTest<ArtistSlugValidator>
|
|
||||||
{
|
|
||||||
private List<Artist> _artist;
|
|
||||||
private TestValidator<Artist> _validator;
|
|
||||||
|
|
||||||
[SetUp]
|
|
||||||
public void Setup()
|
|
||||||
{
|
|
||||||
_artist = Builder<Artist>.CreateListOfSize(1)
|
|
||||||
.Build()
|
|
||||||
.ToList();
|
|
||||||
|
|
||||||
_validator = new TestValidator<Artist>
|
|
||||||
{
|
|
||||||
v => v.RuleFor(s => s.NameSlug).SetValidator(Subject)
|
|
||||||
};
|
|
||||||
|
|
||||||
Mocker.GetMock<IArtistService>()
|
|
||||||
.Setup(s => s.GetAllArtists())
|
|
||||||
.Returns(_artist);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void should_not_be_valid_if_there_is_an_existing_artist_with_the_same_title_slug()
|
|
||||||
{
|
|
||||||
var series = Builder<Artist>.CreateNew()
|
|
||||||
.With(s => s.Id = 100)
|
|
||||||
.With(s => s.NameSlug = _artist.First().NameSlug)
|
|
||||||
.Build();
|
|
||||||
|
|
||||||
_validator.Validate(series).IsValid.Should().BeFalse();
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void should_be_valid_if_there_is_not_an_existing_artist_with_the_same_title_slug()
|
|
||||||
{
|
|
||||||
var series = Builder<Artist>.CreateNew()
|
|
||||||
.With(s => s.NameSlug = "MyNameSlug")
|
|
||||||
.Build();
|
|
||||||
|
|
||||||
_validator.Validate(series).IsValid.Should().BeTrue();
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void should_be_valid_if_there_is_an_existing_artist_with_a_null_title_slug()
|
|
||||||
{
|
|
||||||
_artist.First().NameSlug = null;
|
|
||||||
|
|
||||||
var series = Builder<Artist>.CreateNew()
|
|
||||||
.With(s => s.NameSlug = "MyNameSlug")
|
|
||||||
.Build();
|
|
||||||
|
|
||||||
_validator.Validate(series).IsValid.Should().BeTrue();
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void should_be_valid_when_updating_an_existing_artist()
|
|
||||||
{
|
|
||||||
_validator.Validate(_artist.First().JsonClone()).IsValid.Should().BeTrue();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -285,7 +285,6 @@
|
||||||
<Compile Include="MetadataSource\SearchArtistComparerFixture.cs" />
|
<Compile Include="MetadataSource\SearchArtistComparerFixture.cs" />
|
||||||
<Compile Include="MetadataSource\SkyHook\SkyHookProxyFixture.cs" />
|
<Compile Include="MetadataSource\SkyHook\SkyHookProxyFixture.cs" />
|
||||||
<Compile Include="MusicTests\AddArtistFixture.cs" />
|
<Compile Include="MusicTests\AddArtistFixture.cs" />
|
||||||
<Compile Include="MusicTests\ArtistNameSlugValidatorFixture.cs" />
|
|
||||||
<Compile Include="MusicTests\ArtistRepositoryTests\ArtistRepositoryFixture.cs" />
|
<Compile Include="MusicTests\ArtistRepositoryTests\ArtistRepositoryFixture.cs" />
|
||||||
<Compile Include="MusicTests\ArtistServiceTests\AddArtistFixture.cs" />
|
<Compile Include="MusicTests\ArtistServiceTests\AddArtistFixture.cs" />
|
||||||
<Compile Include="MusicTests\ArtistServiceTests\UpdateMultipleArtistFixture.cs" />
|
<Compile Include="MusicTests\ArtistServiceTests\UpdateMultipleArtistFixture.cs" />
|
||||||
|
|
|
@ -270,7 +270,6 @@ namespace NzbDrone.Core.MetadataSource.SkyHook
|
||||||
artist.ForeignArtistId = resource.Id;
|
artist.ForeignArtistId = resource.Id;
|
||||||
artist.Genres = resource.Genres;
|
artist.Genres = resource.Genres;
|
||||||
artist.Overview = resource.Overview;
|
artist.Overview = resource.Overview;
|
||||||
artist.NameSlug = Parser.Parser.CleanArtistName(artist.Name) + "-" + resource.Id.Substring(resource.Id.Length - 6);
|
|
||||||
artist.CleanName = Parser.Parser.CleanArtistName(artist.Name);
|
artist.CleanName = Parser.Parser.CleanArtistName(artist.Name);
|
||||||
artist.SortName = Parser.Parser.NormalizeTitle(artist.Name);
|
artist.SortName = Parser.Parser.NormalizeTitle(artist.Name);
|
||||||
artist.Disambiguation = resource.Disambiguation;
|
artist.Disambiguation = resource.Disambiguation;
|
||||||
|
|
|
@ -17,8 +17,7 @@ namespace NzbDrone.Core.Music
|
||||||
{
|
{
|
||||||
public AddArtistValidator(RootFolderValidator rootFolderValidator,
|
public AddArtistValidator(RootFolderValidator rootFolderValidator,
|
||||||
ArtistPathValidator artistPathValidator,
|
ArtistPathValidator artistPathValidator,
|
||||||
ArtistAncestorValidator artistAncestorValidator,
|
ArtistAncestorValidator artistAncestorValidator)
|
||||||
ArtistSlugValidator artistTitleSlugValidator)
|
|
||||||
{
|
{
|
||||||
RuleFor(c => c.Path).Cascade(CascadeMode.StopOnFirstFailure)
|
RuleFor(c => c.Path).Cascade(CascadeMode.StopOnFirstFailure)
|
||||||
.IsValidPath()
|
.IsValidPath()
|
||||||
|
@ -26,7 +25,6 @@ namespace NzbDrone.Core.Music
|
||||||
.SetValidator(artistPathValidator)
|
.SetValidator(artistPathValidator)
|
||||||
.SetValidator(artistAncestorValidator);
|
.SetValidator(artistAncestorValidator);
|
||||||
|
|
||||||
RuleFor(c => c.NameSlug).SetValidator(artistTitleSlugValidator);// TODO: Check if we are going to use a slug or artistName
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,6 +12,7 @@ namespace NzbDrone.Core.Music
|
||||||
Genres = new List<string>();
|
Genres = new List<string>();
|
||||||
Images = new List<MediaCover.MediaCover>();
|
Images = new List<MediaCover.MediaCover>();
|
||||||
Media = new List<Medium>();
|
Media = new List<Medium>();
|
||||||
|
Releases = new List<AlbumRelease>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public const string RELEASE_DATE_FORMAT = "yyyy-MM-dd";
|
public const string RELEASE_DATE_FORMAT = "yyyy-MM-dd";
|
||||||
|
|
|
@ -30,7 +30,6 @@ namespace NzbDrone.Core.Music
|
||||||
public int DiscogsId { get; set; }
|
public int DiscogsId { get; set; }
|
||||||
public string AMId { get; set; }
|
public string AMId { get; set; }
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
public string NameSlug { get; set; }
|
|
||||||
public string CleanName { get; set; }
|
public string CleanName { get; set; }
|
||||||
public string SortName { get; set; }
|
public string SortName { get; set; }
|
||||||
public string Overview { get; set; }
|
public string Overview { get; set; }
|
||||||
|
|
|
@ -1,44 +0,0 @@
|
||||||
using System.Linq;
|
|
||||||
using FluentValidation.Validators;
|
|
||||||
using NzbDrone.Common.Extensions;
|
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace NzbDrone.Core.Music
|
|
||||||
{
|
|
||||||
public class ArtistSlugValidator : PropertyValidator
|
|
||||||
{
|
|
||||||
private readonly IArtistService _artistService;
|
|
||||||
|
|
||||||
public ArtistSlugValidator(IArtistService artistService)
|
|
||||||
: base("Name slug '{slug}' is in use by artist '{artistName}'")
|
|
||||||
{
|
|
||||||
_artistService = artistService;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override bool IsValid(PropertyValidatorContext context)
|
|
||||||
{
|
|
||||||
if (context.PropertyValue == null) return true;
|
|
||||||
|
|
||||||
dynamic instance = context.ParentContext.InstanceToValidate;
|
|
||||||
var instanceId = (int)instance.Id;
|
|
||||||
var slug = context.PropertyValue.ToString();
|
|
||||||
|
|
||||||
var conflictingArtist = _artistService.GetAllArtists()
|
|
||||||
.FirstOrDefault(s => s.NameSlug.IsNotNullOrWhiteSpace() &&
|
|
||||||
s.NameSlug.Equals(context.PropertyValue.ToString()) &&
|
|
||||||
s.Id != instanceId);
|
|
||||||
|
|
||||||
if (conflictingArtist == null)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
context.MessageFormatter.AppendArgument("slug", slug);
|
|
||||||
context.MessageFormatter.AppendArgument("artistName", conflictingArtist.Name);
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -74,7 +74,6 @@ namespace NzbDrone.Core.Music
|
||||||
}
|
}
|
||||||
|
|
||||||
artist.Name = artistInfo.Name;
|
artist.Name = artistInfo.Name;
|
||||||
artist.NameSlug = artistInfo.NameSlug;
|
|
||||||
artist.Overview = artistInfo.Overview;
|
artist.Overview = artistInfo.Overview;
|
||||||
artist.Status = artistInfo.Status;
|
artist.Status = artistInfo.Status;
|
||||||
artist.CleanName = artistInfo.CleanName;
|
artist.CleanName = artistInfo.CleanName;
|
||||||
|
|
|
@ -38,7 +38,7 @@ namespace NzbDrone.Core.Notifications.CustomScript
|
||||||
environmentVariables.Add("Lidarr_EventType", "Grab");
|
environmentVariables.Add("Lidarr_EventType", "Grab");
|
||||||
environmentVariables.Add("Lidarr_Artist_Id", artist.Id.ToString());
|
environmentVariables.Add("Lidarr_Artist_Id", artist.Id.ToString());
|
||||||
environmentVariables.Add("Lidarr_Artist_Name", artist.Name);
|
environmentVariables.Add("Lidarr_Artist_Name", artist.Name);
|
||||||
environmentVariables.Add("Lidarr_Artist_MBId", artist.ForeignArtistId.ToString());
|
environmentVariables.Add("Lidarr_Artist_MBId", artist.ForeignArtistId);
|
||||||
environmentVariables.Add("Lidarr_Artist_Type", artist.ArtistType);
|
environmentVariables.Add("Lidarr_Artist_Type", artist.ArtistType);
|
||||||
environmentVariables.Add("Lidarr_Release_AlbumCount", remoteAlbum.Albums.Count.ToString());
|
environmentVariables.Add("Lidarr_Release_AlbumCount", remoteAlbum.Albums.Count.ToString());
|
||||||
environmentVariables.Add("Lidarr_Release_AlbumReleaseDates", string.Join(",", remoteAlbum.Albums.Select(e => e.ReleaseDate)));
|
environmentVariables.Add("Lidarr_Release_AlbumReleaseDates", string.Join(",", remoteAlbum.Albums.Select(e => e.ReleaseDate)));
|
||||||
|
@ -67,7 +67,7 @@ namespace NzbDrone.Core.Notifications.CustomScript
|
||||||
environmentVariables.Add("Lidarr_Artist_Id", artist.Id.ToString());
|
environmentVariables.Add("Lidarr_Artist_Id", artist.Id.ToString());
|
||||||
environmentVariables.Add("Lidarr_Artist_Name", artist.Name);
|
environmentVariables.Add("Lidarr_Artist_Name", artist.Name);
|
||||||
environmentVariables.Add("Lidarr_Artist_Path", artist.Path);
|
environmentVariables.Add("Lidarr_Artist_Path", artist.Path);
|
||||||
environmentVariables.Add("Lidarr_Artist_MBId", artist.ForeignArtistId.ToString());
|
environmentVariables.Add("Lidarr_Artist_MBId", artist.ForeignArtistId);
|
||||||
environmentVariables.Add("Lidarr_Artist_Type", artist.ArtistType);
|
environmentVariables.Add("Lidarr_Artist_Type", artist.ArtistType);
|
||||||
environmentVariables.Add("Lidarr_TrackFile_Id", trackFile.Id.ToString());
|
environmentVariables.Add("Lidarr_TrackFile_Id", trackFile.Id.ToString());
|
||||||
environmentVariables.Add("Lidarr_TrackFile_TrackCount", trackFile.Tracks.Value.Count.ToString());
|
environmentVariables.Add("Lidarr_TrackFile_TrackCount", trackFile.Tracks.Value.Count.ToString());
|
||||||
|
@ -102,7 +102,7 @@ namespace NzbDrone.Core.Notifications.CustomScript
|
||||||
environmentVariables.Add("Lidarr_Artist_Id", artist.Id.ToString());
|
environmentVariables.Add("Lidarr_Artist_Id", artist.Id.ToString());
|
||||||
environmentVariables.Add("Lidarr_Artist_Name", artist.Name);
|
environmentVariables.Add("Lidarr_Artist_Name", artist.Name);
|
||||||
environmentVariables.Add("Lidarr_Artist_Path", artist.Path);
|
environmentVariables.Add("Lidarr_Artist_Path", artist.Path);
|
||||||
environmentVariables.Add("Lidarr_Artist_MBId", artist.ForeignArtistId.ToString());
|
environmentVariables.Add("Lidarr_Artist_MBId", artist.ForeignArtistId);
|
||||||
environmentVariables.Add("Lidarr_Artist_Type", artist.ArtistType);
|
environmentVariables.Add("Lidarr_Artist_Type", artist.ArtistType);
|
||||||
|
|
||||||
ExecuteScript(environmentVariables);
|
ExecuteScript(environmentVariables);
|
||||||
|
|
|
@ -795,7 +795,6 @@
|
||||||
<Compile Include="Music\ArtistNameNormalizer.cs" />
|
<Compile Include="Music\ArtistNameNormalizer.cs" />
|
||||||
<Compile Include="Music\AlbumService.cs" />
|
<Compile Include="Music\AlbumService.cs" />
|
||||||
<Compile Include="Music\AlbumRepository.cs" />
|
<Compile Include="Music\AlbumRepository.cs" />
|
||||||
<Compile Include="Music\ArtistSlugValidator.cs" />
|
|
||||||
<Compile Include="Music\ArtistRepository.cs" />
|
<Compile Include="Music\ArtistRepository.cs" />
|
||||||
<Compile Include="Music\ArtistService.cs" />
|
<Compile Include="Music\ArtistService.cs" />
|
||||||
<Compile Include="Music\Commands\RefreshArtistCommand.cs" />
|
<Compile Include="Music\Commands\RefreshArtistCommand.cs" />
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue