Merge pull request #1107 from geogolem/movieEditorRootFolderChangeDisplayFix

keep the current page the same after clicking Save
pull/1121/head
geogolem 7 years ago committed by GitHub
commit e26fd22540

@ -45,6 +45,7 @@ namespace NzbDrone.Api.Movie
public bool Monitored { get; set; }
public MovieStatusType MinimumAvailability { get; set; }
public bool IsAvailable { get; set; }
public string FolderName { get; set; }
public int Runtime { get; set; }
public DateTime? LastInfoSync { get; set; }
@ -135,6 +136,7 @@ namespace NzbDrone.Api.Movie
MinimumAvailability = model.MinimumAvailability,
IsAvailable = model.IsAvailable(),
FolderName = model.FolderName(),
SizeOnDisk = size,

@ -5,6 +5,7 @@ using NzbDrone.Common.Extensions;
using NzbDrone.Core.Datastore;
using NzbDrone.Core.Profiles;
using NzbDrone.Core.MediaFiles;
using System.IO;
namespace NzbDrone.Core.Tv
{
@ -55,6 +56,11 @@ namespace NzbDrone.Core.Tv
public bool HasFile => MovieFileId > 0;
public string FolderName()
{
return new DirectoryInfo(Path).Name;
}
public bool IsAvailable(int delay = 0)
{
//the below line is what was used before delay was implemented, could still be used for cases when delay==0

@ -109,6 +109,7 @@ module.exports = Marionette.ItemView.extend({
});
var filterKey = this.moviesCollection.state.filterKey;
var filterValue = this.moviesCollection.state.filterValue;
var currentPage = this.moviesCollection.state.currentPage;
this.moviesCollection.setFilterMode('all');
//this.moviesCollection.fullCollection.resetFiltered();
for (var j=0; j<i; j++) {
@ -136,13 +137,15 @@ module.exports = Marionette.ItemView.extend({
if (rootFolder !== 'noChange') {
var rootFolderPath = RootFolders.get(parseInt(rootFolder, 10));
m.set('rootFolderPath', rootFolderPath.get('path'));
var folderName = m.get('folderName');
m.set('path', rootFolderPath.get('path')+ folderName);
}
}
}
this.moviesCollection.state.filterKey = filterKey;
this.moviesCollection.state.filterValue = filterValue;
this.moviesCollection.fullCollection.resetFiltered();
this.moviesCollection.getPage(currentPage, { fetch: false});
FullMovieCollection.save();
},

Loading…
Cancel
Save