mirror of
https://github.com/Radarr/Radarr
synced 2026-02-13 02:02:10 +01:00
Merge pull request #1107 from geogolem/movieEditorRootFolderChangeDisplayFix
keep the current page the same after clicking Save
This commit is contained in:
commit
e26fd22540
3 changed files with 12 additions and 1 deletions
|
|
@ -45,6 +45,7 @@ public MovieResource()
|
|||
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 @@ public static MovieResource ToResource(this Core.Tv.Movie model)
|
|||
MinimumAvailability = model.MinimumAvailability,
|
||||
|
||||
IsAvailable = model.IsAvailable(),
|
||||
FolderName = model.FolderName(),
|
||||
|
||||
SizeOnDisk = size,
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
using NzbDrone.Core.Datastore;
|
||||
using NzbDrone.Core.Profiles;
|
||||
using NzbDrone.Core.MediaFiles;
|
||||
using System.IO;
|
||||
|
||||
namespace NzbDrone.Core.Tv
|
||||
{
|
||||
|
|
@ -55,6 +56,11 @@ public Movie()
|
|||
|
||||
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…
Reference in a new issue