parent
98858bd237
commit
33ebf1bf78
@ -0,0 +1,22 @@
|
||||
using System.Collections.Generic;
|
||||
using NzbDrone.Core.Messaging.Commands;
|
||||
|
||||
namespace NzbDrone.Core.MediaFiles.Commands
|
||||
{
|
||||
public class RenameSeriesCommand : Command
|
||||
{
|
||||
public List<int> SeriesIds { get; set; }
|
||||
|
||||
public override bool SendUpdatesToClient
|
||||
{
|
||||
get
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public RenameSeriesCommand()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'underscore',
|
||||
'vent',
|
||||
'backbone',
|
||||
'marionette',
|
||||
'Commands/CommandController'
|
||||
], function (_, vent, Backbone, Marionette, CommandController) {
|
||||
|
||||
return Marionette.ItemView.extend({
|
||||
template: 'Series/Editor/Rename/RenameSeriesViewTemplate',
|
||||
|
||||
events: {
|
||||
'click .x-confirm-rename': '_rename'
|
||||
},
|
||||
|
||||
initialize: function (options) {
|
||||
this.series = options.series;
|
||||
|
||||
this.templateHelpers = { numberOfSeries: this.series.length, series: new Backbone.Collection(this.series).toJSON() };
|
||||
},
|
||||
|
||||
_rename: function () {
|
||||
var seriesIds = _.pluck(this.series, 'id');
|
||||
|
||||
CommandController.Execute('renameSeries', {
|
||||
name : 'renameSeries',
|
||||
seriesIds : seriesIds
|
||||
});
|
||||
|
||||
this.trigger('seriesRenamed');
|
||||
vent.trigger(vent.Commands.CloseModalCommand);
|
||||
}
|
||||
});
|
||||
});
|
Loading…
Reference in new issue