From 55f4a81dee4c0fae75c3512ab9ea3998edee64d2 Mon Sep 17 00:00:00 2001 From: Leonardo Galli Date: Sun, 8 Jan 2017 12:58:39 +0100 Subject: [PATCH 01/11] Adding first implementation of release_dates for movies. --- src/NzbDrone.Api/Series/MovieResource.cs | 3 +++ .../110_add_physical_release_to_table.cs | 23 +++++++++++++++++++ .../SkyHook/Resource/TMDBResources.cs | 21 +++++++++++++++++ .../MetadataSource/SkyHook/SkyHookProxy.cs | 13 ++++++++++- src/NzbDrone.Core/NzbDrone.Core.csproj | 1 + src/NzbDrone.Core/Tv/Movie.cs | 1 + 6 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 src/NzbDrone.Core/Datastore/Migration/110_add_physical_release_to_table.cs diff --git a/src/NzbDrone.Api/Series/MovieResource.cs b/src/NzbDrone.Api/Series/MovieResource.cs index b1924629d..733adbf95 100644 --- a/src/NzbDrone.Api/Series/MovieResource.cs +++ b/src/NzbDrone.Api/Series/MovieResource.cs @@ -27,6 +27,7 @@ namespace NzbDrone.Api.Movie public MovieStatusType Status { get; set; } public string Overview { get; set; } public DateTime? InCinemas { get; set; } + public DateTime? PhysicalRelease { get; set; } public List Images { get; set; } public string Website { get; set; } @@ -87,6 +88,7 @@ namespace NzbDrone.Api.Movie //AlternateTitles SortTitle = model.SortTitle, InCinemas = model.InCinemas, + PhysicalRelease = model.PhysicalRelease, //TotalEpisodeCount //EpisodeCount //EpisodeFileCount @@ -134,6 +136,7 @@ namespace NzbDrone.Api.Movie //AlternateTitles SortTitle = resource.SortTitle, InCinemas = resource.InCinemas, + PhysicalRelease = resource.PhysicalRelease, //TotalEpisodeCount //EpisodeCount //EpisodeFileCount diff --git a/src/NzbDrone.Core/Datastore/Migration/110_add_physical_release_to_table.cs b/src/NzbDrone.Core/Datastore/Migration/110_add_physical_release_to_table.cs new file mode 100644 index 000000000..945fde4ad --- /dev/null +++ b/src/NzbDrone.Core/Datastore/Migration/110_add_physical_release_to_table.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using FluentMigrator; +using NzbDrone.Core.Datastore.Migration.Framework; +using System.Data; + +namespace NzbDrone.Core.Datastore.Migration +{ + [Migration(110)] + public class add_phyiscal_release : NzbDroneMigrationBase + { + protected override void MainDbUpgrade() + { + Alter.Table("Movies").AddColumn("PhysicalRelease").AsDateTime().Nullable(); + + } + + + + } +} diff --git a/src/NzbDrone.Core/MetadataSource/SkyHook/Resource/TMDBResources.cs b/src/NzbDrone.Core/MetadataSource/SkyHook/Resource/TMDBResources.cs index d6076d3fd..9c346057a 100644 --- a/src/NzbDrone.Core/MetadataSource/SkyHook/Resource/TMDBResources.cs +++ b/src/NzbDrone.Core/MetadataSource/SkyHook/Resource/TMDBResources.cs @@ -61,6 +61,27 @@ namespace NzbDrone.Core.MetadataSource.SkyHook.Resource public float vote_average { get; set; } public int vote_count { get; set; } public AlternativeTitles alternative_titles { get; set; } + public ReleaseDatesResource release_dates { get; set; } + } + + public class ReleaseDatesResource + { + public List results { get; set; } + } + + public class ReleaseDate + { + public string certification { get; set; } + public string iso_639_1 { get; set; } + public string note { get; set; } + public string release_date { get; set; } + public int type { get; set; } + } + + public class ReleaseDates + { + public string iso_3166_1 { get; set; } + public List release_dates { get; set; } } public class Belongs_To_Collection diff --git a/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs b/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs index 14957c0ef..4e8420337 100644 --- a/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs +++ b/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs @@ -70,7 +70,7 @@ namespace NzbDrone.Core.MetadataSource.SkyHook .SetSegment("route", "movie") .SetSegment("id", TmdbId.ToString()) .SetSegment("secondaryRoute", "") - .AddQueryParam("append_to_response", "alternative_titles") + .AddQueryParam("append_to_response", "alternative_titles,release_dates") .AddQueryParam("country", "US") .Build(); @@ -102,6 +102,17 @@ namespace NzbDrone.Core.MetadataSource.SkyHook movie.AlternativeTitles.Add(title.title); } + foreach(ReleaseDates releaseDates in resource.release_dates.results) + { + foreach(ReleaseDate releaseDate in releaseDates.release_dates) + { + if (releaseDate.type == 5 || releaseDate.type == 4) + { + movie.PhysicalRelease = DateTime.Parse(releaseDate.release_date); + } + } + } + movie.Ratings = new Ratings(); movie.Ratings.Votes = resource.vote_count; movie.Ratings.Value = (decimal)resource.vote_average; diff --git a/src/NzbDrone.Core/NzbDrone.Core.csproj b/src/NzbDrone.Core/NzbDrone.Core.csproj index 8720a43ff..a4a24ed0e 100644 --- a/src/NzbDrone.Core/NzbDrone.Core.csproj +++ b/src/NzbDrone.Core/NzbDrone.Core.csproj @@ -286,6 +286,7 @@ Code + diff --git a/src/NzbDrone.Core/Tv/Movie.cs b/src/NzbDrone.Core/Tv/Movie.cs index e31a66896..24329b987 100644 --- a/src/NzbDrone.Core/Tv/Movie.cs +++ b/src/NzbDrone.Core/Tv/Movie.cs @@ -41,6 +41,7 @@ namespace NzbDrone.Core.Tv public string RootFolderPath { get; set; } public DateTime Added { get; set; } public DateTime? InCinemas { get; set; } + public DateTime? PhysicalRelease { get; set; } public LazyLoaded Profile { get; set; } public HashSet Tags { get; set; } public AddMovieOptions AddOptions { get; set; } From fb7969e046cd01e604c4cce0bd8dad5998dc9113 Mon Sep 17 00:00:00 2001 From: Leonardo Galli Date: Sun, 8 Jan 2017 16:36:22 +0100 Subject: [PATCH 02/11] Available date is now displayed. --- .../MetadataSource/SkyHook/SkyHookProxy.cs | 12 +++++++++++- src/NzbDrone.Core/Tv/RefreshMovieService.cs | 1 + src/UI/Handlebars/Helpers/Series.js | 9 ++++++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs b/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs index 4e8420337..f37184518 100644 --- a/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs +++ b/src/NzbDrone.Core/MetadataSource/SkyHook/SkyHookProxy.cs @@ -108,7 +108,17 @@ namespace NzbDrone.Core.MetadataSource.SkyHook { if (releaseDate.type == 5 || releaseDate.type == 4) { - movie.PhysicalRelease = DateTime.Parse(releaseDate.release_date); + if (movie.PhysicalRelease.HasValue) + { + if (movie.PhysicalRelease.Value.After(DateTime.Parse(releaseDate.release_date))) + { + movie.PhysicalRelease = DateTime.Parse(releaseDate.release_date); //Use oldest release date available. + } + } + else + { + movie.PhysicalRelease = DateTime.Parse(releaseDate.release_date); + } } } } diff --git a/src/NzbDrone.Core/Tv/RefreshMovieService.cs b/src/NzbDrone.Core/Tv/RefreshMovieService.cs index a4ac0d8ec..a0b4a56a9 100644 --- a/src/NzbDrone.Core/Tv/RefreshMovieService.cs +++ b/src/NzbDrone.Core/Tv/RefreshMovieService.cs @@ -83,6 +83,7 @@ namespace NzbDrone.Core.Tv movie.Website = movieInfo.Website; movie.AlternativeTitles = movieInfo.AlternativeTitles; movie.Year = movieInfo.Year; + movie.PhysicalRelease = movieInfo.PhysicalRelease; try { diff --git a/src/UI/Handlebars/Helpers/Series.js b/src/UI/Handlebars/Helpers/Series.js index fbb3a23fc..2663e2b40 100644 --- a/src/UI/Handlebars/Helpers/Series.js +++ b/src/UI/Handlebars/Helpers/Series.js @@ -134,10 +134,17 @@ Handlebars.registerHelper('inCinemas', function() { var monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ]; + if (this.physicalRelease) { + var d = new Date(this.physicalRelease); + var day = d.getDate(); + var month = monthNames[d.getMonth()]; + var year = d.getFullYear(); + return "Available: " + day + ". " + month + " " + year; + } var cinemasDate = new Date(this.inCinemas); var year = cinemasDate.getFullYear(); var month = monthNames[cinemasDate.getMonth()]; - return "In Cinemas " + month + " " + year; + return "In Cinemas: " + month + " " + year; }); Handlebars.registerHelper('tvRageUrl', function() { From 1dfb4ddcd816750bd03819ab0b734d90af89b16e Mon Sep 17 00:00:00 2001 From: Leonardo Galli Date: Sun, 8 Jan 2017 17:10:56 +0100 Subject: [PATCH 03/11] Fixes sorting of movies. Fixes #53. --- src/UI/Activity/History/HistoryCollection.js | 2 +- src/UI/Movies/Index/MoviesIndexLayout.js | 38 +------------------ src/UI/Movies/MoviesCollection.js | 8 ++-- .../Toolbar/Sorting/SortingButtonView.js | 2 +- 4 files changed, 8 insertions(+), 42 deletions(-) diff --git a/src/UI/Activity/History/HistoryCollection.js b/src/UI/Activity/History/HistoryCollection.js index 5eb4dc4f7..8c82b7988 100644 --- a/src/UI/Activity/History/HistoryCollection.js +++ b/src/UI/Activity/History/HistoryCollection.js @@ -50,7 +50,7 @@ var Collection = PageableCollection.extend({ }, sortMappings : { - 'movie' : { sortKey : 'movie.sortTitle' } + 'movie' : { sortKey : 'movie.title' } }, initialize : function(options) { diff --git a/src/UI/Movies/Index/MoviesIndexLayout.js b/src/UI/Movies/Index/MoviesIndexLayout.js index 3e16a7eb7..8e87390ba 100644 --- a/src/UI/Movies/Index/MoviesIndexLayout.js +++ b/src/UI/Movies/Index/MoviesIndexLayout.js @@ -38,7 +38,6 @@ module.exports = Marionette.Layout.extend({ label : 'Title', cell : MovieTitleCell, cellValue : 'this', - sortValue : 'sortTitle' }, { name : 'profileId', @@ -128,25 +127,13 @@ module.exports = Marionette.Layout.extend({ title : 'Title', name : 'title' }, - { - title : 'Seasons', - name : 'seasonCount' - }, { title : 'Quality', name : 'profileId' }, { - title : 'Network', - name : 'network' - }, - { - title : 'Next Airing', - name : 'nextAiring' - }, - { - title : 'Episodes', - name : 'percentOfEpisodes' + title : 'In Cinemas', + name : 'inCinemas' } ] }; @@ -170,27 +157,6 @@ module.exports = Marionette.Layout.extend({ tooltip : 'Monitored Only', icon : 'icon-sonarr-monitored', callback : this._setFilter - }, - { - key : 'continuing', - title : '', - tooltip : 'Continuing Only', - icon : 'icon-sonarr-series-continuing', - callback : this._setFilter - }, - { - key : 'ended', - title : '', - tooltip : 'Ended Only', - icon : 'icon-sonarr-series-ended', - callback : this._setFilter - }, - { - key : 'missing', - title : '', - tooltip : 'Missing', - icon : 'icon-sonarr-missing', - callback : this._setFilter } ] }; diff --git a/src/UI/Movies/MoviesCollection.js b/src/UI/Movies/MoviesCollection.js index 2df59e282..16d50298f 100644 --- a/src/UI/Movies/MoviesCollection.js +++ b/src/UI/Movies/MoviesCollection.js @@ -15,10 +15,10 @@ var Collection = PageableCollection.extend({ tableName : 'movie', state : { - sortKey : 'sortTitle', - order : -1, + sortKey : 'title', + order : 1, pageSize : 100000, - secondarySortKey : 'sortTitle', + secondarySortKey : 'title', secondarySortOrder : -1 }, @@ -73,7 +73,7 @@ var Collection = PageableCollection.extend({ sortMappings : { title : { - sortKey : 'sortTitle' + sortKey : 'title' }, nextAiring : { diff --git a/src/UI/Shared/Toolbar/Sorting/SortingButtonView.js b/src/UI/Shared/Toolbar/Sorting/SortingButtonView.js index 6f6833ed2..a2c9bc0d9 100644 --- a/src/UI/Shared/Toolbar/Sorting/SortingButtonView.js +++ b/src/UI/Shared/Toolbar/Sorting/SortingButtonView.js @@ -67,4 +67,4 @@ module.exports = Marionette.ItemView.extend({ _removeSortIcon : function() { this.ui.icon.removeClass('icon-sonarr-sort-asc icon-sonarr-sort-desc'); } -}); \ No newline at end of file +}); From 49537a2efe33a028fc0c06aca47ef74fe8885b41 Mon Sep 17 00:00:00 2001 From: Leonardo Galli Date: Sun, 8 Jan 2017 17:47:19 +0100 Subject: [PATCH 04/11] Update UI to display download status. --- src/NzbDrone.Api/Series/MovieResource.cs | 8 ++++- src/UI/Cells/MovieDownloadStatusCell.js | 6 ++++ src/UI/Cells/MovieDownloadStatusTemplate.hbs | 1 + src/UI/Handlebars/Helpers/Series.js | 32 +++++++++++++++++++ src/UI/Movies/Details/InfoViewTemplate.hbs | 1 + src/UI/Movies/Index/MoviesIndexLayout.js | 10 ++++++ .../SeriesOverviewItemViewTemplate.hbs | 2 ++ 7 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 src/UI/Cells/MovieDownloadStatusCell.js create mode 100644 src/UI/Cells/MovieDownloadStatusTemplate.hbs diff --git a/src/NzbDrone.Api/Series/MovieResource.cs b/src/NzbDrone.Api/Series/MovieResource.cs index b1924629d..4038792d7 100644 --- a/src/NzbDrone.Api/Series/MovieResource.cs +++ b/src/NzbDrone.Api/Series/MovieResource.cs @@ -29,7 +29,7 @@ namespace NzbDrone.Api.Movie public DateTime? InCinemas { get; set; } public List Images { get; set; } public string Website { get; set; } - + public bool Downloaded { get; set; } public string RemotePoster { get; set; } public int Year { get; set; } @@ -79,6 +79,8 @@ namespace NzbDrone.Api.Movie { if (model == null) return null; + long Size = model.MovieFile.Value != null ? model.MovieFile.Value.Size : 0; + return new MovieResource { Id = model.Id, @@ -87,6 +89,8 @@ namespace NzbDrone.Api.Movie //AlternateTitles SortTitle = model.SortTitle, InCinemas = model.InCinemas, + + Downloaded = model.MovieFile.Value != null, //TotalEpisodeCount //EpisodeCount //EpisodeFileCount @@ -104,6 +108,8 @@ namespace NzbDrone.Api.Movie Monitored = model.Monitored, + SizeOnDisk = Size, + Runtime = model.Runtime, LastInfoSync = model.LastInfoSync, CleanTitle = model.CleanTitle, diff --git a/src/UI/Cells/MovieDownloadStatusCell.js b/src/UI/Cells/MovieDownloadStatusCell.js new file mode 100644 index 000000000..ba35657b4 --- /dev/null +++ b/src/UI/Cells/MovieDownloadStatusCell.js @@ -0,0 +1,6 @@ +var TemplatedCell = require('./TemplatedCell'); + +module.exports = TemplatedCell.extend({ + className : 'movie-title-cell', + template : 'Cells/MovieDownloadStatusTemplate', +}); diff --git a/src/UI/Cells/MovieDownloadStatusTemplate.hbs b/src/UI/Cells/MovieDownloadStatusTemplate.hbs new file mode 100644 index 000000000..002a9fdc6 --- /dev/null +++ b/src/UI/Cells/MovieDownloadStatusTemplate.hbs @@ -0,0 +1 @@ +{{DownloadedStatus}} diff --git a/src/UI/Handlebars/Helpers/Series.js b/src/UI/Handlebars/Helpers/Series.js index fbb3a23fc..41c2d641a 100644 --- a/src/UI/Handlebars/Helpers/Series.js +++ b/src/UI/Handlebars/Helpers/Series.js @@ -127,8 +127,40 @@ Handlebars.registerHelper('GetBannerStatus', function() { else if (!monitored) { return new Handlebars.SafeString('
 Not Monitored
'); } +}); + +Handlebars.registerHelper('DownloadedStatusColor', function() { + if (!this.monitored) { + if (this.downloaded) { + return "default"; + } + return "warning"; + } + + if (this.downloaded) { + return "success"; + } + + if (this.status != "released") { + return "primary"; + } + + return "danger"; }) +Handlebars.registerHelper('DownloadedStatus', function() { + + if (this.downloaded) { + return "Downloaded"; + } + if (!this.monitored) { + return "Not Monitored"; + } + + + return "Missing"; +}); + Handlebars.registerHelper('inCinemas', function() { var monthNames = ["January", "February", "March", "April", "May", "June", diff --git a/src/UI/Movies/Details/InfoViewTemplate.hbs b/src/UI/Movies/Details/InfoViewTemplate.hbs index 1897c841a..602a13e72 100644 --- a/src/UI/Movies/Details/InfoViewTemplate.hbs +++ b/src/UI/Movies/Details/InfoViewTemplate.hbs @@ -26,6 +26,7 @@ {{else}} Announced {{/if_eq}} + {{DownloadedStatus}}
diff --git a/src/UI/Movies/Index/MoviesIndexLayout.js b/src/UI/Movies/Index/MoviesIndexLayout.js index 8e87390ba..abcfdfd30 100644 --- a/src/UI/Movies/Index/MoviesIndexLayout.js +++ b/src/UI/Movies/Index/MoviesIndexLayout.js @@ -12,6 +12,7 @@ var ProfileCell = require('../../Cells/ProfileCell'); var MovieLinksCell = require('../../Cells/MovieLinksCell'); var MovieActionCell = require('../../Cells/MovieActionCell'); var MovieStatusCell = require('../../Cells/MovieStatusCell'); +var MovieDownloadStatusCell = require('../../Cells/MovieDownloadStatusCell'); var FooterView = require('./FooterView'); var FooterModel = require('./FooterModel'); var ToolbarLayout = require('../../Shared/Toolbar/ToolbarLayout'); @@ -55,6 +56,11 @@ module.exports = Marionette.Layout.extend({ cell : MovieLinksCell, className : "movie-links-cell" }, + { + name : "this", + label : "Status", + cell : MovieDownloadStatusCell, + }, { name : 'this', label : '', @@ -134,6 +140,10 @@ module.exports = Marionette.Layout.extend({ { title : 'In Cinemas', name : 'inCinemas' + }, + { + title : "Status", + name : "status", } ] }; diff --git a/src/UI/Movies/Index/Overview/SeriesOverviewItemViewTemplate.hbs b/src/UI/Movies/Index/Overview/SeriesOverviewItemViewTemplate.hbs index c222b56cb..302d431ca 100644 --- a/src/UI/Movies/Index/Overview/SeriesOverviewItemViewTemplate.hbs +++ b/src/UI/Movies/Index/Overview/SeriesOverviewItemViewTemplate.hbs @@ -40,6 +40,8 @@ {{inCinemas}} {{profile profileId}} + + {{DownloadedStatus}}
From af74854b8e5b959fcac39ec9f80673a4ec316e2a Mon Sep 17 00:00:00 2001 From: Leonardo Galli Date: Sun, 8 Jan 2017 18:16:07 +0100 Subject: [PATCH 05/11] Fix Service install, when Sonarr is also present. Fixes #55. --- src/NzbDrone.Common/ServiceProvider.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/NzbDrone.Common/ServiceProvider.cs b/src/NzbDrone.Common/ServiceProvider.cs index b494381c3..8387e6f7c 100644 --- a/src/NzbDrone.Common/ServiceProvider.cs +++ b/src/NzbDrone.Common/ServiceProvider.cs @@ -25,7 +25,7 @@ namespace NzbDrone.Common public class ServiceProvider : IServiceProvider { - public const string NZBDRONE_SERVICE_NAME = "NzbDrone"; + public const string NZBDRONE_SERVICE_NAME = "Radarr"; private readonly IProcessProvider _processProvider; private readonly Logger _logger; @@ -78,7 +78,7 @@ namespace NzbDrone.Common serviceInstaller.Context = context; serviceInstaller.DisplayName = serviceName; serviceInstaller.ServiceName = serviceName; - serviceInstaller.Description = "NzbDrone Application Server"; + serviceInstaller.Description = "Radarr Application Server"; serviceInstaller.StartType = ServiceStartMode.Automatic; serviceInstaller.ServicesDependedOn = new[] { "EventLog", "Tcpip", "http" }; From d62dbd48ae60a7d878f24fba04e1d4ff561edbd2 Mon Sep 17 00:00:00 2001 From: Mike Date: Sun, 8 Jan 2017 18:47:48 +0100 Subject: [PATCH 06/11] Change Sonarr / NzbDrone auto-updater stuff to Radarr. (#61) This is required in order for the auto-updater to work. --- src/NzbDrone.Common/Extensions/PathExtensions.cs | 8 ++++---- src/NzbDrone.Core/Update/InstallUpdateService.cs | 4 ++-- src/NzbDrone.Update/UpdateApp.cs | 8 ++++---- src/NzbDrone.Update/UpdateEngine/InstallUpdateService.cs | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/NzbDrone.Common/Extensions/PathExtensions.cs b/src/NzbDrone.Common/Extensions/PathExtensions.cs index 9358c72dd..63dc57884 100644 --- a/src/NzbDrone.Common/Extensions/PathExtensions.cs +++ b/src/NzbDrone.Common/Extensions/PathExtensions.cs @@ -16,10 +16,10 @@ namespace NzbDrone.Common.Extensions private const string UPDATE_CLIENT_EXE = "Radarr.Update.exe"; private const string BACKUP_FOLDER = "Backups"; - private static readonly string UPDATE_SANDBOX_FOLDER_NAME = "nzbdrone_update" + Path.DirectorySeparatorChar; - private static readonly string UPDATE_PACKAGE_FOLDER_NAME = ""; - private static readonly string UPDATE_BACKUP_FOLDER_NAME = "nzbdrone_backup" + Path.DirectorySeparatorChar; - private static readonly string UPDATE_BACKUP_APPDATA_FOLDER_NAME = "nzbdrone_appdata_backup" + Path.DirectorySeparatorChar; + private static readonly string UPDATE_SANDBOX_FOLDER_NAME = "radarr_update" + Path.DirectorySeparatorChar; + private static readonly string UPDATE_PACKAGE_FOLDER_NAME = "Radarr" + Path.DirectorySeparatorChar; + private static readonly string UPDATE_BACKUP_FOLDER_NAME = "radarr_backup" + Path.DirectorySeparatorChar; + private static readonly string UPDATE_BACKUP_APPDATA_FOLDER_NAME = "radarr_appdata_backup" + Path.DirectorySeparatorChar; private static readonly string UPDATE_CLIENT_FOLDER_NAME = "NzbDrone.Update" + Path.DirectorySeparatorChar; private static readonly string UPDATE_LOG_FOLDER_NAME = "UpdateLogs" + Path.DirectorySeparatorChar; diff --git a/src/NzbDrone.Core/Update/InstallUpdateService.cs b/src/NzbDrone.Core/Update/InstallUpdateService.cs index e5ef7fa30..27345beb7 100644 --- a/src/NzbDrone.Core/Update/InstallUpdateService.cs +++ b/src/NzbDrone.Core/Update/InstallUpdateService.cs @@ -129,7 +129,7 @@ namespace NzbDrone.Core.Update _diskTransferService.TransferFolder(_appFolderInfo.GetUpdateClientFolder(), updateSandboxFolder, TransferMode.Move, false); _logger.Info("Starting update client {0}", _appFolderInfo.GetUpdateClientExePath()); - _logger.ProgressInfo("Sonarr will restart shortly."); + _logger.ProgressInfo("Radarr will restart shortly."); _processProvider.Start(_appFolderInfo.GetUpdateClientExePath(), GetUpdaterArgs(updateSandboxFolder)); } @@ -187,7 +187,7 @@ namespace NzbDrone.Core.Update if (_appFolderInfo.StartUpFolder.IsParentPath(_appFolderInfo.AppDataFolder) || _appFolderInfo.StartUpFolder.PathEquals(_appFolderInfo.AppDataFolder)) { - throw new UpdateFailedException("Your Sonarr configuration '{0}' is being stored in application folder '{1}' which will cause data lost during the upgrade. Please remove any symlinks or redirects before trying again.", _appFolderInfo.AppDataFolder, _appFolderInfo.StartUpFolder); + throw new UpdateFailedException("Your Radarr configuration '{0}' is being stored in application folder '{1}' which will cause data lost during the upgrade. Please remove any symlinks or redirects before trying again.", _appFolderInfo.AppDataFolder, _appFolderInfo.StartUpFolder); } } diff --git a/src/NzbDrone.Update/UpdateApp.cs b/src/NzbDrone.Update/UpdateApp.cs index bad208032..82b1ed116 100644 --- a/src/NzbDrone.Update/UpdateApp.cs +++ b/src/NzbDrone.Update/UpdateApp.cs @@ -36,7 +36,7 @@ namespace NzbDrone.Update var startupArgument = new StartupContext(args); NzbDroneLogger.Register(startupArgument, true, true); - Logger.Info("Starting Sonarr Update Client"); + Logger.Info("Starting Radarr Update Client"); _container = UpdateContainerBuilder.Build(startupArgument); @@ -66,9 +66,9 @@ namespace NzbDrone.Update } var startupContext = new UpdateStartupContext - { - ProcessId = ParseProcessId(args[0]) - }; + { + ProcessId = ParseProcessId(args[0]) + }; if (OsInfo.IsNotWindows) { diff --git a/src/NzbDrone.Update/UpdateEngine/InstallUpdateService.cs b/src/NzbDrone.Update/UpdateEngine/InstallUpdateService.cs index 9c2866330..dcd8921f8 100644 --- a/src/NzbDrone.Update/UpdateEngine/InstallUpdateService.cs +++ b/src/NzbDrone.Update/UpdateEngine/InstallUpdateService.cs @@ -80,7 +80,7 @@ namespace NzbDrone.Update.UpdateEngine public void Start(string installationFolder, int processId) { _logger.Info("Installation Folder: {0}", installationFolder); - _logger.Info("Updating Sonarr from version {0} to version {1}", _detectExistingVersion.GetExistingVersion(installationFolder), BuildInfo.Version); + _logger.Info("Updating Radarr from version {0} to version {1}", _detectExistingVersion.GetExistingVersion(installationFolder), BuildInfo.Version); Verify(installationFolder, processId); @@ -103,7 +103,7 @@ namespace NzbDrone.Update.UpdateEngine { if (_processProvider.Exists(ProcessProvider.NZB_DRONE_CONSOLE_PROCESS_NAME) || _processProvider.Exists(ProcessProvider.NZB_DRONE_PROCESS_NAME)) { - _logger.Error("Sonarr was restarted prematurely by external process."); + _logger.Error("Radarr was restarted prematurely by external process."); return; } } @@ -146,7 +146,7 @@ namespace NzbDrone.Update.UpdateEngine if (_processProvider.Exists(ProcessProvider.NZB_DRONE_PROCESS_NAME)) { - _logger.Info("Sonarr was restarted by external process."); + _logger.Info("Radarr was restarted by external process."); break; } } From 03cc3a1ad259f37671a996eb78b78fa508c697a8 Mon Sep 17 00:00:00 2001 From: Mike Date: Sun, 8 Jan 2017 19:42:46 +0100 Subject: [PATCH 07/11] Change default branch in config. (#63) * Change Sonarr / NzbDrone auto-updater stuff to Radarr. This is required in order for the auto-updater to work. * Change default branch to develop instead of forcing it. --- src/NzbDrone.Core/Configuration/ConfigFileProvider.cs | 3 ++- src/NzbDrone.Core/Update/UpdateCheckService.cs | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs b/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs index 2eeaf6463..4b7543d5f 100644 --- a/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs +++ b/src/NzbDrone.Core/Configuration/ConfigFileProvider.cs @@ -161,7 +161,8 @@ namespace NzbDrone.Core.Configuration public bool AnalyticsEnabled => GetValueBoolean("AnalyticsEnabled", true, persist: false); - public string Branch => GetValue("Branch", "master").ToLowerInvariant(); + // TODO: Change back to "master" for the first stable release. + public string Branch => GetValue("Branch", "develop").ToLowerInvariant(); public string LogLevel => GetValue("LogLevel", "Info"); diff --git a/src/NzbDrone.Core/Update/UpdateCheckService.cs b/src/NzbDrone.Core/Update/UpdateCheckService.cs index 123666e9a..807250780 100644 --- a/src/NzbDrone.Core/Update/UpdateCheckService.cs +++ b/src/NzbDrone.Core/Update/UpdateCheckService.cs @@ -28,8 +28,7 @@ namespace NzbDrone.Core.Update public UpdatePackage AvailableUpdate() { - //For new let's just use develop, afterwards we can change it back to the config: _configFileProvider.Branch - return _updatePackageProvider.GetLatestUpdate("develop", BuildInfo.Version); + return _updatePackageProvider.GetLatestUpdate(_configFileProvider.Branch, BuildInfo.Version); } } } \ No newline at end of file From 906ecfb6a1179c6c54a0f29b30e33d6e0ec1b264 Mon Sep 17 00:00:00 2001 From: Leonardo Galli Date: Sun, 8 Jan 2017 20:06:34 +0100 Subject: [PATCH 08/11] Fixed multiple things in the Update procedure --- .../Update/Commands/ApplicationUpdateCommand.cs | 2 +- src/NzbDrone.Core/Update/InstallUpdateService.cs | 5 +++-- src/NzbDrone.Core/Update/RecentUpdateProvider.cs | 2 +- src/NzbDrone.Update/UpdateContainerBuilder.cs | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/NzbDrone.Core/Update/Commands/ApplicationUpdateCommand.cs b/src/NzbDrone.Core/Update/Commands/ApplicationUpdateCommand.cs index 5911a9a13..8656ffef8 100644 --- a/src/NzbDrone.Core/Update/Commands/ApplicationUpdateCommand.cs +++ b/src/NzbDrone.Core/Update/Commands/ApplicationUpdateCommand.cs @@ -6,6 +6,6 @@ namespace NzbDrone.Core.Update.Commands { public override bool SendUpdatesToClient => true; - public override string CompletionMessage => "Restarting Sonarr to apply updates"; + public override string CompletionMessage => "Restarting Radarr to apply updates"; } } diff --git a/src/NzbDrone.Core/Update/InstallUpdateService.cs b/src/NzbDrone.Core/Update/InstallUpdateService.cs index 27345beb7..e42a075cd 100644 --- a/src/NzbDrone.Core/Update/InstallUpdateService.cs +++ b/src/NzbDrone.Core/Update/InstallUpdateService.cs @@ -178,8 +178,9 @@ namespace NzbDrone.Core.Update { var processId = _processProvider.GetCurrentProcess().Id.ToString(); var executingApplication = _runtimeInfo.ExecutingApplication; - - return string.Join(" ", processId, updateSandboxFolder.TrimEnd(Path.DirectorySeparatorChar).WrapInQuotes(), executingApplication.WrapInQuotes(), _startupContext.PreservedArguments); + var args = string.Join(" ", processId, updateSandboxFolder.TrimEnd(Path.DirectorySeparatorChar).WrapInQuotes(), executingApplication.WrapInQuotes(), _startupContext.PreservedArguments); + _logger.Info("Updater Arguments: " + args); + return args; } private void EnsureAppDataSafety() diff --git a/src/NzbDrone.Core/Update/RecentUpdateProvider.cs b/src/NzbDrone.Core/Update/RecentUpdateProvider.cs index 6fcaf42c2..0fb20e4f4 100644 --- a/src/NzbDrone.Core/Update/RecentUpdateProvider.cs +++ b/src/NzbDrone.Core/Update/RecentUpdateProvider.cs @@ -23,7 +23,7 @@ namespace NzbDrone.Core.Update public List GetRecentUpdatePackages() { - var branch = _configFileProvider.Branch; + var branch = "develop";//_configFileProvider.Branch; return _updatePackageProvider.GetRecentUpdates(branch, BuildInfo.Version); } } diff --git a/src/NzbDrone.Update/UpdateContainerBuilder.cs b/src/NzbDrone.Update/UpdateContainerBuilder.cs index 2af2a5adc..aeaa130ad 100644 --- a/src/NzbDrone.Update/UpdateContainerBuilder.cs +++ b/src/NzbDrone.Update/UpdateContainerBuilder.cs @@ -17,7 +17,7 @@ namespace NzbDrone.Update { var assemblies = new List { - "NzbDrone.Update", + "Radarr.Update", "NzbDrone.Common" }; From ad7b6a8ec205287a364064dd1a24a4a5a4aed380 Mon Sep 17 00:00:00 2001 From: Leonardo Galli Date: Sun, 8 Jan 2017 20:09:44 +0100 Subject: [PATCH 09/11] Remove hacky way to change branch --- src/NzbDrone.Core/Update/RecentUpdateProvider.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NzbDrone.Core/Update/RecentUpdateProvider.cs b/src/NzbDrone.Core/Update/RecentUpdateProvider.cs index 0fb20e4f4..6fcaf42c2 100644 --- a/src/NzbDrone.Core/Update/RecentUpdateProvider.cs +++ b/src/NzbDrone.Core/Update/RecentUpdateProvider.cs @@ -23,7 +23,7 @@ namespace NzbDrone.Core.Update public List GetRecentUpdatePackages() { - var branch = "develop";//_configFileProvider.Branch; + var branch = _configFileProvider.Branch; return _updatePackageProvider.GetRecentUpdates(branch, BuildInfo.Version); } } From 8cad976e7f819b48273d165e8fa424421d939c4b Mon Sep 17 00:00:00 2001 From: Mike Date: Sun, 8 Jan 2017 20:23:24 +0100 Subject: [PATCH 10/11] Update readme.md --- readme.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 00b078e18..3002f07ce 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,9 @@ -# Radarr [![Build Status](https://travis-ci.org/galli-leo/Radarr.svg?branch=develop)](https://travis-ci.org/galli-leo/Radarr)# +# Radarr + +| Service | Master | Develop | +|----------|:---------------------------:|:----------------------------:| +| AppVeyor | [![AppVeyor](https://img.shields.io/appveyor/ci/galli-leo/Radarr/master.svg?maxAge=60&style=flat-square)](https://ci.appveyor.com/project/galli-leo/Radarr) | [![AppVeyor](https://img.shields.io/appveyor/ci/galli-leo/Radarr/develop.svg?maxAge=60&style=flat-square)](https://ci.appveyor.com/project/galli-leo/Radarr) | +| Travis | [![Travis](https://img.shields.io/travis/galli-leo/Radarr/master.svg?maxAge=60&style=flat-square)](https://travis-ci.org/galli-leo/Radarr) | [![Travis](https://img.shields.io/travis/galli-leo/Radarr/develop.svg?maxAge=60&style=flat-square)](https://travis-ci.org/galli-leo/Radarr) | This fork of Sonarr aims to turn it into something like Couchpotato. From 3555b4ce20f48d0253309b5e98747ed1045e0511 Mon Sep 17 00:00:00 2001 From: Leonardo Galli Date: Sun, 8 Jan 2017 20:45:19 +0100 Subject: [PATCH 11/11] Change name from updated message. --- src/UI/Shared/NzbDroneController.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/UI/Shared/NzbDroneController.js b/src/UI/Shared/NzbDroneController.js index 4068260a3..4eae5c9a6 100644 --- a/src/UI/Shared/NzbDroneController.js +++ b/src/UI/Shared/NzbDroneController.js @@ -41,7 +41,7 @@ module.exports = Marionette.AppRouter.extend({ var label = window.location.pathname === window.NzbDrone.UrlBase + '/system/updates' ? 'Reload' : 'View Changes'; Messenger.show({ - message : 'Sonarr has been updated', + message : 'Radarr has been updated', hideAfter : 0, id : 'sonarrUpdated', actions : {