Back to a stable build. Fixedtrackrepo.findtracks

pull/6/head
Joseph Milazzo 7 years ago
parent b4279a455e
commit e96cf08409

@ -20,7 +20,7 @@ namespace NzbDrone.Common.Cloud
//Search = new HttpRequestBuilder("https://api.spotify.com/{version}/{route}/") // TODO: maybe use {version}
// .SetSegment("version", "v1")
// .CreateFactory();
Search = new HttpRequestBuilder("http://localhost:5000/{route}/") // TODO: maybe use {version}
Search = new HttpRequestBuilder("http://localhost:3000/{route}/") // TODO: maybe use {version}
.CreateFactory();
InternalSearch = new HttpRequestBuilder("https://itunes.apple.com/WebObjects/MZStore.woa/wa/{route}") //viewArtist or search

@ -87,7 +87,7 @@ namespace NzbDrone.Core.MediaFiles
return;
}
_logger.ProgressInfo("Scanning disk for {0}", artist.ArtistName);
_logger.ProgressInfo("Scanning disk for {0}", artist.Name);
if (!_diskProvider.FolderExists(artist.Path))
{
@ -136,7 +136,7 @@ namespace NzbDrone.Core.MediaFiles
private void CompletedScanning(Artist artist)
{
_logger.Info("Completed scanning disk for {0}", artist.ArtistName);
_logger.Info("Completed scanning disk for {0}", artist.Name);
_eventAggregator.PublishEvent(new ArtistScannedEvent(artist));
}

@ -27,7 +27,7 @@ namespace NzbDrone.Core.MediaFiles
public List<TrackFile> GetFilesByArtist(string artistId)
{
return Query.Where(c => c.SpotifyTrackId == artistId).ToList();
return Query.Where(c => c.ForeignTrackId == artistId).ToList();
}
}
}

@ -69,7 +69,7 @@ namespace NzbDrone.Core.MediaFiles
public List<string> FilterExistingFiles(List<string> files, Artist artist)
{
var artistFiles = GetFilesByArtist(artist.SpotifyId).Select(f => Path.Combine(artist.Path, f.RelativePath)).ToList();
var artistFiles = GetFilesByArtist(artist.ForeignArtistId).Select(f => Path.Combine(artist.Path, f.RelativePath)).ToList();
if (!artistFiles.Any()) return files;
@ -89,7 +89,7 @@ namespace NzbDrone.Core.MediaFiles
public void HandleAsync(ArtistDeletedEvent message)
{
var files = GetFilesByArtist(message.Artist.SpotifyId);
var files = GetFilesByArtist(message.Artist.ForeignArtistId);
_mediaFileRepository.DeleteMany(files);
}

@ -31,8 +31,8 @@ namespace NzbDrone.Core.MediaFiles
public void Clean(Artist artist, List<string> filesOnDisk)
{
var artistFiles = _mediaFileService.GetFilesByArtist(artist.SpotifyId);
var tracks = _trackService.GetTracksByArtist(artist.SpotifyId);
var artistFiles = _mediaFileService.GetFilesByArtist(artist.ForeignArtistId);
var tracks = _trackService.GetTracksByArtist(artist.ForeignArtistId);
var filesOnDiskKeys = new HashSet<string>(filesOnDisk, PathEqualityComparer.Instance);

@ -65,7 +65,7 @@ namespace NzbDrone.Core.MediaFiles.MediaInfo
return;
}
var allMediaFiles = _mediaFileService.GetFilesByArtist(message.Artist.SpotifyId);
var allMediaFiles = _mediaFileService.GetFilesByArtist(message.Artist.ForeignArtistId);
var filteredMediaFiles = allMediaFiles.Where(c => c.MediaInfo == null || c.MediaInfo.SchemaRevision < CURRENT_MEDIA_INFO_SCHEMA_REVISION).ToList();
UpdateMediaInfo(message.Artist, filteredMediaFiles);

@ -12,7 +12,8 @@ namespace NzbDrone.Core.MediaFiles
{
public class TrackFile : ModelBase
{
public string SpotifyTrackId { get; set; }
public string ForeignTrackId { get; set; }
public string ForeignArtistId { get; set; }
public int AlbumId { get; set; }
public string RelativePath { get; set; }
public string Path { get; set; }

@ -73,7 +73,7 @@ namespace NzbDrone.Core.MediaFiles.TrackImport
var trackFile = new TrackFile();
trackFile.DateAdded = DateTime.UtcNow;
trackFile.SpotifyTrackId = localTrack.Artist.SpotifyId;
trackFile.ForeignArtistId = localTrack.Artist.ForeignArtistId;
trackFile.Path = localTrack.Path.CleanFilePath();
trackFile.Size = _diskProvider.GetFileSize(localTrack.Path);
trackFile.Quality = localTrack.Quality;

@ -33,7 +33,7 @@ namespace NzbDrone.Core.Music
var successCount = 0;
var failCount = 0;
var existingTracks = _trackService.GetTracksByAlbum(album.ArtistId, album.Id);
var existingTracks = _trackService.GetTracksByAlbum(album.ForeignAlbumId, album.ForeignAlbumId);
//var albums = artist.Albums;
var updateList = new List<Track>();

@ -48,7 +48,7 @@ namespace NzbDrone.Core.Music
public List<Track> GetTracks(string artistId)
{
return Query.Where(s => s.ForeignTrackId == artistId).ToList();
return Query.Join<Track, Artist>(JoinType.Inner, s => s.Artist, (track, artist) => track.ArtistId == artist.Id).ToList();
}
public List<Track> GetTracks(string artistId, string albumId)

Loading…
Cancel
Save