mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-22 22:15:17 -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:
committed by
Tim Turner
parent
0d1150d4d2
commit
35b384439f
@@ -0,0 +1,62 @@
|
||||
var vent = require('vent');
|
||||
var _ = require('underscore');
|
||||
var $ = require('jquery');
|
||||
var NzbDroneCell = require('../../Cells/NzbDroneCell');
|
||||
var CommandController = require('../../Commands/CommandController');
|
||||
|
||||
module.exports = NzbDroneCell.extend({
|
||||
className : 'tmdbId-cell',
|
||||
|
||||
// would like to use change with a _.debounce eventually
|
||||
events : {
|
||||
'blur input.tmdbId-input' : '_updateId'
|
||||
},
|
||||
|
||||
render : function() {
|
||||
this.$el.empty();
|
||||
|
||||
this.$el.html('<i class="icon-sonarr-info hidden"></i><input type="text" class="x-tmdbId tmdbId-input form-control" value="' + this.cellValue.get('tmdbId') + '" />');
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
_updateId : function() {
|
||||
var field = this.$el.find('.x-tmdbId');
|
||||
var data = field.val();
|
||||
|
||||
var promise = $.ajax({
|
||||
url : window.NzbDrone.ApiRoot + '/movies/lookup/tmdb?tmdbId=' + data,
|
||||
type : 'GET',
|
||||
});
|
||||
|
||||
//field.spinForPromise(promise);
|
||||
|
||||
field.prop("disabled", true)
|
||||
|
||||
var icon = this.$(".icon-sonarr-info");
|
||||
|
||||
icon.removeClass("hidden");
|
||||
|
||||
icon.spinForPromise(promise);
|
||||
var _self = this;
|
||||
var cacheMonitored = this.model.get('monitored');
|
||||
var cacheProfile = this.model.get("profileId");
|
||||
var cachePath = this.model.get("path");
|
||||
var cacheFile = this.model.get("movieFile");
|
||||
var cacheRoot = this.model.get("rootFolderPath");
|
||||
|
||||
promise.success(function(response) {
|
||||
_self.model.set(response);
|
||||
_self.model.set('monitored', cacheMonitored); //reset to the previous monitored value
|
||||
_self.model.set('profileId', cacheProfile);
|
||||
_self.model.set('path', cachePath);
|
||||
_self.model.set('movieFile', cacheFile); // may be unneccessary.
|
||||
field.prop("disabled", false)
|
||||
});
|
||||
|
||||
promise.error(function(request, status, error) {
|
||||
console.error("Status: " + status, "Error: " + error);
|
||||
field.prop("disabled", false)
|
||||
});
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user