1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-20 21:55:03 -04:00

Bulk Import. (#583)

* First pass at bulk import.

* First pass at paging implementation for bulk import.

* Another pass at UI for bulk import

WHY WON'T THE ROWS SELECT?!?!

* Paging mostly done. UI needs to show loading still.

* Fix for selection

* fixes.

* Add caching to bulk import

* Tried to fix paging.

* Fix has next

* Fix link error.

* Pageable now works almost perfectly.

Collection now works really nicely when paged. Also movies from different pages can be added no problemo.

* /bulk-import: ProfileCell

Various other QoL changes

* Profile selection works now

Still kinda hacky

* Default monitored to true.

* Add Monitor Cell

Update styling, added path tooltip as well

* Update model when changing tmdbId

Ensure monitor status doesn't change as well

* Added spinner feedback for tmdbid cell.

* /bulk-import: Add page-size selector
This commit is contained in:
Leonardo Galli
2017-02-08 01:09:36 +01:00
committed by Tim Turner
parent 0d1150d4d2
commit 35b384439f
30 changed files with 924 additions and 20 deletions
@@ -0,0 +1,77 @@
var Backgrid = require('backgrid');
var ProfileCollection = require('../../Profile/ProfileCollection');
var Config = require('../../Config');
var _ = require('underscore');
var vent = require("vent");
var TemplatedCell = require('../../Cells/TemplatedCell');
var NzbDroneCell = require("../../Cells/NzbDroneCell");
module.exports = TemplatedCell.extend({
className : 'profile-cell',
template : 'AddMovies/BulkImport/BulkImportProfileCell',
_orig : TemplatedCell.prototype.initialize,
_origRender : TemplatedCell.prototype.initialize,
ui : {
profile : ".x-profile",
},
events: { "change .x-profile" : "_profileChanged" },
initialize : function () {
this._orig.apply(this, arguments);
this.listenTo(vent, Config.Events.ConfigUpdatedEvent, this._onConfigUpdated);
this.defaultProfile = Config.getValue(Config.Keys.DefaultProfileId);
if(ProfileCollection.get(this.defaultProfile))
{
this.profile = this.defaultProfile;
this.$(".x-profile").val(this.defaultProfile);//this.ui.profile.val(this.defaultProfile);
this.model.set("profileId", this.defaultProfile)
}
this.cellValue = ProfileCollection;
//this.render();
//this.listenTo(ProfileCollection, 'sync', this.render);
},
_profileChanged : function() {
Config.setValue(Config.Keys.DefaultProfileId, this.$(".x-profile").val());
this.model.set("profileId", this.$(".x-profile").val());
},
_onConfigUpdated : function(options) {
if (options.key === Config.Keys.DefaultProfileId) {
this.defaultProfile = options.value;
this.$(".x-profile").val(this.defaultProfile);
//
//this.render();
//this.ui.profile.val(options.value);
}
},
render : function() {
var templateName = this.column.get('template') || this.template;
this.cellValue = ProfileCollection;
this.templateFunction = Marionette.TemplateCache.get(templateName);
this.$el.empty();
if (this.cellValue) {
var data = this.cellValue.toJSON();
var html = this.templateFunction(data);
this.$el.html(html);
}
this.delegateEvents();
this.$(".x-profile").val(this.defaultProfile);
return this;
}
});