diff --git a/src/NzbDrone.Api/Music/ArtistModule.cs b/src/NzbDrone.Api/Music/ArtistModule.cs index d7ef5fed3..7f0065d64 100644 --- a/src/NzbDrone.Api/Music/ArtistModule.cs +++ b/src/NzbDrone.Api/Music/ArtistModule.cs @@ -71,7 +71,7 @@ namespace NzbDrone.Api.Music PostValidator.RuleFor(s => s.Path).IsValidPath().When(s => s.RootFolderPath.IsNullOrWhiteSpace()); PostValidator.RuleFor(s => s.RootFolderPath).IsValidPath().When(s => s.Path.IsNullOrWhiteSpace()); - PostValidator.RuleFor(s => s.SpotifyId).NotEqual("").SetValidator(artistExistsValidator); + PostValidator.RuleFor(s => s.ForeignArtistId).NotEqual("").SetValidator(artistExistsValidator); PutValidator.RuleFor(s => s.Path).IsValidPath(); } diff --git a/src/NzbDrone.Api/Music/ArtistResource.cs b/src/NzbDrone.Api/Music/ArtistResource.cs index 71cc14b85..d75fbebdb 100644 --- a/src/NzbDrone.Api/Music/ArtistResource.cs +++ b/src/NzbDrone.Api/Music/ArtistResource.cs @@ -18,8 +18,8 @@ namespace NzbDrone.Api.Music //View Only - public string ArtistName { get; set; } - public string SpotifyId { get; set; } + public string Name { get; set; } + public string ForeignArtistId { get; set; } public string Overview { get; set; } public int AlbumCount @@ -59,7 +59,7 @@ namespace NzbDrone.Api.Music public DateTime Added { get; set; } public AddSeriesOptions AddOptions { get; set; } public Ratings Ratings { get; set; } - public string ArtistSlug { get; internal set; } + public string NameSlug { get; set; } } public static class ArtistResourceMapper @@ -72,7 +72,7 @@ namespace NzbDrone.Api.Music { Id = model.Id, - ArtistName = model.ArtistName, + Name = model.Name, //AlternateTitles //SortTitle = resource.SortTitle, @@ -94,7 +94,6 @@ namespace NzbDrone.Api.Music Path = model.Path, ProfileId = model.ProfileId, - ArtistFolder = model.ArtistFolder, Monitored = model.Monitored, //UseSceneNumbering = resource.UseSceneNumbering, @@ -105,8 +104,8 @@ namespace NzbDrone.Api.Music //FirstAired = resource.FirstAired, //LastInfoSync = resource.LastInfoSync, //SeriesType = resource.SeriesType, - SpotifyId = model.SpotifyId, - ArtistSlug = model.ArtistSlug, + ForeignArtistId = model.ForeignArtistId, + NameSlug = model.NameSlug, RootFolderPath = model.RootFolderPath, Genres = model.Genres, @@ -125,7 +124,7 @@ namespace NzbDrone.Api.Music { Id = resource.Id, - ArtistName = resource.ArtistName, + Name = resource.Name, //AlternateTitles //SortTitle = resource.SortTitle, @@ -147,11 +146,10 @@ namespace NzbDrone.Api.Music Path = resource.Path, ProfileId = resource.ProfileId, - ArtistFolder = resource.ArtistFolder, Monitored = resource.Monitored, //LastInfoSync = resource.LastInfoSync, - SpotifyId = resource.SpotifyId, - ArtistSlug = resource.ArtistSlug, + ForeignArtistId = resource.ForeignArtistId, + NameSlug = resource.NameSlug, RootFolderPath = resource.RootFolderPath, Genres = resource.Genres, diff --git a/src/NzbDrone.Core/Datastore/Migration/111_setup_music.cs b/src/NzbDrone.Core/Datastore/Migration/111_setup_music.cs index 12b0c2d0b..57decb35d 100644 --- a/src/NzbDrone.Core/Datastore/Migration/111_setup_music.cs +++ b/src/NzbDrone.Core/Datastore/Migration/111_setup_music.cs @@ -12,64 +12,91 @@ namespace NzbDrone.Core.Datastore.Migration { protected override void MainDbUpgrade() { - Create.TableForModel("Artist") - .WithColumn("SpotifyId").AsString().Nullable().Unique() - .WithColumn("ArtistName").AsString().Unique() - .WithColumn("ArtistSlug").AsString().Nullable() //.Unique() - .WithColumn("CleanTitle").AsString().Nullable() // Do we need this? - .WithColumn("Monitored").AsBoolean() + Create.TableForModel("Artists") + .WithColumn("ForeignArtistId").AsString().Unique() + .WithColumn("MBId").AsString().Nullable() + .WithColumn("AMId").AsString().Nullable() + .WithColumn("TADBId").AsInt32().Nullable() + .WithColumn("DiscogsId").AsInt32().Nullable() + .WithColumn("Name").AsString() + .WithColumn("NameSlug").AsString().Nullable().Unique() + .WithColumn("CleanName").AsString().Indexed() + .WithColumn("Status").AsInt32() .WithColumn("Overview").AsString().Nullable() - .WithColumn("AlbumFolder").AsBoolean().Nullable() - .WithColumn("ArtistFolder").AsBoolean().Nullable() + .WithColumn("Images").AsString() + .WithColumn("Path").AsString().Indexed() + .WithColumn("Monitored").AsBoolean() + .WithColumn("AlbumFolder").AsBoolean() .WithColumn("LastInfoSync").AsDateTime().Nullable() .WithColumn("LastDiskSync").AsDateTime().Nullable() - .WithColumn("Status").AsInt32().Nullable() - .WithColumn("Path").AsString() - .WithColumn("Images").AsString().Nullable() - .WithColumn("QualityProfileId").AsInt32().Nullable() - .WithColumn("RootFolderPath").AsString().Nullable() - .WithColumn("Added").AsDateTime().Nullable() - .WithColumn("ProfileId").AsInt32().Nullable() // This is either ProfileId or Profile + .WithColumn("DateFormed").AsDateTime().Nullable() + .WithColumn("Members").AsString().Nullable() + .WithColumn("Ratings").AsString().Nullable() .WithColumn("Genres").AsString().Nullable() - .WithColumn("Albums").AsString().Nullable() + .WithColumn("SortName").AsString().Nullable() + .WithColumn("ProfileId").AsInt32().Nullable() .WithColumn("Tags").AsString().Nullable() - .WithColumn("AddOptions").AsString().Nullable() - ; + .WithColumn("Added").AsDateTime().Nullable() + .WithColumn("AddOptions").AsString().Nullable(); Create.TableForModel("Albums") - .WithColumn("AlbumId").AsString().Unique() - .WithColumn("ArtistId").AsInt32() // Should this be artistId (string) + .WithColumn("ForeignArtistId").AsString().Unique() + .WithColumn("ArtistId").AsInt32() + .WithColumn("MBId").AsString().Indexed() + .WithColumn("AMId").AsString().Nullable() + .WithColumn("TADBId").AsInt32().Indexed() + .WithColumn("DiscogsId").AsInt32().Nullable() .WithColumn("Title").AsString() - .WithColumn("Year").AsInt32() - .WithColumn("Image").AsInt32() - .WithColumn("TrackCount").AsInt32() - .WithColumn("DiscCount").AsInt32() + .WithColumn("TitleSlug").AsString().Nullable().Unique() + .WithColumn("CleanTitle").AsString().Indexed() + .WithColumn("Status").AsInt32() + .WithColumn("Overview").AsString().Nullable() + .WithColumn("Images").AsString() + .WithColumn("Path").AsString().Indexed() .WithColumn("Monitored").AsBoolean() - .WithColumn("Overview").AsString(); + .WithColumn("LastInfoSync").AsDateTime().Nullable() + .WithColumn("LastDiskSync").AsDateTime().Nullable() + .WithColumn("ReleaseDate").AsDateTime().Nullable() + .WithColumn("Ratings").AsString().Nullable() + .WithColumn("Genres").AsString().Nullable() + .WithColumn("Label").AsString().Nullable() + .WithColumn("SortTitle").AsString().Nullable() + .WithColumn("ProfileId").AsInt32().Nullable() + .WithColumn("Tags").AsString().Nullable() + .WithColumn("Added").AsDateTime().Nullable() + .WithColumn("AlbumType").AsString() + .WithColumn("AddOptions").AsString().Nullable(); Create.TableForModel("Tracks") - .WithColumn("SpotifyTrackId").AsString().Nullable() // This shouldn't be nullable, but TrackRepository won't behave. Someone please fix this. - .WithColumn("AlbumId").AsString() - .WithColumn("ArtistId").AsString() // This may be a list of Ids in future for compilations - .WithColumn("ArtistSpotifyId").AsString() - .WithColumn("Compilation").AsBoolean() + .WithColumn("ArtistId").AsInt32().Indexed() + .WithColumn("AlbumId").AsInt32() + .WithColumn("MBId").AsString().Indexed() .WithColumn("TrackNumber").AsInt32() .WithColumn("Title").AsString().Nullable() - .WithColumn("Ignored").AsBoolean().Nullable() - .WithColumn("Explict").AsBoolean() + .WithColumn("Explicit").AsBoolean() + .WithColumn("DiscNumber").AsInt32().Nullable() + .WithColumn("TrackFileId").AsInt32().Nullable().Indexed() .WithColumn("Monitored").AsBoolean() - .WithColumn("TrackFileId").AsInt32().Nullable() - .WithColumn("ReleaseDate").AsDateTime().Nullable(); + .WithColumn("Ratings").AsString().Nullable(); + Create.Index().OnTable("Tracks").OnColumn("ArtistId").Ascending() + .OnColumn("AlbumId").Ascending() + .OnColumn("TrackNumber").Ascending(); Create.TableForModel("TrackFiles") - .WithColumn("ArtistId").AsInt32() - .WithColumn("Path").AsString().Unique() + .WithColumn("ArtistId").AsInt32().Indexed() + .WithColumn("AlbumId").AsInt32().Indexed() .WithColumn("Quality").AsString() .WithColumn("Size").AsInt64() .WithColumn("DateAdded").AsDateTime() - .WithColumn("AlbumId").AsInt32(); // How does this impact stand alone tracks? + .WithColumn("SceneName").AsString().Nullable() + .WithColumn("ReleaseGroup").AsString().Nullable() + .WithColumn("MediaInfo").AsString().Nullable() + .WithColumn("RelativePath").AsString().Nullable(); + Alter.Table("NamingConfig") + .AddColumn("ArtistFolderFormat").AsString().Nullable() + .AddColumn("AlbumFolderFormat").AsString().Nullable(); } } diff --git a/src/NzbDrone.Core/Datastore/Migration/112_Add_music_fields_to_NamingConfig.cs b/src/NzbDrone.Core/Datastore/Migration/112_Add_music_fields_to_NamingConfig.cs deleted file mode 100644 index b855e1e28..000000000 --- a/src/NzbDrone.Core/Datastore/Migration/112_Add_music_fields_to_NamingConfig.cs +++ /dev/null @@ -1,15 +0,0 @@ -using FluentMigrator; -using NzbDrone.Core.Datastore.Migration.Framework; - -namespace NzbDrone.Core.Datastore.Migration -{ - [Migration(112)] - public class add_music_fields_to_namingconfig : NzbDroneMigrationBase - { - protected override void MainDbUpgrade() - { - Alter.Table("NamingConfig").AddColumn("ArtistFolderFormat").AsAnsiString().Nullable(); - Alter.Table("NamingConfig").AddColumn("AlbumFolderFormat").AsAnsiString().Nullable(); - } - } -} diff --git a/src/NzbDrone.Core/Datastore/TableMapping.cs b/src/NzbDrone.Core/Datastore/TableMapping.cs index 9b9905adc..db5eaa1ac 100644 --- a/src/NzbDrone.Core/Datastore/TableMapping.cs +++ b/src/NzbDrone.Core/Datastore/TableMapping.cs @@ -92,11 +92,13 @@ namespace NzbDrone.Core.Datastore .Relationship() .HasOne(episode => episode.EpisodeFile, episode => episode.EpisodeFileId); - Mapper.Entity().RegisterModel("Artist") + Mapper.Entity().RegisterModel("Artists") .Ignore(s => s.RootFolderPath) .Relationship() .HasOne(a => a.Profile, a => a.ProfileId); + Mapper.Entity().RegisterModel("Album"); + Mapper.Entity().RegisterModel("TrackFiles") .Ignore(f => f.Path) .Relationships.AutoMapICollectionOrComplexProperties() diff --git a/src/NzbDrone.Core/Download/AlbumGrabbedEvent.cs b/src/NzbDrone.Core/Download/AlbumGrabbedEvent.cs new file mode 100644 index 000000000..5b7972802 --- /dev/null +++ b/src/NzbDrone.Core/Download/AlbumGrabbedEvent.cs @@ -0,0 +1,17 @@ +using NzbDrone.Common.Messaging; +using NzbDrone.Core.Parser.Model; + +namespace NzbDrone.Core.Download +{ + public class AlbumGrabbedEvent : IEvent + { + public RemoteAlbum Album { get; private set; } + public string DownloadClient { get; set; } + public string DownloadId { get; set; } + + public AlbumGrabbedEvent(RemoteAlbum album) + { + Album = album; + } + } +} \ No newline at end of file diff --git a/src/NzbDrone.Core/MetadataSource/SkyHook/Resource/AlbumInfoResource.cs b/src/NzbDrone.Core/MetadataSource/SkyHook/Resource/AlbumResource.cs similarity index 92% rename from src/NzbDrone.Core/MetadataSource/SkyHook/Resource/AlbumInfoResource.cs rename to src/NzbDrone.Core/MetadataSource/SkyHook/Resource/AlbumResource.cs index 7f478ea3c..7c1a918f0 100644 --- a/src/NzbDrone.Core/MetadataSource/SkyHook/Resource/AlbumInfoResource.cs +++ b/src/NzbDrone.Core/MetadataSource/SkyHook/Resource/AlbumResource.cs @@ -5,9 +5,9 @@ using System.Text; namespace NzbDrone.Core.MetadataSource.SkyHook.Resource { - public class AlbumInfoResource + public class AlbumResource { - public AlbumInfoResource() + public AlbumResource() { } diff --git a/src/NzbDrone.Core/MetadataSource/SkyHook/Resource/ArtistResource.cs b/src/NzbDrone.Core/MetadataSource/SkyHook/Resource/ArtistResource.cs index d85d675a4..c2c922d1b 100644 --- a/src/NzbDrone.Core/MetadataSource/SkyHook/Resource/ArtistResource.cs +++ b/src/NzbDrone.Core/MetadataSource/SkyHook/Resource/ArtistResource.cs @@ -5,47 +5,20 @@ using System.Text; namespace NzbDrone.Core.MetadataSource.SkyHook.Resource { - - public class AristResultResource - { - public AristResultResource() - { - - } - - public List Items { get; set; } - public int Count { get; set; } - } - - public class AlbumResultResource - { - public AlbumResultResource() - { - - } - - public List Items { get; set; } - public int Count { get; set; } - } - - public class TrackResultResource - { - public TrackResultResource() - { - - } - - public List Items { get; set; } - public int Count { get; set; } - } public class ArtistResource { - public ArtistResource() - { - + public ArtistResource() { + Albums = new List(); + Tracks = new List(); } - public AristResultResource Artists { get; set; } - public AristResultResource Albums { get; set; } + public List Genres { get; set; } + public string AristUrl { get; set; } + public string Overview { get; set; } + public string Id { get; set; } + public List Images { get; set; } + public string ArtistName { get; set; } + public List Albums { get; set; } + public List Tracks { get; set; } } } diff --git a/src/NzbDrone.Core/MetadataSource/SkyHook/Resource/TrackInfoResource.cs b/src/NzbDrone.Core/MetadataSource/SkyHook/Resource/TrackResource.cs similarity index 88% rename from src/NzbDrone.Core/MetadataSource/SkyHook/Resource/TrackInfoResource.cs rename to src/NzbDrone.Core/MetadataSource/SkyHook/Resource/TrackResource.cs index 3bdf71977..c2d4eddd2 100644 --- a/src/NzbDrone.Core/MetadataSource/SkyHook/Resource/TrackInfoResource.cs +++ b/src/NzbDrone.Core/MetadataSource/SkyHook/Resource/TrackResource.cs @@ -5,9 +5,9 @@ using System.Text; namespace NzbDrone.Core.MetadataSource.SkyHook.Resource { - public class TrackInfoResource + public class TrackResource { - public TrackInfoResource() + public TrackResource() { } diff --git a/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs b/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs index 093fb88e5..f4ae40a16 100644 --- a/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs +++ b/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs @@ -108,92 +108,96 @@ namespace NzbDrone.Core.MetadataSource.SkyHook } // It is safe to assume an id will only return one Artist back - Artist artist = new Artist(); - artist.ArtistName = httpResponse.Resource.Artists.Items[0].ArtistName; - artist.SpotifyId = httpResponse.Resource.Artists.Items[0].Id; - artist.Genres = httpResponse.Resource.Artists.Items[0].Genres; - - var albumRet = MapAlbums(artist); - artist = albumRet.Item1; - - - - return new Tuple>(albumRet.Item1, albumRet.Item2); - } - - private Tuple> MapAlbums(Artist artist) - { - - // Find all albums for the artist and all tracks for said album - ///v1/artists/{id}/albums - var httpRequest = _requestBuilder.Create() - .SetSegment("route", "artists/" + artist.SpotifyId + "/albums") - .Build(); - httpRequest.AllowAutoRedirect = true; - httpRequest.SuppressHttpError = true; + var albums = httpResponse.Resource.Albums.Select(MapAlbum); + var tracks = httpResponse.Resource.Tracks.Select(MapTrack); + var artist = MapArtist(httpResponse.Resource); - var httpResponse = _httpClient.Get(httpRequest); - - if (httpResponse.HasHttpError) - { - throw new HttpException(httpRequest, httpResponse); - } - - List masterTracks = new List(); - List albums = new List(); - foreach(var albumResource in httpResponse.Resource.Items) - { - Album album = new Album(); - album.AlbumId = albumResource.Id; - album.Title = albumResource.AlbumName; - album.ArtworkUrl = albumResource.Images.Count > 0 ? albumResource.Images[0].Url : ""; - album.Tracks = MapTracksToAlbum(album); - masterTracks.InsertRange(masterTracks.Count, album.Tracks); - albums.Add(album); - } + //artist.Name = httpResponse.Resource.Artists.Items[0].ArtistName; + + //artist.ForeignArtistId = httpResponse.Resource.Artists.Items[0].Id; + //artist.Genres = httpResponse.Resource.Artists.Items[0].Genres; - // TODO: We now need to get all tracks for each album + //var albumRet = MapAlbums(artist); + //artist = albumRet.Item1; - artist.Albums = albums; - return new Tuple>(artist, masterTracks); + return new Tuple>(artist, tracks.ToList()); } - private List MapTracksToAlbum(Album album) - { - var httpRequest = _requestBuilder.Create() - .SetSegment("route", "albums/" + album.AlbumId + "/tracks") - .Build(); - - httpRequest.AllowAutoRedirect = true; - httpRequest.SuppressHttpError = true; - var httpResponse = _httpClient.Get(httpRequest); - if (httpResponse.HasHttpError) - { - throw new HttpException(httpRequest, httpResponse); - } + //private Tuple> MapAlbums(Artist artist) + //{ - List tracks = new List(); - foreach(var trackResource in httpResponse.Resource.Items) - { - Track track = new Track(); - track.AlbumId = album.AlbumId; - //track.Album = album; // This will cause infinite loop when trying to serialize. - // TODO: Implement more track mapping - //track.Artist = trackResource.Artists - //track.ArtistId = album. - track.SpotifyTrackId = trackResource.Id; - track.ArtistSpotifyId = trackResource.Artists.Count > 0 ? trackResource.Artists[0].Id : null; - track.Explict = trackResource.Explicit; - track.Compilation = trackResource.Artists.Count > 1; - track.TrackNumber = trackResource.TrackNumber; - track.Title = trackResource.TrackName; - tracks.Add(track); - } + // // Find all albums for the artist and all tracks for said album + // ///v1/artists/{id}/albums + // var httpRequest = _requestBuilder.Create() + // .SetSegment("route", "artists/" + artist.ForeignArtistId + "/albums") + // .Build(); + // httpRequest.AllowAutoRedirect = true; + // httpRequest.SuppressHttpError = true; + + // var httpResponse = _httpClient.Get(httpRequest); + + // if (httpResponse.HasHttpError) + // { + // throw new HttpException(httpRequest, httpResponse); + // } + + // List masterTracks = new List(); + // List albums = new List(); + // foreach(var albumResource in httpResponse.Resource.Items) + // { + // Album album = new Album(); + // album.AlbumId = albumResource.Id; + // album.Title = albumResource.AlbumName; + // album.ArtworkUrl = albumResource.Images.Count > 0 ? albumResource.Images[0].Url : ""; + // album.Tracks = MapTracksToAlbum(album); + // masterTracks.InsertRange(masterTracks.Count, album.Tracks); + // albums.Add(album); + // } + + // // TODO: We now need to get all tracks for each album + + // artist.Albums = albums; + // return new Tuple>(artist, masterTracks); + //} - return tracks; - } + //private List MapTracksToAlbum(Album album) + //{ + // var httpRequest = _requestBuilder.Create() + // .SetSegment("route", "albums/" + album.AlbumId + "/tracks") + // .Build(); + + // httpRequest.AllowAutoRedirect = true; + // httpRequest.SuppressHttpError = true; + + // var httpResponse = _httpClient.Get(httpRequest); + + // if (httpResponse.HasHttpError) + // { + // throw new HttpException(httpRequest, httpResponse); + // } + + // List tracks = new List(); + // foreach(var trackResource in httpResponse.Resource.Items) + // { + // Track track = new Track(); + // track.AlbumId = album.AlbumId; + // //track.Album = album; // This will cause infinite loop when trying to serialize. + // // TODO: Implement more track mapping + // //track.Artist = trackResource.Artists + // //track.ArtistId = album. + // track.SpotifyTrackId = trackResource.Id; + // track.ArtistSpotifyId = trackResource.Artists.Count > 0 ? trackResource.Artists[0].Id : null; + // track.Explict = trackResource.Explicit; + // track.Compilation = trackResource.Artists.Count > 1; + // track.TrackNumber = trackResource.TrackNumber; + // track.Title = trackResource.TrackName; + // tracks.Add(track); + // } + + // return tracks; + //} public List SearchForNewArtist(string title) @@ -230,12 +234,26 @@ namespace NzbDrone.Core.MetadataSource.SkyHook - var httpResponse = _httpClient.Get(httpRequest); + var httpResponse = _httpClient.Get>(httpRequest); + + return httpResponse.Resource.SelectList(MapArtist); + //List artists = MapArtists(httpResponse.Resource); + //List artists = new List(); + //foreach (var artistResource in httpResponse.Resource.Artists.Items) + //{ + // Artist artist = new Artist(); + // artist.Name = artistResource.ArtistName; + // artist.ForeignArtistId = artistResource.Id; // TODO: Rename spotifyId to LidarrId + // artist.Genres = artistResource.Genres; + // artist.NameSlug = Parser.Parser.CleanArtistTitle(artist.Name); + // artist.CleanName = Parser.Parser.CleanArtistTitle(artist.Name); + //artist.Images = artistResource.Images; + // artists.Add(artist); + //} - List artists = MapArtists(httpResponse.Resource); - return artists; + //return artists; } catch (HttpException) { @@ -248,27 +266,37 @@ namespace NzbDrone.Core.MetadataSource.SkyHook } } - private List MapArtists(ArtistResource resource) + private static Album MapAlbum(AlbumResource resource) + { + Album album = new Album(); + return album; + } + + private static Track MapTrack(TrackResource resource) + { + Track track = new Track(); + return track; + } + + private static Artist MapArtist(ArtistResource resource) { + Artist artist = new Artist(); + + artist.Name = resource.ArtistName; + artist.ForeignArtistId = resource.Id; // TODO: Rename spotifyId to LidarrId + artist.Genres = resource.Genres; + artist.Overview = resource.Overview; + artist.NameSlug = Parser.Parser.CleanArtistTitle(artist.Name); + artist.CleanName = Parser.Parser.CleanArtistTitle(artist.Name); + //artist.Images = resource.Artists.Items[0].Images; + - List artists = new List(); - foreach(var artistResource in resource.Artists.Items) - { - Artist artist = new Artist(); - artist.ArtistName = artistResource.ArtistName; - artist.SpotifyId = artistResource.Id; // TODO: Rename spotifyId to LidarrId - artist.Genres = artistResource.Genres; - artist.ArtistSlug = Parser.Parser.CleanArtistTitle(artist.ArtistName); - //artist.Images = artistResource.Images; - - artists.Add(artist); - } // Maybe? Get all the albums for said artist - return artists; + return artist; } //private Album MapAlbum(AlbumResource albumQuery) diff --git a/src/NzbDrone.Core/Music/AddArtistService.cs b/src/NzbDrone.Core/Music/AddArtistService.cs index 2a1358b5b..aab228341 100644 --- a/src/NzbDrone.Core/Music/AddArtistService.cs +++ b/src/NzbDrone.Core/Music/AddArtistService.cs @@ -48,11 +48,11 @@ namespace NzbDrone.Core.Music if (string.IsNullOrWhiteSpace(newArtist.Path)) { - var folderName = newArtist.ArtistName;// TODO: _fileNameBuilder.GetArtistFolder(newArtist); + var folderName = newArtist.Name;// TODO: _fileNameBuilder.GetArtistFolder(newArtist); newArtist.Path = Path.Combine(newArtist.RootFolderPath, folderName); } - newArtist.CleanTitle = newArtist.ArtistName.CleanSeriesTitle(); + newArtist.CleanName = newArtist.Name.CleanSeriesTitle(); //newArtist.SortTitle = ArtistNameNormalizer.Normalize(newArtist.ArtistName, newArtist.ItunesId); // There is no Sort Title newArtist.Added = DateTime.UtcNow; @@ -75,15 +75,15 @@ namespace NzbDrone.Core.Music try { - tuple = _artistInfo.GetArtistInfo(newArtist.SpotifyId); + tuple = _artistInfo.GetArtistInfo(newArtist.ForeignArtistId); } catch (ArtistNotFoundException) { - _logger.Error("SpotifyId {1} was not found, it may have been removed from Spotify.", newArtist.SpotifyId); + _logger.Error("SpotifyId {1} was not found, it may have been removed from Spotify.", newArtist.ForeignArtistId); throw new ValidationException(new List { - new ValidationFailure("SpotifyId", "An artist with this ID was not found", newArtist.SpotifyId) + new ValidationFailure("SpotifyId", "An artist with this ID was not found", newArtist.ForeignArtistId) }); } diff --git a/src/NzbDrone.Core/Music/AddArtistValidator.cs b/src/NzbDrone.Core/Music/AddArtistValidator.cs index ab789c2fc..bc860f09e 100644 --- a/src/NzbDrone.Core/Music/AddArtistValidator.cs +++ b/src/NzbDrone.Core/Music/AddArtistValidator.cs @@ -28,7 +28,7 @@ namespace NzbDrone.Core.Music .SetValidator(droneFactoryValidator) .SetValidator(seriesAncestorValidator); - RuleFor(c => c.ArtistSlug).SetValidator(artistTitleSlugValidator);// TODO: Check if we are going to use a slug or artistName + RuleFor(c => c.NameSlug).SetValidator(artistTitleSlugValidator);// TODO: Check if we are going to use a slug or artistName } } } diff --git a/src/NzbDrone.Core/Music/Album.cs b/src/NzbDrone.Core/Music/Album.cs index 6d18a766b..76027c0c3 100644 --- a/src/NzbDrone.Core/Music/Album.cs +++ b/src/NzbDrone.Core/Music/Album.cs @@ -7,7 +7,7 @@ using System.Text; namespace NzbDrone.Core.Music { - public class Album : IEmbeddedDocument + public class Album : ModelBase { public Album() { diff --git a/src/NzbDrone.Core/Music/Artist.cs b/src/NzbDrone.Core/Music/Artist.cs index 000aaf928..cdce64860 100644 --- a/src/NzbDrone.Core/Music/Artist.cs +++ b/src/NzbDrone.Core/Music/Artist.cs @@ -22,21 +22,19 @@ namespace NzbDrone.Core.Music } - public string SpotifyId { get; set; } - public string ArtistName { get; set; } - public string ArtistSlug { get; set; } - public string CleanTitle { get; set; } + public string ForeignArtistId { get; set; } + public string Name { get; set; } + public string NameSlug { get; set; } + public string CleanName { get; set; } public string Overview { get; set; } public bool Monitored { get; set; } public bool AlbumFolder { get; set; } - public bool ArtistFolder { get; set; } public DateTime? LastInfoSync { get; set; } public DateTime? LastDiskSync { get; set; } public int Status { get; set; } // TODO: Figure out what this is, do we need it? public string Path { get; set; } public List Images { get; set; } public List Genres { get; set; } - public int QualityProfileId { get; set; } public string RootFolderPath { get; set; } public DateTime Added { get; set; } public LazyLoaded Profile { get; set; } @@ -47,16 +45,16 @@ namespace NzbDrone.Core.Music public override string ToString() { - return string.Format("[{0}][{1}]", SpotifyId, ArtistName.NullSafe()); + return string.Format("[{0}][{1}]", ForeignArtistId, Name.NullSafe()); } public void ApplyChanges(Artist otherArtist) { - SpotifyId = otherArtist.SpotifyId; - ArtistName = otherArtist.ArtistName; - ArtistSlug = otherArtist.ArtistSlug; - CleanTitle = otherArtist.CleanTitle; + ForeignArtistId = otherArtist.ForeignArtistId; + Name = otherArtist.Name; + NameSlug = otherArtist.NameSlug; + CleanName = otherArtist.CleanName; Monitored = otherArtist.Monitored; AlbumFolder = otherArtist.AlbumFolder; LastInfoSync = otherArtist.LastInfoSync; @@ -69,7 +67,6 @@ namespace NzbDrone.Core.Music ProfileId = otherArtist.ProfileId; Albums = otherArtist.Albums; Tags = otherArtist.Tags; - ArtistFolder = otherArtist.ArtistFolder; AddOptions = otherArtist.AddOptions; Albums = otherArtist.Albums; diff --git a/src/NzbDrone.Core/Music/ArtistRepository.cs b/src/NzbDrone.Core/Music/ArtistRepository.cs index 0da04ad0d..907af1662 100644 --- a/src/NzbDrone.Core/Music/ArtistRepository.cs +++ b/src/NzbDrone.Core/Music/ArtistRepository.cs @@ -24,16 +24,16 @@ namespace NzbDrone.Core.Music return Query.Where(c => c.Path == path).Any(); } - public Artist FindById(string spotifyId) + public Artist FindById(string foreignArtistId) { - return Query.Where(s => s.SpotifyId == spotifyId).SingleOrDefault(); + return Query.Where(s => s.ForeignArtistId == foreignArtistId).SingleOrDefault(); } public Artist FindByName(string cleanName) { cleanName = cleanName.ToLowerInvariant(); - return Query.Where(s => s.CleanTitle == cleanName) + return Query.Where(s => s.CleanName == cleanName) .SingleOrDefault(); } } diff --git a/src/NzbDrone.Core/Music/ArtistService.cs b/src/NzbDrone.Core/Music/ArtistService.cs index bedf41f74..12387b3c0 100644 --- a/src/NzbDrone.Core/Music/ArtistService.cs +++ b/src/NzbDrone.Core/Music/ArtistService.cs @@ -114,7 +114,7 @@ namespace NzbDrone.Core.Music if (storedAlbum != null && album.Monitored != storedAlbum.Monitored) { - _trackService.SetTrackMonitoredByAlbum(artist.SpotifyId, album.AlbumId, album.Monitored); + _trackService.SetTrackMonitoredByAlbum(artist.ForeignArtistId, album.AlbumId, album.Monitored); } } @@ -129,17 +129,17 @@ namespace NzbDrone.Core.Music _logger.Debug("Updating {0} artist", artist.Count); foreach (var s in artist) { - _logger.Trace("Updating: {0}", s.ArtistName); + _logger.Trace("Updating: {0}", s.Name); if (!s.RootFolderPath.IsNullOrWhiteSpace()) { var folderName = new DirectoryInfo(s.Path).Name; s.Path = Path.Combine(s.RootFolderPath, folderName); - _logger.Trace("Changing path for {0} to {1}", s.ArtistName, s.Path); + _logger.Trace("Changing path for {0} to {1}", s.Name, s.Path); } else { - _logger.Trace("Not changing path for: {0}", s.ArtistName); + _logger.Trace("Not changing path for: {0}", s.Name); } } diff --git a/src/NzbDrone.Core/Music/ArtistSlugValidator.cs b/src/NzbDrone.Core/Music/ArtistSlugValidator.cs index 4d5626c89..1d894fee2 100644 --- a/src/NzbDrone.Core/Music/ArtistSlugValidator.cs +++ b/src/NzbDrone.Core/Music/ArtistSlugValidator.cs @@ -23,7 +23,7 @@ namespace NzbDrone.Core.Music dynamic instance = context.ParentContext.InstanceToValidate; var instanceId = (int)instance.Id; - return !_artistService.GetAllArtists().Exists(s => s.ArtistSlug.Equals(context.PropertyValue.ToString()) && s.Id != instanceId); + return !_artistService.GetAllArtists().Exists(s => s.NameSlug.Equals(context.PropertyValue.ToString()) && s.Id != instanceId); } } } diff --git a/src/NzbDrone.Core/Music/RefreshArtistService.cs b/src/NzbDrone.Core/Music/RefreshArtistService.cs index 314597c63..cdac3ac30 100644 --- a/src/NzbDrone.Core/Music/RefreshArtistService.cs +++ b/src/NzbDrone.Core/Music/RefreshArtistService.cs @@ -45,33 +45,33 @@ namespace NzbDrone.Core.Music private void RefreshArtistInfo(Artist artist) { - _logger.ProgressInfo("Updating Info for {0}", artist.ArtistName); + _logger.ProgressInfo("Updating Info for {0}", artist.Name); Tuple> tuple; try { - tuple = _artistInfo.GetArtistInfo(artist.SpotifyId); + tuple = _artistInfo.GetArtistInfo(artist.ForeignArtistId); } catch (ArtistNotFoundException) { - _logger.Error("Artist '{0}' (SpotifyId {1}) was not found, it may have been removed from Spotify.", artist.ArtistName, artist.SpotifyId); + _logger.Error("Artist '{0}' (SpotifyId {1}) was not found, it may have been removed from Spotify.", artist.Name, artist.ForeignArtistId); return; } var artistInfo = tuple.Item1; - if (artist.SpotifyId != artistInfo.SpotifyId) + if (artist.ForeignArtistId != artistInfo.ForeignArtistId) { - _logger.Warn("Artist '{0}' (SpotifyId {1}) was replaced with '{2}' (SpotifyId {3}), because the original was a duplicate.", artist.ArtistName, artist.SpotifyId, artistInfo.ArtistName, artistInfo.SpotifyId); - artist.SpotifyId = artistInfo.SpotifyId; + _logger.Warn("Artist '{0}' (SpotifyId {1}) was replaced with '{2}' (SpotifyId {3}), because the original was a duplicate.", artist.Name, artist.ForeignArtistId, artistInfo.Name, artistInfo.ForeignArtistId); + artist.ForeignArtistId = artistInfo.ForeignArtistId; } - artist.ArtistName = artistInfo.ArtistName; - artist.ArtistSlug = artistInfo.ArtistSlug; + artist.Name = artistInfo.Name; + artist.NameSlug = artistInfo.NameSlug; artist.Overview = artistInfo.Overview; artist.Status = artistInfo.Status; - artist.CleanTitle = artistInfo.CleanTitle; + artist.CleanName = artistInfo.CleanName; artist.LastInfoSync = DateTime.UtcNow; artist.Images = artistInfo.Images; artist.Genres = artistInfo.Genres; @@ -91,7 +91,7 @@ namespace NzbDrone.Core.Music _artistService.UpdateArtist(artist); _refreshTrackService.RefreshTrackInfo(artist, tuple.Item2); - _logger.Debug("Finished artist refresh for {0}", artist.ArtistName); + _logger.Debug("Finished artist refresh for {0}", artist.Name); _eventAggregator.PublishEvent(new ArtistUpdatedEvent(artist)); } @@ -112,7 +112,7 @@ namespace NzbDrone.Core.Music // continue; //} - _logger.Debug("New album ({0}) for artist: [{1}] {2}, setting monitored to true", album.Title, artist.SpotifyId, artist.ArtistName); + _logger.Debug("New album ({0}) for artist: [{1}] {2}, setting monitored to true", album.Title, artist.ForeignArtistId, artist.Name); album.Monitored = true; } @@ -136,7 +136,7 @@ namespace NzbDrone.Core.Music } else { - var allArtists = _artistService.GetAllArtists().OrderBy(c => c.ArtistName).ToList(); + var allArtists = _artistService.GetAllArtists().OrderBy(c => c.Name).ToList(); foreach (var artist in allArtists) { @@ -156,7 +156,7 @@ namespace NzbDrone.Core.Music { try { - _logger.Info("Skipping refresh of artist: {0}", artist.ArtistName); + _logger.Info("Skipping refresh of artist: {0}", artist.Name); //TODO: _diskScanService.Scan(artist); } catch (Exception e) diff --git a/src/NzbDrone.Core/Music/RefreshTrackService.cs b/src/NzbDrone.Core/Music/RefreshTrackService.cs index 169582e3d..4459ee503 100644 --- a/src/NzbDrone.Core/Music/RefreshTrackService.cs +++ b/src/NzbDrone.Core/Music/RefreshTrackService.cs @@ -33,7 +33,7 @@ namespace NzbDrone.Core.Music var successCount = 0; var failCount = 0; - var existingTracks = _trackService.GetTracksByArtist(artist.SpotifyId); + var existingTracks = _trackService.GetTracksByArtist(artist.ForeignArtistId); var albums = artist.Albums; var updateList = new List(); @@ -66,7 +66,7 @@ namespace NzbDrone.Core.Music trackToUpdate.Explict = track.Explict; if (track.ArtistSpotifyId.IsNullOrWhiteSpace()) { - trackToUpdate.ArtistSpotifyId = artist.SpotifyId; + trackToUpdate.ArtistSpotifyId = artist.ForeignArtistId; } else { trackToUpdate.ArtistSpotifyId = track.ArtistSpotifyId; @@ -104,7 +104,7 @@ namespace NzbDrone.Core.Music if (failCount != 0) { _logger.Info("Finished track refresh for artist: {0}. Successful: {1} - Failed: {2} ", - artist.ArtistName, successCount, failCount); + artist.Name, successCount, failCount); } else { diff --git a/src/NzbDrone.Core/Music/ShouldRefreshArtist.cs b/src/NzbDrone.Core/Music/ShouldRefreshArtist.cs index 669a1db3e..f38ccaaf5 100644 --- a/src/NzbDrone.Core/Music/ShouldRefreshArtist.cs +++ b/src/NzbDrone.Core/Music/ShouldRefreshArtist.cs @@ -26,13 +26,13 @@ namespace NzbDrone.Core.Music { if (artist.LastInfoSync < DateTime.UtcNow.AddDays(-30)) { - _logger.Trace("Artist {0} last updated more than 30 days ago, should refresh.", artist.ArtistName); + _logger.Trace("Artist {0} last updated more than 30 days ago, should refresh.", artist.Name); return true; } if (artist.LastInfoSync >= DateTime.UtcNow.AddHours(-6)) { - _logger.Trace("Artist {0} last updated less than 6 hours ago, should not be refreshed.", artist.ArtistName); + _logger.Trace("Artist {0} last updated less than 6 hours ago, should not be refreshed.", artist.Name); return false; } diff --git a/src/NzbDrone.Core/Music/TrackRepository.cs b/src/NzbDrone.Core/Music/TrackRepository.cs index 354d09afc..8d707ec09 100644 --- a/src/NzbDrone.Core/Music/TrackRepository.cs +++ b/src/NzbDrone.Core/Music/TrackRepository.cs @@ -118,7 +118,7 @@ namespace NzbDrone.Core.Music private SortBuilder GetMissingEpisodesQuery(PagingSpec pagingSpec, DateTime currentTime) { - return Query.Join(JoinType.Inner, e => e.Artist, (e, s) => e.ArtistSpotifyId == s.SpotifyId) + return Query.Join(JoinType.Inner, e => e.Artist, (e, s) => e.ArtistSpotifyId == s.ForeignArtistId) .Where(pagingSpec.FilterExpression) .AndWhere(e => e.TrackFileId == 0) .AndWhere(BuildAirDateUtcCutoffWhereClause(currentTime)) @@ -130,7 +130,7 @@ namespace NzbDrone.Core.Music private SortBuilder EpisodesWhereCutoffUnmetQuery(PagingSpec pagingSpec, List qualitiesBelowCutoff) { - return Query.Join(JoinType.Inner, e => e.Artist, (e, s) => e.ArtistSpotifyId == s.SpotifyId) + return Query.Join(JoinType.Inner, e => e.Artist, (e, s) => e.ArtistSpotifyId == s.ForeignArtistId) .Join(JoinType.Left, e => e.TrackFile, (e, s) => e.TrackFileId == s.Id) .Where(pagingSpec.FilterExpression) .AndWhere(e => e.TrackFileId != 0) diff --git a/src/NzbDrone.Core/Music/TrackService.cs b/src/NzbDrone.Core/Music/TrackService.cs index cf09139e5..54a415404 100644 --- a/src/NzbDrone.Core/Music/TrackService.cs +++ b/src/NzbDrone.Core/Music/TrackService.cs @@ -154,7 +154,7 @@ namespace NzbDrone.Core.Music public void HandleAsync(ArtistDeletedEvent message) { - var tracks = GetTracksByArtist(message.Artist.SpotifyId); + var tracks = GetTracksByArtist(message.Artist.ForeignArtistId); _trackRepository.DeleteMany(tracks); } diff --git a/src/NzbDrone.Core/NzbDrone.Core.csproj b/src/NzbDrone.Core/NzbDrone.Core.csproj index 65494030b..dc7c2c9b9 100644 --- a/src/NzbDrone.Core/NzbDrone.Core.csproj +++ b/src/NzbDrone.Core/NzbDrone.Core.csproj @@ -288,7 +288,6 @@ - @@ -816,7 +815,7 @@ - + @@ -825,7 +824,7 @@ - + diff --git a/src/NzbDrone.Core/Organizer/FileNameBuilder.cs b/src/NzbDrone.Core/Organizer/FileNameBuilder.cs index c85e72927..b9b53a0dc 100644 --- a/src/NzbDrone.Core/Organizer/FileNameBuilder.cs +++ b/src/NzbDrone.Core/Organizer/FileNameBuilder.cs @@ -284,8 +284,8 @@ namespace NzbDrone.Core.Organizer private void AddArtistTokens(Dictionary> tokenHandlers, Artist artist) { - tokenHandlers["{Artist Name}"] = m => artist.ArtistName; - tokenHandlers["{Artist CleanTitle}"] = m => CleanTitle(artist.ArtistName); + tokenHandlers["{Artist Name}"] = m => artist.Name; + tokenHandlers["{Artist CleanTitle}"] = m => CleanTitle(artist.Name); } private string AddSeasonEpisodeNumberingTokens(string pattern, Dictionary> tokenHandlers, List episodes, NamingConfig namingConfig) diff --git a/src/NzbDrone.Core/Parser/Model/RemoteAlbum.cs b/src/NzbDrone.Core/Parser/Model/RemoteAlbum.cs new file mode 100644 index 000000000..2b1f0ceb0 --- /dev/null +++ b/src/NzbDrone.Core/Parser/Model/RemoteAlbum.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using NzbDrone.Core.Music; + +namespace NzbDrone.Core.Parser.Model +{ + public class RemoteAlbum + { + public ReleaseInfo Release { get; set; } + public ParsedTrackInfo ParsedTrackInfo { get; set; } + public Artist Artist { get; set; } + public List Albums { get; set; } + public bool DownloadAllowed { get; set; } + + public bool IsRecentAlbum() + { + return Albums.Any(e => e.ReleaseDate >= DateTime.UtcNow.Date.AddDays(-14)); + } + + public override string ToString() + { + return Release.Title; + } + } +} \ No newline at end of file diff --git a/src/NzbDrone.Core/Validation/Paths/ArtistExistsValidator.cs b/src/NzbDrone.Core/Validation/Paths/ArtistExistsValidator.cs index 3260895c5..2e59d3a8d 100644 --- a/src/NzbDrone.Core/Validation/Paths/ArtistExistsValidator.cs +++ b/src/NzbDrone.Core/Validation/Paths/ArtistExistsValidator.cs @@ -21,7 +21,7 @@ namespace NzbDrone.Core.Validation.Paths { if (context.PropertyValue == null) return true; - return (!_artistService.GetAllArtists().Exists(s => s.SpotifyId == context.PropertyValue.ToString())); + return (!_artistService.GetAllArtists().Exists(s => s.ForeignArtistId == context.PropertyValue.ToString())); } } } diff --git a/src/UI/AddArtist/EmptyViewTemplate.hbs b/src/UI/AddArtist/EmptyViewTemplate.hbs index 26c712271..e2a20efdc 100644 --- a/src/UI/AddArtist/EmptyViewTemplate.hbs +++ b/src/UI/AddArtist/EmptyViewTemplate.hbs @@ -1,3 +1,3 @@
- You can also search by Spotify using the spotify: prefixes. + You can also search by MusicBrianzID using the MBID: prefixes.
diff --git a/src/UI/AddArtist/SearchResultView.js b/src/UI/AddArtist/SearchResultView.js index cc53f6b15..47dd29944 100644 --- a/src/UI/AddArtist/SearchResultView.js +++ b/src/UI/AddArtist/SearchResultView.js @@ -97,7 +97,7 @@ var view = Marionette.ItemView.extend({ }, _configureTemplateHelpers : function() { - var existingArtist = ArtistCollection.where({ spotifyId : this.model.get('spotifyId') }); + var existingArtist = ArtistCollection.where({ foreignArtistId : this.model.get('foreignArtistId') }); if (existingArtist.length > 0) { this.templateHelpers.existing = existingArtist[0].toJSON(); diff --git a/src/UI/AddArtist/SearchResultViewTemplate.hbs b/src/UI/AddArtist/SearchResultViewTemplate.hbs index 0377ccbc6..686bad6b3 100644 --- a/src/UI/AddArtist/SearchResultViewTemplate.hbs +++ b/src/UI/AddArtist/SearchResultViewTemplate.hbs @@ -5,7 +5,7 @@

- {{artistName}} + {{name}}
- -
diff --git a/src/UI/Artist/ArtistCollection.js b/src/UI/Artist/ArtistCollection.js index 4bffc07e2..8e700d7bf 100644 --- a/src/UI/Artist/ArtistCollection.js +++ b/src/UI/Artist/ArtistCollection.js @@ -77,7 +77,7 @@ var Collection = PageableCollection.extend({ }, artistName: { - sortKey : 'artistName' + sortKey : 'name' }, nextAiring : { diff --git a/src/UI/Artist/ArtistController.js b/src/UI/Artist/ArtistController.js index c6e24a771..2f54bc2cf 100644 --- a/src/UI/Artist/ArtistController.js +++ b/src/UI/Artist/ArtistController.js @@ -21,12 +21,12 @@ module.exports = NzbDroneController.extend({ }, artistDetails : function(query) { - var artists = ArtistCollection.where({ artistSlug : query }); + var artists = ArtistCollection.where({ nameSlug : query }); console.log('artistDetails, artists: ', artists); if (artists.length !== 0) { var targetArtist = artists[0]; console.log("[ArtistController] targetArtist: ", targetArtist); - this.setTitle(targetArtist.get('artistName')); // TODO: Update NzbDroneController + this.setTitle(targetArtist.get('name')); // TODO: Update NzbDroneController //this.setArtistName(targetSeries.get('artistName')); this.showMainRegion(new ArtistDetailsLayout({ model : targetArtist })); } else { diff --git a/src/UI/Artist/Details/ArtistDetailsLayout.js b/src/UI/Artist/Details/ArtistDetailsLayout.js index 67d55c306..fc068d291 100644 --- a/src/UI/Artist/Details/ArtistDetailsLayout.js +++ b/src/UI/Artist/Details/ArtistDetailsLayout.js @@ -63,7 +63,7 @@ module.exports = Marionette.Layout.extend({ onShow : function() { this._showBackdrop(); - this._showSeasons(); + this._showAlbums(); this._setMonitoredState(); this._showInfo(); }, diff --git a/src/UI/Artist/Details/ArtistDetailsTemplate.hbs b/src/UI/Artist/Details/ArtistDetailsTemplate.hbs index 605ead424..8d5b1f5b1 100644 --- a/src/UI/Artist/Details/ArtistDetailsTemplate.hbs +++ b/src/UI/Artist/Details/ArtistDetailsTemplate.hbs @@ -1,35 +1,35 @@ -
+
{{poster}}

- - {{title}} -
+ + {{name}} +
- +
- +
- +

-
+
{{overview}}
-
+
diff --git a/src/UI/Artist/Details/InfoView.js b/src/UI/Artist/Details/InfoView.js index c7fab9fc4..74ddb2bf4 100644 --- a/src/UI/Artist/Details/InfoView.js +++ b/src/UI/Artist/Details/InfoView.js @@ -1,18 +1,18 @@ var Marionette = require('marionette'); module.exports = Marionette.ItemView.extend({ - template : 'Series/Details/InfoViewTemplate', + template : 'Artist/Details/InfoViewTemplate', initialize : function(options) { - this.episodeFileCollection = options.episodeFileCollection; + this.trackFileCollection = options.trackFileCollection; this.listenTo(this.model, 'change', this.render); - this.listenTo(this.episodeFileCollection, 'sync', this.render); + this.listenTo(this.trackFileCollection, 'sync', this.render); }, templateHelpers : function() { return { - fileCount : this.episodeFileCollection.length + fileCount : this.trackFileCollection.length }; } }); \ No newline at end of file diff --git a/src/UI/Artist/Details/InfoViewTemplate.hbs b/src/UI/Artist/Details/InfoViewTemplate.hbs index b52130246..c6e689630 100644 --- a/src/UI/Artist/Details/InfoViewTemplate.hbs +++ b/src/UI/Artist/Details/InfoViewTemplate.hbs @@ -28,7 +28,7 @@ {{/if_eq}}
- + Trakt The TVDB diff --git a/src/UI/Artist/Editor/ArtistEditorLayout.js b/src/UI/Artist/Editor/ArtistEditorLayout.js index 51f0ec52e..6d8520154 100644 --- a/src/UI/Artist/Editor/ArtistEditorLayout.js +++ b/src/UI/Artist/Editor/ArtistEditorLayout.js @@ -45,7 +45,7 @@ module.exports = Marionette.Layout.extend({ cell : ArtistStatusCell }, { - name : 'artistName', + name : 'name', label : 'Artist', cell : ArtistTitleCell, cellValue : 'this' diff --git a/src/UI/Artist/Index/Overview/ArtistOverviewItemViewTemplate.hbs b/src/UI/Artist/Index/Overview/ArtistOverviewItemViewTemplate.hbs index 222287a2e..de34cc5cd 100644 --- a/src/UI/Artist/Index/Overview/ArtistOverviewItemViewTemplate.hbs +++ b/src/UI/Artist/Index/Overview/ArtistOverviewItemViewTemplate.hbs @@ -9,7 +9,7 @@
diff --git a/src/UI/Handlebars/Helpers/Artist.js b/src/UI/Handlebars/Helpers/Artist.js index a44f24802..13990530c 100644 --- a/src/UI/Handlebars/Helpers/Artist.js +++ b/src/UI/Handlebars/Helpers/Artist.js @@ -40,7 +40,7 @@ Handlebars.registerHelper('tvMazeUrl', function() { }); Handlebars.registerHelper('route', function() { - return StatusModel.get('urlBase') + '/artist/' + this.artistSlug; + return StatusModel.get('urlBase') + '/artist/' + this.nameSlug; }); Handlebars.registerHelper('percentOfEpisodes', function() {