mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-14 17:13:49 -07:00
Fixed: Toggling monitor artist multiple times
This commit is contained in:
parent
0fb07a54d6
commit
14c02c7882
3 changed files with 11 additions and 6 deletions
|
@ -524,7 +524,7 @@ class ArtistDetails extends Component {
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<span className={styles.qualityProfileName}>
|
<span className={styles.qualityProfileName}>
|
||||||
{monitored ? 'Monitored' : 'Unmonitored'}
|
{monitored ? translate('Monitored') : translate('Unmonitored')}
|
||||||
</span>
|
</span>
|
||||||
</Label>
|
</Label>
|
||||||
|
|
||||||
|
@ -539,7 +539,7 @@ class ArtistDetails extends Component {
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<span className={styles.qualityProfileName}>
|
<span className={styles.qualityProfileName}>
|
||||||
{continuing ? 'Continuing' : endedString}
|
{continuing ? translate('Continuing') : endedString}
|
||||||
</span>
|
</span>
|
||||||
</Label>
|
</Label>
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@ using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using FluentValidation;
|
using FluentValidation;
|
||||||
|
using Lidarr.Api.V1.Albums;
|
||||||
using Lidarr.Http;
|
using Lidarr.Http;
|
||||||
using Lidarr.Http.REST;
|
using Lidarr.Http.REST;
|
||||||
using Lidarr.Http.REST.Attributes;
|
using Lidarr.Http.REST.Attributes;
|
||||||
|
@ -127,6 +128,7 @@ namespace Lidarr.Api.V1.Artist
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpGet]
|
[HttpGet]
|
||||||
|
[Produces("application/json")]
|
||||||
public List<ArtistResource> AllArtists(Guid? mbId)
|
public List<ArtistResource> AllArtists(Guid? mbId)
|
||||||
{
|
{
|
||||||
var artistStats = _artistStatisticsService.ArtistStatistics();
|
var artistStats = _artistStatisticsService.ArtistStatistics();
|
||||||
|
@ -151,6 +153,7 @@ namespace Lidarr.Api.V1.Artist
|
||||||
}
|
}
|
||||||
|
|
||||||
[RestPostById]
|
[RestPostById]
|
||||||
|
[Consumes("application/json")]
|
||||||
public ActionResult<ArtistResource> AddArtist(ArtistResource artistResource)
|
public ActionResult<ArtistResource> AddArtist(ArtistResource artistResource)
|
||||||
{
|
{
|
||||||
var artist = _addArtistService.AddArtist(artistResource.ToModel());
|
var artist = _addArtistService.AddArtist(artistResource.ToModel());
|
||||||
|
@ -159,6 +162,7 @@ namespace Lidarr.Api.V1.Artist
|
||||||
}
|
}
|
||||||
|
|
||||||
[RestPutById]
|
[RestPutById]
|
||||||
|
[Consumes("application/json")]
|
||||||
public ActionResult<ArtistResource> UpdateArtist(ArtistResource artistResource, bool moveFiles = false)
|
public ActionResult<ArtistResource> UpdateArtist(ArtistResource artistResource, bool moveFiles = false)
|
||||||
{
|
{
|
||||||
var artist = _artistService.GetArtist(artistResource.Id);
|
var artist = _artistService.GetArtist(artistResource.Id);
|
||||||
|
@ -205,8 +209,8 @@ namespace Lidarr.Api.V1.Artist
|
||||||
|
|
||||||
foreach (var artistResource in artists)
|
foreach (var artistResource in artists)
|
||||||
{
|
{
|
||||||
artistResource.NextAlbum = nextAlbums.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);
|
artistResource.LastAlbum = lastAlbums.FirstOrDefault(x => x.ArtistMetadataId == artistResource.ArtistMetadataId).ToResource();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using Lidarr.Api.V1.Albums;
|
||||||
using Lidarr.Http.REST;
|
using Lidarr.Http.REST;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using NzbDrone.Common.Extensions;
|
using NzbDrone.Common.Extensions;
|
||||||
|
@ -31,8 +32,8 @@ namespace Lidarr.Api.V1.Artist
|
||||||
public string Disambiguation { get; set; }
|
public string Disambiguation { get; set; }
|
||||||
public List<Links> Links { get; set; }
|
public List<Links> Links { get; set; }
|
||||||
|
|
||||||
public Album NextAlbum { get; set; }
|
public AlbumResource NextAlbum { get; set; }
|
||||||
public Album LastAlbum { get; set; }
|
public AlbumResource LastAlbum { get; set; }
|
||||||
|
|
||||||
public List<MediaCover> Images { get; set; }
|
public List<MediaCover> Images { get; set; }
|
||||||
public List<Member> Members { get; set; }
|
public List<Member> Members { get; set; }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue