1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2024-12-22 07:42:28 +00:00

Fixed: Toggling monitor artist multiple times

This commit is contained in:
Bogdan 2023-12-03 19:44:16 +02:00
parent 0fb07a54d6
commit 14c02c7882
3 changed files with 11 additions and 6 deletions

View file

@ -524,7 +524,7 @@ class ArtistDetails extends Component {
/>
<span className={styles.qualityProfileName}>
{monitored ? 'Monitored' : 'Unmonitored'}
{monitored ? translate('Monitored') : translate('Unmonitored')}
</span>
</Label>
@ -539,7 +539,7 @@ class ArtistDetails extends Component {
/>
<span className={styles.qualityProfileName}>
{continuing ? 'Continuing' : endedString}
{continuing ? translate('Continuing') : endedString}
</span>
</Label>

View file

@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using FluentValidation;
using Lidarr.Api.V1.Albums;
using Lidarr.Http;
using Lidarr.Http.REST;
using Lidarr.Http.REST.Attributes;
@ -127,6 +128,7 @@ private ArtistResource GetArtistResource(NzbDrone.Core.Music.Artist artist)
}
[HttpGet]
[Produces("application/json")]
public List<ArtistResource> AllArtists(Guid? mbId)
{
var artistStats = _artistStatisticsService.ArtistStatistics();
@ -151,6 +153,7 @@ public List<ArtistResource> AllArtists(Guid? mbId)
}
[RestPostById]
[Consumes("application/json")]
public ActionResult<ArtistResource> AddArtist(ArtistResource artistResource)
{
var artist = _addArtistService.AddArtist(artistResource.ToModel());
@ -159,6 +162,7 @@ public ActionResult<ArtistResource> AddArtist(ArtistResource artistResource)
}
[RestPutById]
[Consumes("application/json")]
public ActionResult<ArtistResource> UpdateArtist(ArtistResource artistResource, bool moveFiles = false)
{
var artist = _artistService.GetArtist(artistResource.Id);
@ -205,8 +209,8 @@ private void LinkNextPreviousAlbums(params ArtistResource[] artists)
foreach (var artistResource in artists)
{
artistResource.NextAlbum = nextAlbums.FirstOrDefault(x => x.ArtistMetadataId == artistResource.ArtistMetadataId);
artistResource.LastAlbum = lastAlbums.FirstOrDefault(x => x.ArtistMetadataId == artistResource.ArtistMetadataId);
artistResource.NextAlbum = nextAlbums.FirstOrDefault(x => x.ArtistMetadataId == artistResource.ArtistMetadataId).ToResource();
artistResource.LastAlbum = lastAlbums.FirstOrDefault(x => x.ArtistMetadataId == artistResource.ArtistMetadataId).ToResource();
}
}

View file

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Lidarr.Api.V1.Albums;
using Lidarr.Http.REST;
using Newtonsoft.Json;
using NzbDrone.Common.Extensions;
@ -31,8 +32,8 @@ public class ArtistResource : RestResource
public string Disambiguation { get; set; }
public List<Links> Links { get; set; }
public Album NextAlbum { get; set; }
public Album LastAlbum { get; set; }
public AlbumResource NextAlbum { get; set; }
public AlbumResource LastAlbum { get; set; }
public List<MediaCover> Images { get; set; }
public List<Member> Members { get; set; }