2019-07-25 20:42:42 +00:00
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
namespace NzbDrone.Core.Music
|
|
|
|
{
|
|
|
|
public interface IArtistMetadataService
|
|
|
|
{
|
|
|
|
bool Upsert(ArtistMetadata artist);
|
|
|
|
bool UpsertMany(List<ArtistMetadata> artists);
|
|
|
|
}
|
|
|
|
|
|
|
|
public class ArtistMetadataService : IArtistMetadataService
|
|
|
|
{
|
|
|
|
private readonly IArtistMetadataRepository _artistMetadataRepository;
|
|
|
|
|
2019-12-16 21:21:32 +00:00
|
|
|
public ArtistMetadataService(IArtistMetadataRepository artistMetadataRepository)
|
2019-07-25 20:42:42 +00:00
|
|
|
{
|
|
|
|
_artistMetadataRepository = artistMetadataRepository;
|
|
|
|
}
|
|
|
|
|
|
|
|
public bool Upsert(ArtistMetadata artist)
|
|
|
|
{
|
|
|
|
return _artistMetadataRepository.UpsertMany(new List<ArtistMetadata> { artist });
|
|
|
|
}
|
|
|
|
|
|
|
|
public bool UpsertMany(List<ArtistMetadata> artists)
|
|
|
|
{
|
|
|
|
return _artistMetadataRepository.UpsertMany(artists);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|