mirror of
https://github.com/lidarr/Lidarr
synced 2025-02-26 15:52:42 +00:00
Fixed: ArtistRepo Cleanup
This commit is contained in:
parent
772bd88efa
commit
1bcee3ba97
3 changed files with 10 additions and 16 deletions
|
@ -14,7 +14,7 @@ public interface IArtistMetadataRepository : IBasicRepository<ArtistMetadata>
|
||||||
Artist Update(Artist artist);
|
Artist Update(Artist artist);
|
||||||
Artist Upsert(Artist artist);
|
Artist Upsert(Artist artist);
|
||||||
void UpdateMany(List<Artist> artists);
|
void UpdateMany(List<Artist> artists);
|
||||||
ArtistMetadata FindById(string ArtistId);
|
ArtistMetadata FindById(string foreignArtistId);
|
||||||
List<ArtistMetadata> FindById(List<string> foreignIds);
|
List<ArtistMetadata> FindById(List<string> foreignIds);
|
||||||
void UpsertMany(List<ArtistMetadata> artists);
|
void UpsertMany(List<ArtistMetadata> artists);
|
||||||
void UpsertMany(List<Artist> artists);
|
void UpsertMany(List<Artist> artists);
|
||||||
|
@ -83,9 +83,9 @@ public void UpdateMany(List<Artist> artists)
|
||||||
UpdateMany(artists.Select(x => x.Metadata.Value).ToList());
|
UpdateMany(artists.Select(x => x.Metadata.Value).ToList());
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArtistMetadata FindById(string artistId)
|
public ArtistMetadata FindById(string foreignArtistId)
|
||||||
{
|
{
|
||||||
return Query.Where(a => a.ForeignArtistId == artistId).SingleOrDefault();
|
return Query.Where(a => a.ForeignArtistId == foreignArtistId).SingleOrDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ArtistMetadata> FindById(List<string> foreignIds)
|
public List<ArtistMetadata> FindById(List<string> foreignIds)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NzbDrone.Core.Datastore;
|
using NzbDrone.Core.Datastore;
|
||||||
using NzbDrone.Core.Messaging.Events;
|
using NzbDrone.Core.Messaging.Events;
|
||||||
using Marr.Data.QGen;
|
using Marr.Data.QGen;
|
||||||
|
@ -10,8 +10,7 @@ public interface IArtistRepository : IBasicRepository<Artist>
|
||||||
{
|
{
|
||||||
bool ArtistPathExists(string path);
|
bool ArtistPathExists(string path);
|
||||||
Artist FindByName(string cleanTitle);
|
Artist FindByName(string cleanTitle);
|
||||||
Artist FindById(int dbId);
|
Artist FindById(string foreignArtistId);
|
||||||
Artist FindById(string spotifyId);
|
|
||||||
Artist GetArtistByMetadataId(int artistMetadataId);
|
Artist GetArtistByMetadataId(int artistMetadataId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,11 +34,6 @@ public Artist FindById(string foreignArtistId)
|
||||||
return Query.Where<ArtistMetadata>(m => m.ForeignArtistId == foreignArtistId).SingleOrDefault();
|
return Query.Where<ArtistMetadata>(m => m.ForeignArtistId == foreignArtistId).SingleOrDefault();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Artist FindById(int dbId)
|
|
||||||
{
|
|
||||||
return Query.Where(s => s.Id == dbId).SingleOrDefault();
|
|
||||||
}
|
|
||||||
|
|
||||||
public Artist FindByName(string cleanName)
|
public Artist FindByName(string cleanName)
|
||||||
{
|
{
|
||||||
cleanName = cleanName.ToLowerInvariant();
|
cleanName = cleanName.ToLowerInvariant();
|
||||||
|
|
|
@ -18,7 +18,7 @@ public interface IArtistService
|
||||||
List<Artist> GetArtists(IEnumerable<int> artistIds);
|
List<Artist> GetArtists(IEnumerable<int> artistIds);
|
||||||
Artist AddArtist(Artist newArtist);
|
Artist AddArtist(Artist newArtist);
|
||||||
List<Artist> AddArtists(List<Artist> newArtists);
|
List<Artist> AddArtists(List<Artist> newArtists);
|
||||||
Artist FindById(string spotifyId);
|
Artist FindById(string foreignArtistId);
|
||||||
Artist FindByName(string title);
|
Artist FindByName(string title);
|
||||||
Artist FindByNameInexact(string title);
|
Artist FindByNameInexact(string title);
|
||||||
List<Artist> GetCandidates(string title);
|
List<Artist> GetCandidates(string title);
|
||||||
|
@ -94,9 +94,9 @@ public void DeleteArtist(int artistId, bool deleteFiles, bool addImportListExclu
|
||||||
_eventAggregator.PublishEvent(new ArtistDeletedEvent(artist, deleteFiles, addImportListExclusion));
|
_eventAggregator.PublishEvent(new ArtistDeletedEvent(artist, deleteFiles, addImportListExclusion));
|
||||||
}
|
}
|
||||||
|
|
||||||
public Artist FindById(string spotifyId)
|
public Artist FindById(string foreignArtistId)
|
||||||
{
|
{
|
||||||
return _artistRepository.FindById(spotifyId);
|
return _artistRepository.FindById(foreignArtistId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Artist FindByName(string title)
|
public Artist FindByName(string title)
|
||||||
|
|
Loading…
Reference in a new issue