mirror of
https://github.com/lidarr/Lidarr
synced 2025-02-20 13:06:57 +00:00
Fixed all issues from merging
This commit is contained in:
parent
e7f72a9d08
commit
b4279a455e
3 changed files with 25 additions and 25 deletions
|
@ -77,7 +77,7 @@ public List<Series> SearchForNewSeries(string title)
|
|||
public Tuple<Artist, List<Album>> GetArtistInfo(string foreignArtistId)
|
||||
{
|
||||
|
||||
_logger.Debug("Getting Artist with SpotifyId of {0}", foreignArtistId);
|
||||
_logger.Debug("Getting Artist with LidarrAPI.MetadataID of {0}", foreignArtistId);
|
||||
|
||||
// We need to perform a direct lookup of the artist
|
||||
var httpRequest = _requestBuilder.Create()
|
||||
|
@ -296,7 +296,7 @@ private static Artist MapArtist(ArtistResource resource)
|
|||
Artist artist = new Artist();
|
||||
|
||||
artist.Name = resource.ArtistName;
|
||||
artist.ForeignArtistId = resource.Id; // TODO: Rename spotifyId to LidarrId
|
||||
artist.ForeignArtistId = resource.Id;
|
||||
artist.Genres = resource.Genres;
|
||||
artist.Overview = resource.Overview;
|
||||
artist.NameSlug = Parser.Parser.CleanArtistTitle(artist.Name);
|
||||
|
|
|
@ -13,11 +13,11 @@ namespace NzbDrone.Core.Music
|
|||
{
|
||||
public interface ITrackRepository : IBasicRepository<Track>
|
||||
{
|
||||
Track Find(int artistId, int albumId, int trackNumber);
|
||||
List<Track> GetTracks(int artistId);
|
||||
List<Track> GetTracks(int artistId, int albumId);
|
||||
Track Find(string artistId, string albumId, int trackNumber);
|
||||
List<Track> GetTracks(string artistId);
|
||||
List<Track> GetTracks(string artistId, string albumId);
|
||||
List<Track> GetTracksByFileId(int fileId);
|
||||
List<Track> TracksWithFiles(int artistId);
|
||||
List<Track> TracksWithFiles(string artistId);
|
||||
PagingSpec<Track> TracksWithoutFiles(PagingSpec<Track> pagingSpec);
|
||||
PagingSpec<Track> TracksWhereCutoffUnmet(PagingSpec<Track> pagingSpec, List<QualitiesBelowCutoff> qualitiesBelowCutoff);
|
||||
void SetMonitoredFlat(Track episode, bool monitored);
|
||||
|
@ -37,24 +37,24 @@ public TrackRepository(IMainDatabase database, IEventAggregator eventAggregator,
|
|||
_logger = logger;
|
||||
}
|
||||
|
||||
public Track Find(int artistId, int albumId, int trackNumber)
|
||||
public Track Find(string artistId, string albumId, int trackNumber)
|
||||
{
|
||||
return Query.Where(s => s.ArtistId == artistId)
|
||||
.AndWhere(s => s.AlbumId == albumId)
|
||||
return Query.Where(s => s.ForeignTrackId == artistId)
|
||||
.AndWhere(s => s.Album.ForeignAlbumId == albumId)
|
||||
.AndWhere(s => s.TrackNumber == trackNumber)
|
||||
.SingleOrDefault();
|
||||
}
|
||||
|
||||
|
||||
public List<Track> GetTracks(int artistId)
|
||||
public List<Track> GetTracks(string artistId)
|
||||
{
|
||||
return Query.Where(s => s.ArtistId == artistId).ToList();
|
||||
return Query.Where(s => s.ForeignTrackId == artistId).ToList();
|
||||
}
|
||||
|
||||
public List<Track> GetTracks(int artistId, int albumId)
|
||||
public List<Track> GetTracks(string artistId, string albumId)
|
||||
{
|
||||
return Query.Where(s => s.ArtistId == artistId)
|
||||
.AndWhere(s => s.AlbumId == albumId)
|
||||
return Query.Where(s => s.ForeignTrackId == artistId)
|
||||
.AndWhere(s => s.Album.ForeignAlbumId == albumId)
|
||||
.ToList();
|
||||
}
|
||||
|
||||
|
@ -63,10 +63,10 @@ public List<Track> GetTracksByFileId(int fileId)
|
|||
return Query.Where(e => e.TrackFileId == fileId).ToList();
|
||||
}
|
||||
|
||||
public List<Track> TracksWithFiles(int artistId)
|
||||
public List<Track> TracksWithFiles(string artistId)
|
||||
{
|
||||
return Query.Join<Track, TrackFile>(JoinType.Inner, e => e.TrackFile, (e, ef) => e.TrackFileId == ef.Id)
|
||||
.Where(e => e.ArtistId == artistId);
|
||||
.Where(e => e.ForeignTrackId == artistId);
|
||||
}
|
||||
|
||||
public PagingSpec<Track> TracksWhereCutoffUnmet(PagingSpec<Track> pagingSpec, List<QualitiesBelowCutoff> qualitiesBelowCutoff)
|
||||
|
|
|
@ -15,12 +15,12 @@ public interface ITrackService
|
|||
{
|
||||
Track GetTrack(int id);
|
||||
List<Track> GetTracks(IEnumerable<int> ids);
|
||||
Track FindTrack(int artistId, int albumId, int trackNumber);
|
||||
Track FindTrackByTitle(int artistId, int albumId, string releaseTitle);
|
||||
List<Track> GetTracksByArtist(int artistId);
|
||||
List<Track> GetTracksByAlbum(int artistId, int albumId);
|
||||
Track FindTrack(string artistId, string albumId, int trackNumber);
|
||||
Track FindTrackByTitle(string artistId, string albumId, string releaseTitle);
|
||||
List<Track> GetTracksByArtist(string artistId);
|
||||
List<Track> GetTracksByAlbum(string artistId, string albumId);
|
||||
//List<Track> GetTracksByAlbumTitle(string artistId, string albumTitle);
|
||||
List<Track> TracksWithFiles(int artistId);
|
||||
List<Track> TracksWithFiles(string artistId);
|
||||
//PagingSpec<Track> TracksWithoutFiles(PagingSpec<Track> pagingSpec);
|
||||
List<Track> GetTracksByFileId(int trackFileId);
|
||||
void UpdateTrack(Track track);
|
||||
|
@ -65,12 +65,12 @@ public List<Track> GetTracksByArtist(string artistId)
|
|||
return _trackRepository.GetTracks(artistId).ToList();
|
||||
}
|
||||
|
||||
public List<Track> GetTracksByAlbum(int artistId, int albumId)
|
||||
public List<Track> GetTracksByAlbum(string artistId, string albumId)
|
||||
{
|
||||
return _trackRepository.GetTracks(artistId, albumId);
|
||||
}
|
||||
|
||||
public Track FindTrackByTitle(int artistId, int albumId, string releaseTitle)
|
||||
public Track FindTrackByTitle(string artistId, string albumId, string releaseTitle)
|
||||
{
|
||||
// TODO: can replace this search mechanism with something smarter/faster/better
|
||||
var normalizedReleaseTitle = Parser.Parser.NormalizeEpisodeTitle(releaseTitle).Replace(".", " ");
|
||||
|
@ -96,7 +96,7 @@ public Track FindTrackByTitle(int artistId, int albumId, string releaseTitle)
|
|||
return null;
|
||||
}
|
||||
|
||||
public List<Track> TracksWithFiles(int artistId)
|
||||
public List<Track> TracksWithFiles(string artistId)
|
||||
{
|
||||
return _trackRepository.TracksWithFiles(artistId);
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ public void DeleteMany(List<Track> tracks)
|
|||
|
||||
public void HandleAsync(ArtistDeletedEvent message)
|
||||
{
|
||||
var tracks = GetTracksByArtist(message.Artist.Id);
|
||||
var tracks = GetTracksByArtist(message.Artist.ForeignArtistId);
|
||||
_trackRepository.DeleteMany(tracks);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue