From fc5ab94d4f94341b8b012ddf50214a38a63c1053 Mon Sep 17 00:00:00 2001 From: harris Date: Sat, 27 May 2017 21:40:12 -0400 Subject: [PATCH 1/3] Update Download Clients --- .../Download/Clients/Deluge/DelugeSettings.cs | 6 +++--- .../Download/Clients/NzbVortex/NzbVortexSettings.cs | 6 +++--- .../Download/Clients/Nzbget/NzbgetSettings.cs | 8 +++++--- .../Download/Clients/QBittorrent/QBittorrentSettings.cs | 6 +++--- .../Download/Clients/Sabnzbd/SabnzbdSettings.cs | 6 +++--- .../Download/Clients/Transmission/TransmissionSettings.cs | 4 ++-- .../Download/Clients/rTorrent/RTorrentSettings.cs | 6 +++--- .../Download/Clients/uTorrent/UTorrentSettings.cs | 6 +++--- src/NzbDrone.Core/Download/TorrentClientBase.cs | 8 ++++---- src/NzbDrone.Core/Download/UsenetClientBase.cs | 6 +++--- 10 files changed, 32 insertions(+), 30 deletions(-) diff --git a/src/NzbDrone.Core/Download/Clients/Deluge/DelugeSettings.cs b/src/NzbDrone.Core/Download/Clients/Deluge/DelugeSettings.cs index b03e16cd4..6fafae599 100644 --- a/src/NzbDrone.Core/Download/Clients/Deluge/DelugeSettings.cs +++ b/src/NzbDrone.Core/Download/Clients/Deluge/DelugeSettings.cs @@ -25,7 +25,7 @@ namespace NzbDrone.Core.Download.Clients.Deluge Host = "localhost"; Port = 8112; Password = "deluge"; - TvCategory = "tv-Lidarr"; + TvCategory = "lidarr"; } [FieldDefinition(0, Label = "Host", Type = FieldType.Textbox)] @@ -43,10 +43,10 @@ namespace NzbDrone.Core.Download.Clients.Deluge [FieldDefinition(4, Label = "Category", Type = FieldType.Textbox, HelpText = "Adding a category specific to Lidarr avoids conflicts with unrelated downloads, but it's optional")] public string TvCategory { get; set; } - [FieldDefinition(5, Label = "Recent Priority", Type = FieldType.Select, SelectOptions = typeof(DelugePriority), HelpText = "Priority to use when grabbing episodes that aired within the last 14 days")] + [FieldDefinition(5, Label = "Recent Priority", Type = FieldType.Select, SelectOptions = typeof(DelugePriority), HelpText = "Priority to use when grabbing albums released within the last 14 days")] public int RecentTvPriority { get; set; } - [FieldDefinition(6, Label = "Older Priority", Type = FieldType.Select, SelectOptions = typeof(DelugePriority), HelpText = "Priority to use when grabbing episodes that aired over 14 days ago")] + [FieldDefinition(6, Label = "Older Priority", Type = FieldType.Select, SelectOptions = typeof(DelugePriority), HelpText = "Priority to use when grabbing albums released over 14 days ago")] public int OlderTvPriority { get; set; } [FieldDefinition(7, Label = "Use SSL", Type = FieldType.Checkbox)] diff --git a/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortexSettings.cs b/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortexSettings.cs index 9a4561fa0..b4e22fe91 100644 --- a/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortexSettings.cs +++ b/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortexSettings.cs @@ -29,7 +29,7 @@ namespace NzbDrone.Core.Download.Clients.NzbVortex { Host = "localhost"; Port = 4321; - TvCategory = "TV Shows"; + TvCategory = "Music"; RecentTvPriority = (int)NzbVortexPriority.Normal; OlderTvPriority = (int)NzbVortexPriority.Normal; } @@ -46,10 +46,10 @@ namespace NzbDrone.Core.Download.Clients.NzbVortex [FieldDefinition(3, Label = "Group", Type = FieldType.Textbox, HelpText = "Adding a category specific to Lidarr avoids conflicts with unrelated downloads, but it's optional")] public string TvCategory { get; set; } - [FieldDefinition(4, Label = "Recent Priority", Type = FieldType.Select, SelectOptions = typeof(NzbVortexPriority), HelpText = "Priority to use when grabbing episodes that aired within the last 14 days")] + [FieldDefinition(4, Label = "Recent Priority", Type = FieldType.Select, SelectOptions = typeof(NzbVortexPriority), HelpText = "Priority to use when grabbing albums released within the last 14 days")] public int RecentTvPriority { get; set; } - [FieldDefinition(5, Label = "Older Priority", Type = FieldType.Select, SelectOptions = typeof(NzbVortexPriority), HelpText = "Priority to use when grabbing episodes that aired over 14 days ago")] + [FieldDefinition(5, Label = "Older Priority", Type = FieldType.Select, SelectOptions = typeof(NzbVortexPriority), HelpText = "Priority to use when grabbing albums released over 14 days ago")] public int OlderTvPriority { get; set; } public NzbDroneValidationResult Validate() diff --git a/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetSettings.cs b/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetSettings.cs index 3b20b010c..8a75be249 100644 --- a/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetSettings.cs +++ b/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetSettings.cs @@ -26,7 +26,9 @@ namespace NzbDrone.Core.Download.Clients.Nzbget { Host = "localhost"; Port = 6789; - TvCategory = "tv"; + TvCategory = "Music"; + Username = "nzbget"; + Password = "tegbzn6789"; RecentTvPriority = (int)NzbgetPriority.Normal; OlderTvPriority = (int)NzbgetPriority.Normal; } @@ -46,10 +48,10 @@ namespace NzbDrone.Core.Download.Clients.Nzbget [FieldDefinition(4, Label = "Category", Type = FieldType.Textbox, HelpText = "Adding a category specific to Lidarr avoids conflicts with unrelated downloads, but it's optional")] public string TvCategory { get; set; } - [FieldDefinition(5, Label = "Recent Priority", Type = FieldType.Select, SelectOptions = typeof(NzbgetPriority), HelpText = "Priority to use when grabbing episodes that aired within the last 14 days")] + [FieldDefinition(5, Label = "Recent Priority", Type = FieldType.Select, SelectOptions = typeof(NzbgetPriority), HelpText = "Priority to use when grabbing albums released within the last 14 days")] public int RecentTvPriority { get; set; } - [FieldDefinition(6, Label = "Older Priority", Type = FieldType.Select, SelectOptions = typeof(NzbgetPriority), HelpText = "Priority to use when grabbing episodes that aired over 14 days ago")] + [FieldDefinition(6, Label = "Older Priority", Type = FieldType.Select, SelectOptions = typeof(NzbgetPriority), HelpText = "Priority to use when grabbing albums released over 14 days ago")] public int OlderTvPriority { get; set; } [FieldDefinition(7, Label = "Use SSL", Type = FieldType.Checkbox)] diff --git a/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrentSettings.cs b/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrentSettings.cs index aeddcbf3a..6bdffa80c 100644 --- a/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrentSettings.cs +++ b/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrentSettings.cs @@ -22,7 +22,7 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent { Host = "localhost"; Port = 9091; - TvCategory = "tv-Lidarr"; + TvCategory = "lidarr"; } [FieldDefinition(0, Label = "Host", Type = FieldType.Textbox)] @@ -40,10 +40,10 @@ namespace NzbDrone.Core.Download.Clients.QBittorrent [FieldDefinition(4, Label = "Category", Type = FieldType.Textbox, HelpText = "Adding a category specific to Lidarr avoids conflicts with unrelated downloads, but it's optional")] public string TvCategory { get; set; } - [FieldDefinition(5, Label = "Recent Priority", Type = FieldType.Select, SelectOptions = typeof(QBittorrentPriority), HelpText = "Priority to use when grabbing episodes that aired within the last 14 days")] + [FieldDefinition(5, Label = "Recent Priority", Type = FieldType.Select, SelectOptions = typeof(QBittorrentPriority), HelpText = "Priority to use when grabbing albums released within the last 14 days")] public int RecentTvPriority { get; set; } - [FieldDefinition(6, Label = "Older Priority", Type = FieldType.Select, SelectOptions = typeof(QBittorrentPriority), HelpText = "Priority to use when grabbing episodes that aired over 14 days ago")] + [FieldDefinition(6, Label = "Older Priority", Type = FieldType.Select, SelectOptions = typeof(QBittorrentPriority), HelpText = "Priority to use when grabbing albums released over 14 days ago")] public int OlderTvPriority { get; set; } [FieldDefinition(7, Label = "Use SSL", Type = FieldType.Checkbox, HelpText = "Use a secure connection. See Options -> Web UI -> 'Use HTTPS instead of HTTP' in qBittorrent.")] diff --git a/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdSettings.cs b/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdSettings.cs index 374079134..ce86d3773 100644 --- a/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdSettings.cs +++ b/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdSettings.cs @@ -38,7 +38,7 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd { Host = "localhost"; Port = 8080; - TvCategory = "tv"; + TvCategory = "music"; RecentTvPriority = (int)SabnzbdPriority.Default; OlderTvPriority = (int)SabnzbdPriority.Default; } @@ -61,10 +61,10 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd [FieldDefinition(5, Label = "Category", Type = FieldType.Textbox, HelpText = "Adding a category specific to Lidarr avoids conflicts with unrelated downloads, but it's optional")] public string TvCategory { get; set; } - [FieldDefinition(6, Label = "Recent Priority", Type = FieldType.Select, SelectOptions = typeof(SabnzbdPriority), HelpText = "Priority to use when grabbing episodes that aired within the last 14 days")] + [FieldDefinition(6, Label = "Recent Priority", Type = FieldType.Select, SelectOptions = typeof(SabnzbdPriority), HelpText = "Priority to use when grabbing albums released within the last 14 days")] public int RecentTvPriority { get; set; } - [FieldDefinition(7, Label = "Older Priority", Type = FieldType.Select, SelectOptions = typeof(SabnzbdPriority), HelpText = "Priority to use when grabbing episodes that aired over 14 days ago")] + [FieldDefinition(7, Label = "Older Priority", Type = FieldType.Select, SelectOptions = typeof(SabnzbdPriority), HelpText = "Priority to use when grabbing albums released over 14 days ago")] public int OlderTvPriority { get; set; } [FieldDefinition(8, Label = "Use SSL", Type = FieldType.Checkbox)] diff --git a/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionSettings.cs b/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionSettings.cs index 38f2a60a1..9626eb7f7 100644 --- a/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionSettings.cs +++ b/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionSettings.cs @@ -56,10 +56,10 @@ namespace NzbDrone.Core.Download.Clients.Transmission [FieldDefinition(6, Label = "Directory", Type = FieldType.Textbox, Advanced = true, HelpText = "Optional location to put downloads in, leave blank to use the default Transmission location")] public string TvDirectory { get; set; } - [FieldDefinition(7, Label = "Recent Priority", Type = FieldType.Select, SelectOptions = typeof(TransmissionPriority), HelpText = "Priority to use when grabbing episodes that aired within the last 14 days")] + [FieldDefinition(7, Label = "Recent Priority", Type = FieldType.Select, SelectOptions = typeof(TransmissionPriority), HelpText = "Priority to use when grabbing albums released within the last 14 days")] public int RecentTvPriority { get; set; } - [FieldDefinition(8, Label = "Older Priority", Type = FieldType.Select, SelectOptions = typeof(TransmissionPriority), HelpText = "Priority to use when grabbing episodes that aired over 14 days ago")] + [FieldDefinition(8, Label = "Older Priority", Type = FieldType.Select, SelectOptions = typeof(TransmissionPriority), HelpText = "Priority to use when grabbing albums released over 14 days ago")] public int OlderTvPriority { get; set; } [FieldDefinition(9, Label = "Use SSL", Type = FieldType.Checkbox)] diff --git a/src/NzbDrone.Core/Download/Clients/rTorrent/RTorrentSettings.cs b/src/NzbDrone.Core/Download/Clients/rTorrent/RTorrentSettings.cs index 7e964db7a..07a5c9b6f 100644 --- a/src/NzbDrone.Core/Download/Clients/rTorrent/RTorrentSettings.cs +++ b/src/NzbDrone.Core/Download/Clients/rTorrent/RTorrentSettings.cs @@ -26,7 +26,7 @@ namespace NzbDrone.Core.Download.Clients.RTorrent Host = "localhost"; Port = 8080; UrlBase = "RPC2"; - TvCategory = "tv-Lidarr"; + TvCategory = "lidarr"; OlderTvPriority = (int)RTorrentPriority.Normal; RecentTvPriority = (int)RTorrentPriority.Normal; } @@ -55,10 +55,10 @@ namespace NzbDrone.Core.Download.Clients.RTorrent [FieldDefinition(7, Label = "Directory", Type = FieldType.Textbox, Advanced = true, HelpText = "Optional location to put downloads in, leave blank to use the default rTorrent location")] public string TvDirectory { get; set; } - [FieldDefinition(8, Label = "Recent Priority", Type = FieldType.Select, SelectOptions = typeof(RTorrentPriority), HelpText = "Priority to use when grabbing episodes that aired within the last 14 days")] + [FieldDefinition(8, Label = "Recent Priority", Type = FieldType.Select, SelectOptions = typeof(RTorrentPriority), HelpText = "Priority to use when grabbing albums released within the last 14 days")] public int RecentTvPriority { get; set; } - [FieldDefinition(9, Label = "Older Priority", Type = FieldType.Select, SelectOptions = typeof(RTorrentPriority), HelpText = "Priority to use when grabbing episodes that aired over 14 days ago")] + [FieldDefinition(9, Label = "Older Priority", Type = FieldType.Select, SelectOptions = typeof(RTorrentPriority), HelpText = "Priority to use when grabbing albums released over 14 days ago")] public int OlderTvPriority { get; set; } public NzbDroneValidationResult Validate() diff --git a/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrentSettings.cs b/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrentSettings.cs index e76406084..103bec26e 100644 --- a/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrentSettings.cs +++ b/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrentSettings.cs @@ -23,7 +23,7 @@ namespace NzbDrone.Core.Download.Clients.UTorrent { Host = "localhost"; Port = 9091; - TvCategory = "tv-Lidarr"; + TvCategory = "lidarr"; } [FieldDefinition(0, Label = "Host", Type = FieldType.Textbox)] @@ -41,10 +41,10 @@ namespace NzbDrone.Core.Download.Clients.UTorrent [FieldDefinition(4, Label = "Category", Type = FieldType.Textbox, HelpText = "Adding a category specific to Lidarr avoids conflicts with unrelated downloads, but it's optional")] public string TvCategory { get; set; } - [FieldDefinition(5, Label = "Recent Priority", Type = FieldType.Select, SelectOptions = typeof(UTorrentPriority), HelpText = "Priority to use when grabbing episodes that aired within the last 14 days")] + [FieldDefinition(5, Label = "Recent Priority", Type = FieldType.Select, SelectOptions = typeof(UTorrentPriority), HelpText = "Priority to use when grabbing albums released within the last 14 days")] public int RecentTvPriority { get; set; } - [FieldDefinition(6, Label = "Older Priority", Type = FieldType.Select, SelectOptions = typeof(UTorrentPriority), HelpText = "Priority to use when grabbing episodes that aired over 14 days ago")] + [FieldDefinition(6, Label = "Older Priority", Type = FieldType.Select, SelectOptions = typeof(UTorrentPriority), HelpText = "Priority to use when grabbing albums released over 14 days ago")] public int OlderTvPriority { get; set; } public NzbDroneValidationResult Validate() diff --git a/src/NzbDrone.Core/Download/TorrentClientBase.cs b/src/NzbDrone.Core/Download/TorrentClientBase.cs index 609cd3bd6..61986ce8f 100644 --- a/src/NzbDrone.Core/Download/TorrentClientBase.cs +++ b/src/NzbDrone.Core/Download/TorrentClientBase.cs @@ -154,7 +154,7 @@ namespace NzbDrone.Core.Download torrentFile = response.ResponseData; - _logger.Debug("Downloading torrent for episode '{0}' finished ({1} bytes from {2})", remoteEpisode.Release.Title, torrentFile.Length, torrentUrl); + _logger.Debug("Downloading torrent for release '{0}' finished ({1} bytes from {2})", remoteEpisode.Release.Title, torrentFile.Length, torrentUrl); } catch (HttpException ex) { @@ -164,14 +164,14 @@ namespace NzbDrone.Core.Download } else { - _logger.Error(ex, "Downloading torrent file for episode '{0}' failed ({1})", remoteEpisode.Release.Title, torrentUrl); + _logger.Error(ex, "Downloading torrent file for release '{0}' failed ({1})", remoteEpisode.Release.Title, torrentUrl); } throw new ReleaseDownloadException(remoteEpisode.Release, "Downloading torrent failed", ex); } catch (WebException ex) { - _logger.Error(ex, "Downloading torrent file for episode '{0}' failed ({1})", remoteEpisode.Release.Title, torrentUrl); + _logger.Error(ex, "Downloading torrent file for release '{0}' failed ({1})", remoteEpisode.Release.Title, torrentUrl); throw new ReleaseDownloadException(remoteEpisode.Release, "Downloading torrent failed", ex); } @@ -201,7 +201,7 @@ namespace NzbDrone.Core.Download } catch (FormatException ex) { - _logger.Error(ex, "Failed to parse magnetlink for episode '{0}': '{1}'", remoteEpisode.Release.Title, magnetUrl); + _logger.Error(ex, "Failed to parse magnetlink for release '{0}': '{1}'", remoteEpisode.Release.Title, magnetUrl); return null; } diff --git a/src/NzbDrone.Core/Download/UsenetClientBase.cs b/src/NzbDrone.Core/Download/UsenetClientBase.cs index a6c0ed7d5..1d50dd178 100644 --- a/src/NzbDrone.Core/Download/UsenetClientBase.cs +++ b/src/NzbDrone.Core/Download/UsenetClientBase.cs @@ -42,7 +42,7 @@ namespace NzbDrone.Core.Download { nzbData = _httpClient.Get(new HttpRequest(url)).ResponseData; - _logger.Debug("Downloaded nzb for episode '{0}' finished ({1} bytes from {2})", remoteEpisode.Release.Title, nzbData.Length, url); + _logger.Debug("Downloaded nzb for release '{0}' finished ({1} bytes from {2})", remoteEpisode.Release.Title, nzbData.Length, url); } catch (HttpException ex) { @@ -52,14 +52,14 @@ namespace NzbDrone.Core.Download } else { - _logger.Error(ex, "Downloading nzb for episode '{0}' failed ({1})", remoteEpisode.Release.Title, url); + _logger.Error(ex, "Downloading nzb for release '{0}' failed ({1})", remoteEpisode.Release.Title, url); } throw new ReleaseDownloadException(remoteEpisode.Release, "Downloading nzb failed", ex); } catch (WebException ex) { - _logger.Error(ex, "Downloading nzb for episode '{0}' failed ({1})", remoteEpisode.Release.Title, url); + _logger.Error(ex, "Downloading nzb for release '{0}' failed ({1})", remoteEpisode.Release.Title, url); throw new ReleaseDownloadException(remoteEpisode.Release, "Downloading nzb failed", ex); } From 2baa1da4b6d4b7f7fe91fb66a33eb57e32933c8e Mon Sep 17 00:00:00 2001 From: Qstick Date: Sun, 28 May 2017 01:01:20 -0400 Subject: [PATCH 2/3] Seperate AddArtist, Artist. Refactor NavSearch, Artist Editor. Other Misc UI Fixes --- gulp/less.js | 2 + .../runConfigurations/Debug___Chrome.xml | 2 +- .../runConfigurations/Debug___Firefox.xml | 2 +- src/UI/AddArtist/AddArtistCollection.js | 23 + src/UI/AddArtist/AddArtistLayout.js | 53 ++ src/UI/AddArtist/AddArtistLayoutTemplate.hbs | 17 + src/UI/AddArtist/AddArtistView.js | 183 +++++++ src/UI/AddArtist/AddArtistViewTemplate.hbs | 24 + .../AddArtist/ArtistTypeSelectionPartial.hbs | 3 + src/UI/AddArtist/EmptyView.js | 5 + src/UI/AddArtist/EmptyViewTemplate.hbs | 3 + src/UI/AddArtist/ErrorView.js | 13 + src/UI/AddArtist/ErrorViewTemplate.hbs | 7 + .../AddExistingArtistCollectionView.js | 51 ++ ...ddExistingArtistCollectionViewTemplate.hbs | 5 + .../Existing/UnmappedFolderCollection.js | 20 + .../AddArtist/Existing/UnmappedFolderModel.js | 3 + .../AddArtist/MonitoringTooltipTemplate.hbs | 18 + src/UI/AddArtist/NotFoundView.js | 13 + src/UI/AddArtist/NotFoundViewTemplate.hbs | 7 + .../RootFolders/RootFolderCollection.js | 10 + .../RootFolders/RootFolderCollectionView.js | 8 + .../RootFolderCollectionViewTemplate.hbs | 13 + .../RootFolders/RootFolderItemView.js | 28 + .../RootFolderItemViewTemplate.hbs | 9 + .../AddArtist/RootFolders/RootFolderLayout.js | 80 +++ .../RootFolders/RootFolderLayoutTemplate.hbs | 36 ++ .../AddArtist/RootFolders/RootFolderModel.js | 8 + .../RootFolderSelectionPartial.hbs | 11 + .../AddArtist/SearchResultCollectionView.js | 29 ++ src/UI/AddArtist/SearchResultView.js | 297 +++++++++++ src/UI/AddArtist/SearchResultViewTemplate.hbs | 146 ++++++ .../StartingAlbumSelectionPartial.hbs | 13 + src/UI/AddArtist/addArtist.less | 181 +++++++ src/UI/Artist/AlbumCollection.js | 10 + src/UI/Artist/AlbumModel.js | 11 + src/UI/Artist/ArtistCollection.js | 2 +- src/UI/Artist/ArtistController.js | 16 +- src/UI/Artist/ArtistModel.js | 2 +- src/UI/Artist/Delete/DeleteArtistTemplate.hbs | 50 ++ src/UI/Artist/Delete/DeleteArtistView.js | 41 ++ src/UI/Artist/Details/AlbumCollectionView.js | 44 ++ src/UI/Artist/Details/AlbumLayout.js | 301 +++++++++++ src/UI/Artist/Details/AlbumLayoutTemplate.hbs | 50 ++ src/UI/Artist/Details/ArtistDetailsLayout.js | 259 ++++++++++ .../Artist/Details/ArtistDetailsTemplate.hbs | 35 ++ src/UI/Artist/Details/InfoView.js | 18 + src/UI/Artist/Details/InfoViewTemplate.hbs | 73 +++ src/UI/Artist/Details/TrackNumberCell.js | 47 ++ .../Details/TrackNumberCellTemplate.hbs | 39 ++ src/UI/Artist/Details/TrackWarningCell.js | 21 + src/UI/Artist/Edit/EditArtistView.js | 54 ++ src/UI/Artist/Edit/EditArtistViewTemplate.hbs | 104 ++++ .../Artist/Editor/ArtistEditorFooterView.js | 126 +++++ .../Editor/ArtistEditorFooterViewTemplate.hbs | 54 ++ src/UI/Artist/Editor/ArtistEditorLayout.js | 185 +++++++ .../Editor/ArtistEditorLayoutTemplate.hbs | 7 + .../Editor/Organize/OrganizeFilesView.js | 33 ++ .../Organize/OrganizeFilesViewTemplate.hbs | 25 + src/UI/Artist/Index/ArtistIndexItemView.js | 35 ++ src/UI/Artist/Index/ArtistIndexLayout.js | 357 +++++++++++++ .../Index/ArtistIndexLayoutTemplate.hbs | 12 + src/UI/Artist/Index/EmptyTemplate.hbs | 16 + src/UI/Artist/Index/EmptyView.js | 5 + src/UI/Artist/Index/FooterModel.js | 4 + src/UI/Artist/Index/FooterView.js | 5 + src/UI/Artist/Index/FooterViewTemplate.hbs | 46 ++ .../Overview/ArtistOverviewCollectionView.js | 8 + .../ArtistOverviewCollectionViewTemplate.hbs | 1 + .../Index/Overview/ArtistOverviewItemView.js | 7 + .../ArtistOverviewItemViewTemplate.hbs | 59 +++ .../Posters/ArtistPostersCollectionView.js | 8 + .../ArtistPostersCollectionViewTemplate.hbs | 1 + .../Index/Posters/ArtistPostersItemView.js | 19 + .../Posters/ArtistPostersItemViewTemplate.hbs | 30 ++ src/UI/Artist/Index/TrackProgressPartial.hbs | 4 + src/UI/Artist/TrackCollection.js | 62 +++ src/UI/Artist/TrackFileCollection.js | 28 + src/UI/Artist/TrackFileModel.js | 3 + src/UI/Artist/TrackModel.js | 20 + src/UI/Artist/artist.less | 477 ++++++++++++++++++ src/UI/Cells/ArtistActionsCell.js | 45 ++ src/UI/Cells/ArtistFolderCell.js | 14 + src/UI/Cells/ArtistStatusCell.js | 32 ++ src/UI/Cells/ArtistTitleCell.js | 6 + src/UI/Cells/ArtistTitleTemplate.hbs | 1 + src/UI/Cells/cells.less | 6 +- src/UI/Config.js | 4 +- src/UI/Content/icons.less | 8 +- src/UI/Controller.js | 18 +- src/UI/Handlebars/Helpers/Artist.js | 106 ++++ .../backbone.marionette.templates.js | 3 +- src/UI/Navbar/NavbarLayoutTemplate.hbs | 4 +- src/UI/Navbar/Search.js | 17 +- src/UI/Router.js | 6 +- src/UI/SeasonPass/SeasonPassFooterView.js | 2 +- .../Series/Editor/SeriesEditorFooterView.js | 4 +- src/UI/Series/Index/EmptyTemplate.hbs | 2 +- src/UI/Series/Index/SeriesIndexLayout.js | 4 +- src/UI/Shared/Modal/ModalController.js | 16 +- src/UI/index.html | 4 +- src/UI/vent.js | 4 +- 102 files changed, 4382 insertions(+), 61 deletions(-) create mode 100644 src/UI/AddArtist/AddArtistCollection.js create mode 100644 src/UI/AddArtist/AddArtistLayout.js create mode 100644 src/UI/AddArtist/AddArtistLayoutTemplate.hbs create mode 100644 src/UI/AddArtist/AddArtistView.js create mode 100644 src/UI/AddArtist/AddArtistViewTemplate.hbs create mode 100644 src/UI/AddArtist/ArtistTypeSelectionPartial.hbs create mode 100644 src/UI/AddArtist/EmptyView.js create mode 100644 src/UI/AddArtist/EmptyViewTemplate.hbs create mode 100644 src/UI/AddArtist/ErrorView.js create mode 100644 src/UI/AddArtist/ErrorViewTemplate.hbs create mode 100644 src/UI/AddArtist/Existing/AddExistingArtistCollectionView.js create mode 100644 src/UI/AddArtist/Existing/AddExistingArtistCollectionViewTemplate.hbs create mode 100644 src/UI/AddArtist/Existing/UnmappedFolderCollection.js create mode 100644 src/UI/AddArtist/Existing/UnmappedFolderModel.js create mode 100644 src/UI/AddArtist/MonitoringTooltipTemplate.hbs create mode 100644 src/UI/AddArtist/NotFoundView.js create mode 100644 src/UI/AddArtist/NotFoundViewTemplate.hbs create mode 100644 src/UI/AddArtist/RootFolders/RootFolderCollection.js create mode 100644 src/UI/AddArtist/RootFolders/RootFolderCollectionView.js create mode 100644 src/UI/AddArtist/RootFolders/RootFolderCollectionViewTemplate.hbs create mode 100644 src/UI/AddArtist/RootFolders/RootFolderItemView.js create mode 100644 src/UI/AddArtist/RootFolders/RootFolderItemViewTemplate.hbs create mode 100644 src/UI/AddArtist/RootFolders/RootFolderLayout.js create mode 100644 src/UI/AddArtist/RootFolders/RootFolderLayoutTemplate.hbs create mode 100644 src/UI/AddArtist/RootFolders/RootFolderModel.js create mode 100644 src/UI/AddArtist/RootFolders/RootFolderSelectionPartial.hbs create mode 100644 src/UI/AddArtist/SearchResultCollectionView.js create mode 100644 src/UI/AddArtist/SearchResultView.js create mode 100644 src/UI/AddArtist/SearchResultViewTemplate.hbs create mode 100644 src/UI/AddArtist/StartingAlbumSelectionPartial.hbs create mode 100644 src/UI/AddArtist/addArtist.less create mode 100644 src/UI/Artist/AlbumCollection.js create mode 100644 src/UI/Artist/AlbumModel.js create mode 100644 src/UI/Artist/Delete/DeleteArtistTemplate.hbs create mode 100644 src/UI/Artist/Delete/DeleteArtistView.js create mode 100644 src/UI/Artist/Details/AlbumCollectionView.js create mode 100644 src/UI/Artist/Details/AlbumLayout.js create mode 100644 src/UI/Artist/Details/AlbumLayoutTemplate.hbs create mode 100644 src/UI/Artist/Details/ArtistDetailsLayout.js create mode 100644 src/UI/Artist/Details/ArtistDetailsTemplate.hbs create mode 100644 src/UI/Artist/Details/InfoView.js create mode 100644 src/UI/Artist/Details/InfoViewTemplate.hbs create mode 100644 src/UI/Artist/Details/TrackNumberCell.js create mode 100644 src/UI/Artist/Details/TrackNumberCellTemplate.hbs create mode 100644 src/UI/Artist/Details/TrackWarningCell.js create mode 100644 src/UI/Artist/Edit/EditArtistView.js create mode 100644 src/UI/Artist/Edit/EditArtistViewTemplate.hbs create mode 100644 src/UI/Artist/Editor/ArtistEditorFooterView.js create mode 100644 src/UI/Artist/Editor/ArtistEditorFooterViewTemplate.hbs create mode 100644 src/UI/Artist/Editor/ArtistEditorLayout.js create mode 100644 src/UI/Artist/Editor/ArtistEditorLayoutTemplate.hbs create mode 100644 src/UI/Artist/Editor/Organize/OrganizeFilesView.js create mode 100644 src/UI/Artist/Editor/Organize/OrganizeFilesViewTemplate.hbs create mode 100644 src/UI/Artist/Index/ArtistIndexItemView.js create mode 100644 src/UI/Artist/Index/ArtistIndexLayout.js create mode 100644 src/UI/Artist/Index/ArtistIndexLayoutTemplate.hbs create mode 100644 src/UI/Artist/Index/EmptyTemplate.hbs create mode 100644 src/UI/Artist/Index/EmptyView.js create mode 100644 src/UI/Artist/Index/FooterModel.js create mode 100644 src/UI/Artist/Index/FooterView.js create mode 100644 src/UI/Artist/Index/FooterViewTemplate.hbs create mode 100644 src/UI/Artist/Index/Overview/ArtistOverviewCollectionView.js create mode 100644 src/UI/Artist/Index/Overview/ArtistOverviewCollectionViewTemplate.hbs create mode 100644 src/UI/Artist/Index/Overview/ArtistOverviewItemView.js create mode 100644 src/UI/Artist/Index/Overview/ArtistOverviewItemViewTemplate.hbs create mode 100644 src/UI/Artist/Index/Posters/ArtistPostersCollectionView.js create mode 100644 src/UI/Artist/Index/Posters/ArtistPostersCollectionViewTemplate.hbs create mode 100644 src/UI/Artist/Index/Posters/ArtistPostersItemView.js create mode 100644 src/UI/Artist/Index/Posters/ArtistPostersItemViewTemplate.hbs create mode 100644 src/UI/Artist/Index/TrackProgressPartial.hbs create mode 100644 src/UI/Artist/TrackCollection.js create mode 100644 src/UI/Artist/TrackFileCollection.js create mode 100644 src/UI/Artist/TrackFileModel.js create mode 100644 src/UI/Artist/TrackModel.js create mode 100644 src/UI/Artist/artist.less create mode 100644 src/UI/Cells/ArtistActionsCell.js create mode 100644 src/UI/Cells/ArtistFolderCell.js create mode 100644 src/UI/Cells/ArtistStatusCell.js create mode 100644 src/UI/Cells/ArtistTitleCell.js create mode 100644 src/UI/Cells/ArtistTitleTemplate.hbs create mode 100644 src/UI/Handlebars/Helpers/Artist.js diff --git a/gulp/less.js b/gulp/less.js index 76e04b8dc..0baf2eb31 100644 --- a/gulp/less.js +++ b/gulp/less.js @@ -17,8 +17,10 @@ gulp.task('less', function() { paths.src.content + 'theme.less', paths.src.content + 'overrides.less', paths.src.root + 'Series/series.less', + paths.src.root + 'Artist/artist.less', paths.src.root + 'Activity/activity.less', paths.src.root + 'AddSeries/addSeries.less', + paths.src.root + 'AddArtist/addArtist.less', paths.src.root + 'Calendar/calendar.less', paths.src.root + 'Cells/cells.less', paths.src.root + 'ManualImport/manualimport.less', diff --git a/src/UI/.idea/runConfigurations/Debug___Chrome.xml b/src/UI/.idea/runConfigurations/Debug___Chrome.xml index 659f9572b..2ff8dbf6b 100644 --- a/src/UI/.idea/runConfigurations/Debug___Chrome.xml +++ b/src/UI/.idea/runConfigurations/Debug___Chrome.xml @@ -10,7 +10,7 @@ - + diff --git a/src/UI/.idea/runConfigurations/Debug___Firefox.xml b/src/UI/.idea/runConfigurations/Debug___Firefox.xml index 8646368d1..dbbdebbe4 100644 --- a/src/UI/.idea/runConfigurations/Debug___Firefox.xml +++ b/src/UI/.idea/runConfigurations/Debug___Firefox.xml @@ -9,7 +9,7 @@ - + diff --git a/src/UI/AddArtist/AddArtistCollection.js b/src/UI/AddArtist/AddArtistCollection.js new file mode 100644 index 000000000..a243649f4 --- /dev/null +++ b/src/UI/AddArtist/AddArtistCollection.js @@ -0,0 +1,23 @@ +var Backbone = require('backbone'); +var ArtistModel = require('../Artist/ArtistModel'); +var _ = require('underscore'); + +module.exports = Backbone.Collection.extend({ + url : window.NzbDrone.ApiRoot + '/artist/lookup', + model : ArtistModel, + + parse : function(response) { + var self = this; + + _.each(response, function(model) { + model.id = undefined; + + if (self.unmappedFolderModel) { + model.path = self.unmappedFolderModel.get('folder').path; + } + }); + console.log('response: ', response); + + return response; + } +}); \ No newline at end of file diff --git a/src/UI/AddArtist/AddArtistLayout.js b/src/UI/AddArtist/AddArtistLayout.js new file mode 100644 index 000000000..2b398335e --- /dev/null +++ b/src/UI/AddArtist/AddArtistLayout.js @@ -0,0 +1,53 @@ +var vent = require('vent'); +var AppLayout = require('../AppLayout'); +var Marionette = require('marionette'); +var RootFolderLayout = require('./RootFolders/RootFolderLayout'); +var ExistingArtistCollectionView = require('./Existing/AddExistingArtistCollectionView'); +var AddArtistView = require('./AddArtistView'); +var ProfileCollection = require('../Profile/ProfileCollection'); +var RootFolderCollection = require('./RootFolders/RootFolderCollection'); +require('../Artist/ArtistCollection'); + +module.exports = Marionette.Layout.extend({ + template : 'AddArtist/AddArtistLayoutTemplate', + + regions : { + workspace : '#add-artist-workspace' + }, + + events : { + 'click .x-import' : '_importArtist', + 'click .x-add-new' : '_addArtist' + }, + + attributes : { + id : 'add-artist-screen' + }, + + initialize : function() { + ProfileCollection.fetch(); + RootFolderCollection.fetch().done(function() { + RootFolderCollection.synced = true; + }); + }, + + onShow : function() { + this.workspace.show(new AddArtistView()); + }, + + _folderSelected : function(options) { + vent.trigger(vent.Commands.CloseModalCommand); + + this.workspace.show(new ExistingArtistCollectionView({ model : options.model })); + }, + + _importArtist : function() { + this.rootFolderLayout = new RootFolderLayout(); + this.listenTo(this.rootFolderLayout, 'folderSelected', this._folderSelected); + AppLayout.modalRegion.show(this.rootFolderLayout); + }, + + _addArtist : function() { + this.workspace.show(new AddArtistView()); + } +}); \ No newline at end of file diff --git a/src/UI/AddArtist/AddArtistLayoutTemplate.hbs b/src/UI/AddArtist/AddArtistLayoutTemplate.hbs new file mode 100644 index 000000000..53f225a1e --- /dev/null +++ b/src/UI/AddArtist/AddArtistLayoutTemplate.hbs @@ -0,0 +1,17 @@ +
+
+
+ + +
+
+
+
+
+
+
+
+ diff --git a/src/UI/AddArtist/AddArtistView.js b/src/UI/AddArtist/AddArtistView.js new file mode 100644 index 000000000..85e47a02d --- /dev/null +++ b/src/UI/AddArtist/AddArtistView.js @@ -0,0 +1,183 @@ +var _ = require('underscore'); +var vent = require('vent'); +var Marionette = require('marionette'); +var AddArtistCollection = require('./AddArtistCollection'); +var SearchResultCollectionView = require('./SearchResultCollectionView'); +var EmptyView = require('./EmptyView'); +var NotFoundView = require('./NotFoundView'); +var ErrorView = require('./ErrorView'); +var LoadingView = require('../Shared/LoadingView'); + +module.exports = Marionette.Layout.extend({ + template : 'AddArtist/AddArtistViewTemplate', + + regions : { + searchResult : '#search-result' + }, + + ui : { + artistSearch : '.x-artist-search', + searchBar : '.x-search-bar', + loadMore : '.x-load-more' + }, + + events : { + 'click .x-load-more' : '_onLoadMore' + }, + + initialize : function(options) { + this.isExisting = options.isExisting; + this.collection = new AddArtistCollection(); + console.log('this.collection:', this.collection); + + if (this.isExisting) { + this.collection.unmappedFolderModel = this.model; + } + + if (this.isExisting) { + this.className = 'existing-artist'; + } else { + this.className = 'new-artist'; + } + + this.listenTo(vent, vent.Events.ArtistAdded, this._onArtistAdded); + this.listenTo(this.collection, 'sync', this._showResults); + + this.resultCollectionView = new SearchResultCollectionView({ + collection : this.collection, + isExisting : this.isExisting + }); + + this.throttledSearch = _.debounce(this.search, 1000, { trailing : true }).bind(this); + }, + + onRender : function() { + var self = this; + + this.$el.addClass(this.className); + + this.ui.artistSearch.keyup(function(e) { + + if (_.contains([ + 9, + 16, + 17, + 18, + 19, + 20, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 91, + 92, + 93 + ], e.keyCode)) { + return; + } + + self._abortExistingSearch(); + self.throttledSearch({ + term : self.ui.artistSearch.val() + }); + }); + + this._clearResults(); + + if (this.isExisting) { + this.ui.searchBar.hide(); + } + }, + + onShow : function() { + this.ui.artistSearch.focus(); + }, + + search : function(options) { + var self = this; + + this.collection.reset(); + + if (!options.term || options.term === this.collection.term) { + return Marionette.$.Deferred().resolve(); + } + + this.searchResult.show(new LoadingView()); + this.collection.term = options.term; + this.currentSearchPromise = this.collection.fetch({ + data : { term : options.term } + }); + + this.currentSearchPromise.fail(function() { + self._showError(); + }); + + return this.currentSearchPromise; + }, + + _onArtistAdded : function(options) { + if (this.isExisting && options.artist.get('path') === this.model.get('folder').path) { + this.close(); + } + + else if (!this.isExisting) { + this.collection.term = ''; + this.collection.reset(); + this._clearResults(); + this.ui.artistSearch.val(''); + this.ui.artistSearch.focus(); + } + }, + + _onLoadMore : function() { + var showingAll = this.resultCollectionView.showMore(); + this.ui.searchBar.show(); + + if (showingAll) { + this.ui.loadMore.hide(); + } + }, + + _clearResults : function() { + if (!this.isExisting) { + this.searchResult.show(new EmptyView()); + } else { + this.searchResult.close(); + } + }, + + _showResults : function() { + if (!this.isClosed) { + if (this.collection.length === 0) { + this.ui.searchBar.show(); + this.searchResult.show(new NotFoundView({ term : this.collection.term })); + } else { + this.searchResult.show(this.resultCollectionView); + if (!this.showingAll && this.isExisting) { + this.ui.loadMore.show(); + } + } + } + }, + + _abortExistingSearch : function() { + if (this.currentSearchPromise && this.currentSearchPromise.readyState > 0 && this.currentSearchPromise.readyState < 4) { + console.log('aborting previous pending search request.'); + this.currentSearchPromise.abort(); + } else { + this._clearResults(); + } + }, + + _showError : function() { + if (!this.isClosed) { + this.ui.searchBar.show(); + this.searchResult.show(new ErrorView({ term : this.collection.term })); + this.collection.term = ''; + } + } +}); \ No newline at end of file diff --git a/src/UI/AddArtist/AddArtistViewTemplate.hbs b/src/UI/AddArtist/AddArtistViewTemplate.hbs new file mode 100644 index 000000000..adadf0569 --- /dev/null +++ b/src/UI/AddArtist/AddArtistViewTemplate.hbs @@ -0,0 +1,24 @@ +{{#if folder.path}} +
+
+ {{folder.path}} +
+
{{/if}} + +
+
+
+ diff --git a/src/UI/AddArtist/ArtistTypeSelectionPartial.hbs b/src/UI/AddArtist/ArtistTypeSelectionPartial.hbs new file mode 100644 index 000000000..f8cadd547 --- /dev/null +++ b/src/UI/AddArtist/ArtistTypeSelectionPartial.hbs @@ -0,0 +1,3 @@ + diff --git a/src/UI/AddArtist/EmptyView.js b/src/UI/AddArtist/EmptyView.js new file mode 100644 index 000000000..e07b1647d --- /dev/null +++ b/src/UI/AddArtist/EmptyView.js @@ -0,0 +1,5 @@ +var Marionette = require('marionette'); + +module.exports = Marionette.CompositeView.extend({ + template : 'AddArtist/EmptyViewTemplate' +}); \ No newline at end of file diff --git a/src/UI/AddArtist/EmptyViewTemplate.hbs b/src/UI/AddArtist/EmptyViewTemplate.hbs new file mode 100644 index 000000000..26c712271 --- /dev/null +++ b/src/UI/AddArtist/EmptyViewTemplate.hbs @@ -0,0 +1,3 @@ +
+ You can also search by Spotify using the spotify: prefixes. +
diff --git a/src/UI/AddArtist/ErrorView.js b/src/UI/AddArtist/ErrorView.js new file mode 100644 index 000000000..9d53fae8c --- /dev/null +++ b/src/UI/AddArtist/ErrorView.js @@ -0,0 +1,13 @@ +var Marionette = require('marionette'); + +module.exports = Marionette.CompositeView.extend({ + template : 'AddArtist/ErrorViewTemplate', + + initialize : function(options) { + this.options = options; + }, + + templateHelpers : function() { + return this.options; + } +}); \ No newline at end of file diff --git a/src/UI/AddArtist/ErrorViewTemplate.hbs b/src/UI/AddArtist/ErrorViewTemplate.hbs new file mode 100644 index 000000000..c0b1e3673 --- /dev/null +++ b/src/UI/AddArtist/ErrorViewTemplate.hbs @@ -0,0 +1,7 @@ +
+

+ There was an error searching for '{{term}}'. +

+ + If the artist name contains non-alphanumeric characters try removing them, otherwise try your search again later. +
diff --git a/src/UI/AddArtist/Existing/AddExistingArtistCollectionView.js b/src/UI/AddArtist/Existing/AddExistingArtistCollectionView.js new file mode 100644 index 000000000..af57bc1d2 --- /dev/null +++ b/src/UI/AddArtist/Existing/AddExistingArtistCollectionView.js @@ -0,0 +1,51 @@ +var Marionette = require('marionette'); +var AddArtistView = require('../AddArtistView'); +var UnmappedFolderCollection = require('./UnmappedFolderCollection'); + +module.exports = Marionette.CompositeView.extend({ + itemView : AddArtistView, + itemViewContainer : '.x-loading-folders', + template : 'AddArtist/Existing/AddExistingArtistCollectionViewTemplate', + + ui : { + loadingFolders : '.x-loading-folders' + }, + + initialize : function() { + this.collection = new UnmappedFolderCollection(); + this.collection.importItems(this.model); + }, + + showCollection : function() { + this._showAndSearch(0); + }, + + appendHtml : function(collectionView, itemView, index) { + collectionView.ui.loadingFolders.before(itemView.el); + }, + + _showAndSearch : function(index) { + var self = this; + var model = this.collection.at(index); + + if (model) { + var currentIndex = index; + var folderName = model.get('folder').name; + this.addItemView(model, this.getItemView(), index); + this.children.findByModel(model).search({ term : folderName }).always(function() { + if (!self.isClosed) { + self._showAndSearch(currentIndex + 1); + } + }); + } + + else { + this.ui.loadingFolders.hide(); + } + }, + + itemViewOptions : { + isExisting : true + } + +}); \ No newline at end of file diff --git a/src/UI/AddArtist/Existing/AddExistingArtistCollectionViewTemplate.hbs b/src/UI/AddArtist/Existing/AddExistingArtistCollectionViewTemplate.hbs new file mode 100644 index 000000000..5acbd1ef0 --- /dev/null +++ b/src/UI/AddArtist/Existing/AddExistingArtistCollectionViewTemplate.hbs @@ -0,0 +1,5 @@ +
+
+ Loading search results from server for your artists, this may take a few minutes. +
+
\ No newline at end of file diff --git a/src/UI/AddArtist/Existing/UnmappedFolderCollection.js b/src/UI/AddArtist/Existing/UnmappedFolderCollection.js new file mode 100644 index 000000000..bd2a83f49 --- /dev/null +++ b/src/UI/AddArtist/Existing/UnmappedFolderCollection.js @@ -0,0 +1,20 @@ +var Backbone = require('backbone'); +var UnmappedFolderModel = require('./UnmappedFolderModel'); +var _ = require('underscore'); + +module.exports = Backbone.Collection.extend({ + model : UnmappedFolderModel, + + importItems : function(rootFolderModel) { + + this.reset(); + var rootFolder = rootFolderModel; + + _.each(rootFolderModel.get('unmappedFolders'), function(folder) { + this.push(new UnmappedFolderModel({ + rootFolder : rootFolder, + folder : folder + })); + }, this); + } +}); \ No newline at end of file diff --git a/src/UI/AddArtist/Existing/UnmappedFolderModel.js b/src/UI/AddArtist/Existing/UnmappedFolderModel.js new file mode 100644 index 000000000..3986a5948 --- /dev/null +++ b/src/UI/AddArtist/Existing/UnmappedFolderModel.js @@ -0,0 +1,3 @@ +var Backbone = require('backbone'); + +module.exports = Backbone.Model.extend({}); \ No newline at end of file diff --git a/src/UI/AddArtist/MonitoringTooltipTemplate.hbs b/src/UI/AddArtist/MonitoringTooltipTemplate.hbs new file mode 100644 index 000000000..0c795cf12 --- /dev/null +++ b/src/UI/AddArtist/MonitoringTooltipTemplate.hbs @@ -0,0 +1,18 @@ +
+
All
+
Monitor all tracks except specials
+
Future
+
Monitor tracks that have not been released yet
+
Missing
+
Monitor tracks that do not have files or have not aired yet
+
Existing
+
Monitor tracks that have files or have not aired yet
+
First Season
+
Monitor all tracks of the first album. All other albums will be ignored
+
Latest Season
+
Monitor all tracks of the latest album and future albums
+
None
+
No tracks will be monitored.
+ + +
\ No newline at end of file diff --git a/src/UI/AddArtist/NotFoundView.js b/src/UI/AddArtist/NotFoundView.js new file mode 100644 index 000000000..d25f339c3 --- /dev/null +++ b/src/UI/AddArtist/NotFoundView.js @@ -0,0 +1,13 @@ +var Marionette = require('marionette'); + +module.exports = Marionette.CompositeView.extend({ + template : 'AddArtist/NotFoundViewTemplate', + + initialize : function(options) { + this.options = options; + }, + + templateHelpers : function() { + return this.options; + } +}); \ No newline at end of file diff --git a/src/UI/AddArtist/NotFoundViewTemplate.hbs b/src/UI/AddArtist/NotFoundViewTemplate.hbs new file mode 100644 index 000000000..abaca6646 --- /dev/null +++ b/src/UI/AddArtist/NotFoundViewTemplate.hbs @@ -0,0 +1,7 @@ +
+

+ Sorry. We couldn't find any artist matching '{{term}}' +

+ Why can't I find my artist? + +
diff --git a/src/UI/AddArtist/RootFolders/RootFolderCollection.js b/src/UI/AddArtist/RootFolders/RootFolderCollection.js new file mode 100644 index 000000000..81050c19d --- /dev/null +++ b/src/UI/AddArtist/RootFolders/RootFolderCollection.js @@ -0,0 +1,10 @@ +var Backbone = require('backbone'); +var RootFolderModel = require('./RootFolderModel'); +require('../../Mixins/backbone.signalr.mixin'); + +var RootFolderCollection = Backbone.Collection.extend({ + url : window.NzbDrone.ApiRoot + '/rootfolder', + model : RootFolderModel +}); + +module.exports = new RootFolderCollection(); \ No newline at end of file diff --git a/src/UI/AddArtist/RootFolders/RootFolderCollectionView.js b/src/UI/AddArtist/RootFolders/RootFolderCollectionView.js new file mode 100644 index 000000000..1029de245 --- /dev/null +++ b/src/UI/AddArtist/RootFolders/RootFolderCollectionView.js @@ -0,0 +1,8 @@ +var Marionette = require('marionette'); +var RootFolderItemView = require('./RootFolderItemView'); + +module.exports = Marionette.CompositeView.extend({ + template : 'AddArtist/RootFolders/RootFolderCollectionViewTemplate', + itemViewContainer : '.x-root-folders', + itemView : RootFolderItemView +}); \ No newline at end of file diff --git a/src/UI/AddArtist/RootFolders/RootFolderCollectionViewTemplate.hbs b/src/UI/AddArtist/RootFolders/RootFolderCollectionViewTemplate.hbs new file mode 100644 index 000000000..70755bbca --- /dev/null +++ b/src/UI/AddArtist/RootFolders/RootFolderCollectionViewTemplate.hbs @@ -0,0 +1,13 @@ + + + + + + + + +
+ Path + + Free Space +
\ No newline at end of file diff --git a/src/UI/AddArtist/RootFolders/RootFolderItemView.js b/src/UI/AddArtist/RootFolders/RootFolderItemView.js new file mode 100644 index 000000000..c22f6fcf7 --- /dev/null +++ b/src/UI/AddArtist/RootFolders/RootFolderItemView.js @@ -0,0 +1,28 @@ +var Marionette = require('marionette'); + +module.exports = Marionette.ItemView.extend({ + template : 'AddArtist/RootFolders/RootFolderItemViewTemplate', + className : 'recent-folder', + tagName : 'tr', + + initialize : function() { + this.listenTo(this.model, 'change', this.render); + }, + + events : { + 'click .x-delete' : 'removeFolder', + 'click .x-folder' : 'folderSelected' + }, + + removeFolder : function() { + var self = this; + + this.model.destroy().success(function() { + self.close(); + }); + }, + + folderSelected : function() { + this.trigger('folderSelected', this.model); + } +}); \ No newline at end of file diff --git a/src/UI/AddArtist/RootFolders/RootFolderItemViewTemplate.hbs b/src/UI/AddArtist/RootFolders/RootFolderItemViewTemplate.hbs new file mode 100644 index 000000000..c1378207a --- /dev/null +++ b/src/UI/AddArtist/RootFolders/RootFolderItemViewTemplate.hbs @@ -0,0 +1,9 @@ + + {{path}} + + + {{Bytes freeSpace}} + + + + diff --git a/src/UI/AddArtist/RootFolders/RootFolderLayout.js b/src/UI/AddArtist/RootFolders/RootFolderLayout.js new file mode 100644 index 000000000..7b5036689 --- /dev/null +++ b/src/UI/AddArtist/RootFolders/RootFolderLayout.js @@ -0,0 +1,80 @@ +var Marionette = require('marionette'); +var RootFolderCollectionView = require('./RootFolderCollectionView'); +var RootFolderCollection = require('./RootFolderCollection'); +var RootFolderModel = require('./RootFolderModel'); +var LoadingView = require('../../Shared/LoadingView'); +var AsValidatedView = require('../../Mixins/AsValidatedView'); +require('../../Mixins/FileBrowser'); + +var Layout = Marionette.Layout.extend({ + template : 'AddArtist/RootFolders/RootFolderLayoutTemplate', + + ui : { + pathInput : '.x-path' + }, + + regions : { + currentDirs : '#current-dirs' + }, + + events : { + 'click .x-add' : '_addFolder', + 'keydown .x-path input' : '_keydown' + }, + + initialize : function() { + this.collection = RootFolderCollection; + this.rootfolderListView = null; + }, + + onShow : function() { + this.listenTo(RootFolderCollection, 'sync', this._showCurrentDirs); + this.currentDirs.show(new LoadingView()); + + if (RootFolderCollection.synced) { + this._showCurrentDirs(); + } + + this.ui.pathInput.fileBrowser(); + }, + + _onFolderSelected : function(options) { + this.trigger('folderSelected', options); + }, + + _addFolder : function() { + var self = this; + + var newDir = new RootFolderModel({ + Path : this.ui.pathInput.val() + }); + + this.bindToModelValidation(newDir); + + newDir.save().done(function() { + RootFolderCollection.add(newDir); + self.trigger('folderSelected', { model : newDir }); + }); + }, + + _showCurrentDirs : function() { + if (!this.rootfolderListView) { + this.rootfolderListView = new RootFolderCollectionView({ collection : RootFolderCollection }); + this.currentDirs.show(this.rootfolderListView); + + this.listenTo(this.rootfolderListView, 'itemview:folderSelected', this._onFolderSelected); + } + }, + + _keydown : function(e) { + if (e.keyCode !== 13) { + return; + } + + this._addFolder(); + } +}); + +var Layout = AsValidatedView.apply(Layout); + +module.exports = Layout; diff --git a/src/UI/AddArtist/RootFolders/RootFolderLayoutTemplate.hbs b/src/UI/AddArtist/RootFolders/RootFolderLayoutTemplate.hbs new file mode 100644 index 000000000..efb6eb7c9 --- /dev/null +++ b/src/UI/AddArtist/RootFolders/RootFolderLayoutTemplate.hbs @@ -0,0 +1,36 @@ + diff --git a/src/UI/AddArtist/RootFolders/RootFolderModel.js b/src/UI/AddArtist/RootFolders/RootFolderModel.js new file mode 100644 index 000000000..28681768b --- /dev/null +++ b/src/UI/AddArtist/RootFolders/RootFolderModel.js @@ -0,0 +1,8 @@ +var Backbone = require('backbone'); + +module.exports = Backbone.Model.extend({ + urlRoot : window.NzbDrone.ApiRoot + '/rootfolder', + defaults : { + freeSpace : 0 + } +}); \ No newline at end of file diff --git a/src/UI/AddArtist/RootFolders/RootFolderSelectionPartial.hbs b/src/UI/AddArtist/RootFolders/RootFolderSelectionPartial.hbs new file mode 100644 index 000000000..56729b0dd --- /dev/null +++ b/src/UI/AddArtist/RootFolders/RootFolderSelectionPartial.hbs @@ -0,0 +1,11 @@ + + diff --git a/src/UI/AddArtist/SearchResultCollectionView.js b/src/UI/AddArtist/SearchResultCollectionView.js new file mode 100644 index 000000000..e533085ac --- /dev/null +++ b/src/UI/AddArtist/SearchResultCollectionView.js @@ -0,0 +1,29 @@ +var Marionette = require('marionette'); +var SearchResultView = require('./SearchResultView'); + +module.exports = Marionette.CollectionView.extend({ + itemView : SearchResultView, + + initialize : function(options) { + this.isExisting = options.isExisting; + this.showing = 1; + }, + + showAll : function() { + this.showingAll = true; + this.render(); + }, + + showMore : function() { + this.showing += 5; + this.render(); + + return this.showing >= this.collection.length; + }, + + appendHtml : function(collectionView, itemView, index) { + if (!this.isExisting || index < this.showing || index === 0) { + collectionView.$el.append(itemView.el); + } + } +}); \ No newline at end of file diff --git a/src/UI/AddArtist/SearchResultView.js b/src/UI/AddArtist/SearchResultView.js new file mode 100644 index 000000000..febd1612d --- /dev/null +++ b/src/UI/AddArtist/SearchResultView.js @@ -0,0 +1,297 @@ +var _ = require('underscore'); +var vent = require('vent'); +var AppLayout = require('../AppLayout'); +var Backbone = require('backbone'); +var Marionette = require('marionette'); +var Profiles = require('../Profile/ProfileCollection'); +var RootFolders = require('./RootFolders/RootFolderCollection'); +var RootFolderLayout = require('./RootFolders/RootFolderLayout'); +var ArtistCollection = require('../Artist/ArtistCollection'); +var Config = require('../Config'); +var Messenger = require('../Shared/Messenger'); +var AsValidatedView = require('../Mixins/AsValidatedView'); + +require('jquery.dotdotdot'); + +var view = Marionette.ItemView.extend({ + + template : 'AddArtist/SearchResultViewTemplate', + + ui : { + profile : '.x-profile', + rootFolder : '.x-root-folder', + albumFolder : '.x-album-folder', + artistType : '.x-artist-type', + monitor : '.x-monitor', + monitorTooltip : '.x-monitor-tooltip', + addButton : '.x-add', + addAlbumButton : '.x-add-album', + addSearchButton : '.x-add-search', + addAlbumSearchButton : '.x-add-album-search', + overview : '.x-overview' + }, + + events : { + 'click .x-add' : '_addWithoutSearch', + 'click .x-add-album' : '_addWithoutSearch', + 'click .x-add-search' : '_addAndSearch', + 'click .x-add-album-search' : '_addAndSearch', + 'change .x-profile' : '_profileChanged', + 'change .x-root-folder' : '_rootFolderChanged', + 'change .x-album-folder' : '_albumFolderChanged', + 'change .x-artist-type' : '_artistTypeChanged', + 'change .x-monitor' : '_monitorChanged' + }, + + initialize : function() { + + if (!this.model) { + throw 'model is required'; + } + + this.templateHelpers = {}; + this._configureTemplateHelpers(); + + this.listenTo(vent, Config.Events.ConfigUpdatedEvent, this._onConfigUpdated); + this.listenTo(this.model, 'change', this.render); + this.listenTo(RootFolders, 'all', this._rootFoldersUpdated); + }, + + onRender : function() { + + var defaultProfile = Config.getValue(Config.Keys.DefaultProfileId); + var defaultRoot = Config.getValue(Config.Keys.DefaultRootFolderId); + var useSeasonFolder = Config.getValueBoolean(Config.Keys.UseSeasonFolder, true); + var defaultArtistType = Config.getValue(Config.Keys.DefaultSeriesType, 'standard'); + var defaultMonitorEpisodes = Config.getValue(Config.Keys.MonitorEpisodes, 'missing'); + + if (Profiles.get(defaultProfile)) { + this.ui.profile.val(defaultProfile); + } + + if (RootFolders.get(defaultRoot)) { + this.ui.rootFolder.val(defaultRoot); + } + + this.ui.albumFolder.prop('checked', useSeasonFolder); + this.ui.artistType.val(defaultArtistType); + this.ui.monitor.val(defaultMonitorEpisodes); + + //TODO: make this work via onRender, FM? + //works with onShow, but stops working after the first render + this.ui.overview.dotdotdot({ + height : 120 + }); + + this.templateFunction = Marionette.TemplateCache.get('AddArtist/MonitoringTooltipTemplate'); + var content = this.templateFunction(); + + this.ui.monitorTooltip.popover({ + content : content, + html : true, + trigger : 'hover', + title : 'Track Monitoring Options', + placement : 'right', + container : this.$el + }); + }, + + _configureTemplateHelpers : function() { + var existingArtist = ArtistCollection.where({ SpotifyId : this.model.get('spotifyId') }); + + if (existingArtist.length > 0) { + this.templateHelpers.existing = existingArtist[0].toJSON(); + } + + this.templateHelpers.profiles = Profiles.toJSON(); + + if (!this.model.get('isExisting')) { + this.templateHelpers.rootFolders = RootFolders.toJSON(); + } + }, + + _onConfigUpdated : function(options) { + if (options.key === Config.Keys.DefaultProfileId) { + this.ui.profile.val(options.value); + } + + else if (options.key === Config.Keys.DefaultRootFolderId) { + this.ui.rootFolder.val(options.value); + } + + else if (options.key === Config.Keys.UseAlbumFolder) { + this.ui.seasonFolder.prop('checked', options.value); + } + + else if (options.key === Config.Keys.DefaultArtistType) { + this.ui.artistType.val(options.value); + } + + else if (options.key === Config.Keys.MonitorEpisodes) { + this.ui.monitor.val(options.value); + } + }, + + _profileChanged : function() { + Config.setValue(Config.Keys.DefaultProfileId, this.ui.profile.val()); + }, + + _albumFolderChanged : function() { + Config.setValue(Config.Keys.UseAlbumFolder, this.ui.albumFolder.prop('checked')); + }, + + _rootFolderChanged : function() { + var rootFolderValue = this.ui.rootFolder.val(); + if (rootFolderValue === 'addNew') { + var rootFolderLayout = new RootFolderLayout(); + this.listenToOnce(rootFolderLayout, 'folderSelected', this._setRootFolder); + AppLayout.modalRegion.show(rootFolderLayout); + } else { + Config.setValue(Config.Keys.DefaultRootFolderId, rootFolderValue); + } + }, + + _artistTypeChanged : function() { + Config.setValue(Config.Keys.DefaultArtistType, this.ui.artistType.val()); + }, + + _monitorChanged : function() { + Config.setValue(Config.Keys.MonitorEpisodes, this.ui.monitor.val()); + }, + + _setRootFolder : function(options) { + vent.trigger(vent.Commands.CloseModalCommand); + this.ui.rootFolder.val(options.model.id); + this._rootFolderChanged(); + }, + + _addWithoutSearch : function(evt) { + console.log(evt); + this._addArtist(false); + }, + + _addAndSearch : function() { + this._addArtist(true); + }, + + _addArtist : function(searchForMissing) { + // TODO: Refactor to handle multiple add buttons/albums + var addButton = this.ui.addButton; + var addSearchButton = this.ui.addSearchButton; + console.log('_addArtist, searchForMissing=', searchForMissing); + + addButton.addClass('disabled'); + addSearchButton.addClass('disabled'); + + var profile = this.ui.profile.val(); + var rootFolderPath = this.ui.rootFolder.children(':selected').text(); + var artistType = this.ui.artistType.val(); // Perhaps make this a differnitator between artist or Album? + var albumFolder = this.ui.albumFolder.prop('checked'); + + var options = this._getAddArtistOptions(); + options.searchForMissing = searchForMissing; + + this.model.set({ + profileId : profile, + rootFolderPath : rootFolderPath, + albumFolder : albumFolder, + artistType : artistType, + addOptions : options, + monitored : true + }, { silent : true }); + + var self = this; + var promise = this.model.save(); + + if (searchForMissing) { + this.ui.addSearchButton.spinForPromise(promise); + } + + else { + this.ui.addButton.spinForPromise(promise); + } + + promise.always(function() { + addButton.removeClass('disabled'); + addSearchButton.removeClass('disabled'); + }); + + promise.done(function() { + console.log('[SearchResultView] _addArtist promise resolve:', self.model); + ArtistCollection.add(self.model); + + self.close(); + + Messenger.show({ + message : 'Added: ' + self.model.get('artistName'), + actions : { + goToArtist : { + label : 'Go to Artist', + action : function() { + Backbone.history.navigate('/artist/' + self.model.get('artistSlug'), { trigger : true }); + } + } + }, + hideAfter : 8, + hideOnNavigate : true + }); + + vent.trigger(vent.Events.ArtistAdded, { artist : self.model }); + }); + }, + + _rootFoldersUpdated : function() { + this._configureTemplateHelpers(); + this.render(); + }, + + _getAddArtistOptions : function() { + var monitor = this.ui.monitor.val(); + //[TODO]: Refactor for albums + var lastSeason = _.max(this.model.get('seasons'), 'seasonNumber'); + var firstSeason = _.min(_.reject(this.model.get('seasons'), { seasonNumber : 0 }), 'seasonNumber'); + + //this.model.setSeasonPass(firstSeason.seasonNumber); // TODO + + var options = { + ignoreTracksWithFiles : false, + ignoreTracksWithoutFiles : false + }; + + if (monitor === 'all') { + return options; + } + + else if (monitor === 'future') { + options.ignoreTracksWithFiles = true; + options.ignoreTracksWithoutFiles = true; + } + + /*else if (monitor === 'latest') { + this.model.setSeasonPass(lastSeason.seasonNumber); + } + + else if (monitor === 'first') { + this.model.setSeasonPass(lastSeason.seasonNumber + 1); + this.model.setSeasonMonitored(firstSeason.seasonNumber); + }*/ + + else if (monitor === 'missing') { + options.ignoreTracksWithFiles = true; + } + + else if (monitor === 'existing') { + options.ignoreTracksWithoutFiles = true; + } + + /*else if (monitor === 'none') { + this.model.setSeasonPass(lastSeason.seasonNumber + 1); + }*/ + + return options; + } +}); + +AsValidatedView.apply(view); + +module.exports = view; diff --git a/src/UI/AddArtist/SearchResultViewTemplate.hbs b/src/UI/AddArtist/SearchResultViewTemplate.hbs new file mode 100644 index 000000000..0377ccbc6 --- /dev/null +++ b/src/UI/AddArtist/SearchResultViewTemplate.hbs @@ -0,0 +1,146 @@ +
+
+
+
+
+

+ + {{artistName}} + + +

+
+
+ +
+ {{#unless existing}} + {{#unless path}} +
+ + {{> RootFolderSelectionPartial rootFolders}} +
+ {{/unless}} + +
+ + +
+ +
+ + {{> ProfileSelectionPartial profiles}} +
+ + + +
+ + +
+
+ {{/unless}} +
+
+ {{#unless existing}} + {{#if artistName}} +
+ + +
+ + + +
+
+ {{else}} +
+ +
+ {{/if}} + {{else}} + + {{/unless}} +
+
+
+
+ {{#each albums}} +
+ +
+

{{albumName}} ({{year}})

+ {{#unless existing}} + {{#if albumName}} +
+ + +
+ + + +
+
+ {{else}} +
+ +
+ {{/if}} + {{else}} + + {{/unless}} +
+
+ {{/each}} +
+
diff --git a/src/UI/AddArtist/StartingAlbumSelectionPartial.hbs b/src/UI/AddArtist/StartingAlbumSelectionPartial.hbs new file mode 100644 index 000000000..573599dab --- /dev/null +++ b/src/UI/AddArtist/StartingAlbumSelectionPartial.hbs @@ -0,0 +1,13 @@ + diff --git a/src/UI/AddArtist/addArtist.less b/src/UI/AddArtist/addArtist.less new file mode 100644 index 000000000..e53ff8eee --- /dev/null +++ b/src/UI/AddArtist/addArtist.less @@ -0,0 +1,181 @@ +@import "../Shared/Styles/card.less"; +@import "../Shared/Styles/clickable.less"; + +#add-artist-screen { + .existing-artist { + + .card(); + margin : 30px 0px; + + .unmapped-folder-path { + padding: 20px; + margin-left : 0px; + font-weight : 100; + font-size : 25px; + text-align : center; + } + + .new-artist-loadmore { + font-size : 30px; + font-weight : 300; + padding-top : 10px; + padding-bottom : 10px; + } + } + + .new-artist { + .search-item { + .card(); + margin : 40px 0px; + } + } + + .add-artist-search { + margin-top : 20px; + margin-bottom : 20px; + } + + .search-item { + + padding-bottom : 20px; + + .artist-title { + margin-top : 5px; + + .labels { + margin-left : 10px; + + .label { + font-size : 12px; + vertical-align : middle; + } + } + + .year { + font-style : italic; + color : #aaaaaa; + } + } + + .new-artist-overview { + overflow : hidden; + height : 103px; + + .overview-internal { + overflow : hidden; + height : 80px; + } + } + + .artist-poster { + min-width : 138px; + min-height : 203px; + max-width : 138px; + max-height : 203px; + margin : 10px; + } + + .album-poster { + min-width : 100px; + min-height : 100px; + max-width : 138px; + max-height : 203px; + margin : 10px; + } + + a { + color : #343434; + } + + a:hover { + text-decoration : none; + } + + select { + font-size : 14px; + } + + .checkbox { + margin-top : 0px; + } + + .add { + i { + &:before { + color : #ffffff; + } + } + } + + .monitor-tooltip { + margin-left : 5px; + } + } + + .loading-folders { + margin : 30px 0px; + text-align: center; + } + + .hint { + color : #999999; + font-style : italic; + } + + .monitor-tooltip-contents { + padding-bottom : 0px; + + dd { + padding-bottom : 8px; + } + } +} + +li.add-new { + .clickable; + + display: block; + padding: 3px 20px; + clear: both; + font-weight: normal; + line-height: 20px; + color: rgb(51, 51, 51); + white-space: nowrap; +} + +li.add-new:hover { + text-decoration: none; + color: rgb(255, 255, 255); + background-color: rgb(0, 129, 194); +} + +.root-folders-modal { + overflow : visible; + + .root-folders-list { + overflow-y : auto; + max-height : 300px; + + i { + .clickable(); + } + } + + .validation-errors { + display : none; + } + + .input-group { + .form-control { + background-color : white; + } + } + + .root-folders { + margin-top : 20px; + } + + .recent-folder { + .clickable(); + } +} diff --git a/src/UI/Artist/AlbumCollection.js b/src/UI/Artist/AlbumCollection.js new file mode 100644 index 000000000..61faa2046 --- /dev/null +++ b/src/UI/Artist/AlbumCollection.js @@ -0,0 +1,10 @@ +var Backbone = require('backbone'); +var AlbumModel = require('./AlbumModel'); + +module.exports = Backbone.Collection.extend({ + model : AlbumModel, + + comparator : function(season) { + return -season.get('seasonNumber'); + } +}); \ No newline at end of file diff --git a/src/UI/Artist/AlbumModel.js b/src/UI/Artist/AlbumModel.js new file mode 100644 index 000000000..1ba049eb6 --- /dev/null +++ b/src/UI/Artist/AlbumModel.js @@ -0,0 +1,11 @@ +var Backbone = require('backbone'); + +module.exports = Backbone.Model.extend({ + defaults : { + seasonNumber : 0 + }, + + initialize : function() { + this.set('id', this.get('seasonNumber')); + } +}); \ No newline at end of file diff --git a/src/UI/Artist/ArtistCollection.js b/src/UI/Artist/ArtistCollection.js index f9908032d..4bffc07e2 100644 --- a/src/UI/Artist/ArtistCollection.js +++ b/src/UI/Artist/ArtistCollection.js @@ -119,6 +119,6 @@ Collection = AsFilteredCollection.call(Collection); Collection = AsSortedCollection.call(Collection); Collection = AsPersistedStateCollection.call(Collection); -var data = ApiData.get('series'); // TOOD: Build backend for artist +var data = ApiData.get('artist'); // TOOD: Build backend for artist module.exports = new Collection(data, { full : true }).bindSignalR(); diff --git a/src/UI/Artist/ArtistController.js b/src/UI/Artist/ArtistController.js index 4805bd9bf..c6e24a771 100644 --- a/src/UI/Artist/ArtistController.js +++ b/src/UI/Artist/ArtistController.js @@ -1,8 +1,8 @@ var NzbDroneController = require('../Shared/NzbDroneController'); var AppLayout = require('../AppLayout'); var ArtistCollection = require('./ArtistCollection'); -var SeriesIndexLayout = require('../Series/Index/SeriesIndexLayout'); -var SeriesDetailsLayout = require('../Series/Details/SeriesDetailsLayout'); +var ArtistIndexLayout = require('./Index/ArtistIndexLayout'); +var ArtistDetailsLayout = require('./Details/ArtistDetailsLayout'); module.exports = NzbDroneController.extend({ _originalInit : NzbDroneController.prototype.initialize, @@ -17,18 +17,18 @@ module.exports = NzbDroneController.extend({ artist : function() { this.setTitle('Lidarr'); - this.showMainRegion(new SeriesIndexLayout()); + this.showMainRegion(new ArtistIndexLayout()); }, artistDetails : function(query) { - var artists = ArtistCollection.where({ artistNameSlug : query }); + var artists = ArtistCollection.where({ artistSlug : query }); console.log('artistDetails, artists: ', artists); if (artists.length !== 0) { - var targetSeries = artists[0]; - console.log("[ArtistController] targetSeries: ", targetSeries); - this.setTitle(targetSeries.get('artistName')); // TODO: Update NzbDroneController + var targetArtist = artists[0]; + console.log("[ArtistController] targetArtist: ", targetArtist); + this.setTitle(targetArtist.get('artistName')); // TODO: Update NzbDroneController //this.setArtistName(targetSeries.get('artistName')); - this.showMainRegion(new SeriesDetailsLayout({ model : targetSeries })); + this.showMainRegion(new ArtistDetailsLayout({ model : targetArtist })); } else { this.showNotFound(); } diff --git a/src/UI/Artist/ArtistModel.js b/src/UI/Artist/ArtistModel.js index 209ebc1fa..a3c3dde50 100644 --- a/src/UI/Artist/ArtistModel.js +++ b/src/UI/Artist/ArtistModel.js @@ -13,7 +13,7 @@ module.exports = Backbone.Model.extend({ setAlbumsMonitored : function(albumName) { _.each(this.get('albums'), function(album) { - if (season.albumName === albumName) { + if (album.albumName === albumName) { album.monitored = !album.monitored; } }); diff --git a/src/UI/Artist/Delete/DeleteArtistTemplate.hbs b/src/UI/Artist/Delete/DeleteArtistTemplate.hbs new file mode 100644 index 000000000..5e13328b1 --- /dev/null +++ b/src/UI/Artist/Delete/DeleteArtistTemplate.hbs @@ -0,0 +1,50 @@ +