mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 05:53:33 -07:00
AlbumStudio and ArtistEditor Fixes
This commit is contained in:
parent
49309125b6
commit
70cc2ed8a5
15 changed files with 96 additions and 47 deletions
|
@ -32,7 +32,7 @@ namespace Lidarr.Api.V3.Albums
|
|||
|
||||
if (!Request.Query.ArtistId.HasValue && !albumIdsQuery.HasValue)
|
||||
{
|
||||
throw new BadRequestException("artistId or albumIds must be provided");
|
||||
return MapToResource(_albumService.GetAllAlbums(), false);
|
||||
}
|
||||
|
||||
if (artistIdQuery.HasValue)
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace Lidarr.Api.V3.Artist
|
|||
{
|
||||
_artistService = artistService;
|
||||
Put["/"] = artist => SaveAll();
|
||||
Delete["/"] = artist => DeleteSeries();
|
||||
Delete["/"] = artist => DeleteArtist();
|
||||
}
|
||||
|
||||
private Response SaveAll()
|
||||
|
@ -70,7 +70,7 @@ namespace Lidarr.Api.V3.Artist
|
|||
.AsResponse(HttpStatusCode.Accepted);
|
||||
}
|
||||
|
||||
private Response DeleteSeries()
|
||||
private Response DeleteArtist()
|
||||
{
|
||||
var resource = Request.Body.FromJson<ArtistEditorResource>();
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ namespace Lidarr.Api.V3.Artist
|
|||
|
||||
var resource = artist.ToResource();
|
||||
MapCoversToLocal(resource);
|
||||
MapAlbums(resource);
|
||||
//MapAlbums(resource);
|
||||
FetchAndLinkArtistStatistics(resource);
|
||||
//PopulateAlternateTitles(resource);
|
||||
|
||||
|
@ -112,7 +112,7 @@ namespace Lidarr.Api.V3.Artist
|
|||
var artistsResources = _artistService.GetAllArtists().ToResource();
|
||||
|
||||
MapCoversToLocal(artistsResources.ToArray());
|
||||
MapAlbums(artistsResources.ToArray());
|
||||
//MapAlbums(artistsResources.ToArray());
|
||||
LinkArtistStatistics(artistsResources, artistStats);
|
||||
//PopulateAlternateTitles(seriesResources);
|
||||
|
||||
|
|
|
@ -164,12 +164,28 @@ namespace NzbDrone.Core.Music
|
|||
var album = _albumRepository.Get(albumId);
|
||||
_albumRepository.SetMonitoredFlat(album, monitored);
|
||||
|
||||
var tracks = _trackService.GetTracksByAlbum(albumId);
|
||||
foreach (var track in tracks)
|
||||
{
|
||||
track.Monitored = monitored;
|
||||
}
|
||||
_trackService.UpdateTracks(tracks);
|
||||
|
||||
_logger.Debug("Monitored flag for Album:{0} was set to {1}", albumId, monitored);
|
||||
}
|
||||
|
||||
public void SetMonitored(IEnumerable<int> ids, bool monitored)
|
||||
{
|
||||
_albumRepository.SetMonitored(ids, monitored);
|
||||
foreach (var id in ids)
|
||||
{
|
||||
var tracks = _trackService.GetTracksByAlbum(id);
|
||||
foreach (var track in tracks)
|
||||
{
|
||||
track.Monitored = monitored;
|
||||
}
|
||||
_trackService.UpdateTracks(tracks);
|
||||
}
|
||||
}
|
||||
|
||||
public List<Album> UpdateAlbums(List<Album> album)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue