You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
879 B
31 lines
879 B
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using Lidarr.Http;
|
|
using Microsoft.AspNetCore.Mvc;
|
|
using NzbDrone.Core.MediaFiles;
|
|
|
|
namespace Lidarr.Api.V1.Tracks
|
|
{
|
|
[V1ApiController("retag")]
|
|
public class RetagTrackController : Controller
|
|
{
|
|
private readonly IAudioTagService _audioTagService;
|
|
|
|
public RetagTrackController(IAudioTagService audioTagService)
|
|
{
|
|
_audioTagService = audioTagService;
|
|
}
|
|
|
|
[HttpGet]
|
|
public List<RetagTrackResource> GetTracks(int artistId, int? albumId)
|
|
{
|
|
if (albumId.HasValue)
|
|
{
|
|
return _audioTagService.GetRetagPreviewsByAlbum(albumId.Value).Where(x => x.Changes.Any()).ToResource();
|
|
}
|
|
|
|
return _audioTagService.GetRetagPreviewsByArtist(artistId).Where(x => x.Changes.Any()).ToResource();
|
|
}
|
|
}
|
|
}
|