From 708db1a75c649f153abfb928b04079ecbe6fb6a5 Mon Sep 17 00:00:00 2001 From: Tim Turner Date: Mon, 9 Jan 2017 17:26:13 -0500 Subject: [PATCH] Organize & Rename work --- src/NzbDrone.Api/Series/MovieResource.cs | 6 ++++ .../MediaFiles/RenameMovieFileService.cs | 2 +- src/UI/AddMovies/SearchResultViewTemplate.hbs | 4 +-- src/UI/Rename/RenamePreviewLayout.js | 28 +++++-------------- .../Series/Editor/SeriesEditorFooterView.js | 8 ++---- 5 files changed, 18 insertions(+), 30 deletions(-) diff --git a/src/NzbDrone.Api/Series/MovieResource.cs b/src/NzbDrone.Api/Series/MovieResource.cs index f9bcf658e..70a585086 100644 --- a/src/NzbDrone.Api/Series/MovieResource.cs +++ b/src/NzbDrone.Api/Series/MovieResource.cs @@ -85,6 +85,12 @@ namespace NzbDrone.Api.Movie long size = 0; bool downloaded = false; + + if(model.MovieFile != null) + { + model.MovieFile.LazyLoad(); + } + if (model.MovieFile != null && model.MovieFile.IsLoaded && model.MovieFile.Value != null) { size = model.MovieFile.Value.Size; diff --git a/src/NzbDrone.Core/MediaFiles/RenameMovieFileService.cs b/src/NzbDrone.Core/MediaFiles/RenameMovieFileService.cs index cb4382a66..9a4019f56 100644 --- a/src/NzbDrone.Core/MediaFiles/RenameMovieFileService.cs +++ b/src/NzbDrone.Core/MediaFiles/RenameMovieFileService.cs @@ -22,7 +22,7 @@ namespace NzbDrone.Core.MediaFiles } public class RenameMovieFileService : IRenameMovieFileService, - //IExecute, + IExecute, IExecute { private readonly IMovieService _movieService; diff --git a/src/UI/AddMovies/SearchResultViewTemplate.hbs b/src/UI/AddMovies/SearchResultViewTemplate.hbs index 87e1167da..35d213adb 100644 --- a/src/UI/AddMovies/SearchResultViewTemplate.hbs +++ b/src/UI/AddMovies/SearchResultViewTemplate.hbs @@ -52,7 +52,7 @@ {{> ProfileSelectionPartial profiles}} -
+ {{!--
@@ -65,7 +65,7 @@
-
+
--}} {{/unless}} {{#unless existing}} diff --git a/src/UI/Rename/RenamePreviewLayout.js b/src/UI/Rename/RenamePreviewLayout.js index b699a2ae0..a37ffeb37 100644 --- a/src/UI/Rename/RenamePreviewLayout.js +++ b/src/UI/Rename/RenamePreviewLayout.js @@ -67,7 +67,8 @@ module.exports = Marionette.Layout.extend({ } var files = _.map(this.collection.where({ rename : true }), function(model) { - return model.get('episodeFileId'); + //return model.get('episodeFileId'); + return model.get('movieFileId'); }); if (files.length === 0) { @@ -75,26 +76,11 @@ module.exports = Marionette.Layout.extend({ return; } - // if (this.seasonNumber) { - // CommandController.Execute('renameFiles', { - // name : 'renameFiles', - // movieId : this.model.id, - // //seasonNumber : this.seasonNumber, - // files : files - // }); - // } else { - // CommandController.Execute('renameFiles', { - // name : 'renameFiles', - // seriesId : this.model.id, - // seasonNumber : -1, - // files : files - // }); - CommandController.Execute('renameMovieFiles', { - name : 'renameMovieFiles', - movieId : this.model.id, - files : files - }); - //} + CommandController.Execute('renameMovieFiles', { + name : 'renameMovieFiles', + movieId : this.model.id, + files : files + }); vent.trigger(vent.Commands.CloseModalCommand); }, diff --git a/src/UI/Series/Editor/SeriesEditorFooterView.js b/src/UI/Series/Editor/SeriesEditorFooterView.js index 76a53dd91..6f4f83a6c 100644 --- a/src/UI/Series/Editor/SeriesEditorFooterView.js +++ b/src/UI/Series/Editor/SeriesEditorFooterView.js @@ -5,7 +5,6 @@ var Profiles = require('../../Profile/ProfileCollection'); var RootFolders = require('../../AddSeries/RootFolders/RootFolderCollection'); var RootFolderLayout = require('../../AddSeries/RootFolders/RootFolderLayout'); var UpdateFilesSeriesView = require('./Organize/OrganizeFilesView'); -var UPdateFilesMoviesView = require('./Organize/OrganizeFilesView'); var Config = require('../../Config'); module.exports = Marionette.ItemView.extend({ @@ -119,11 +118,8 @@ module.exports = Marionette.ItemView.extend({ _organizeFiles : function() { var selected = this.editorGrid.getSelectedModels(); - //var updateFilesSeriesView = new UpdateFilesSeriesView({ series : selected }); - //this.listenToOnce(updateFilesSeriesView, 'updatingFiles', this._afterSave); - - var updateFilesMoviesView = new UpdateFilesMoviesView({ movies: selected }); - this.listenToOnce(updateFilesMOviesVIew, 'updatingFiles', this._afterSave); + var updateFilesSeriesView = new UpdateFilesSeriesView({ series : selected }); + this.listenToOnce(updateFilesSeriesView, 'updatingFiles', this._afterSave); vent.trigger(vent.Commands.OpenModalCommand, updateFilesSeriesView); }