Add save path and editing to WebUI new category dialog

This commit is contained in:
Thomas Piccirello 2018-07-23 01:49:34 -04:00
parent a0e6007fc1
commit 63c53766b4
12 changed files with 197 additions and 71 deletions

View file

@ -316,19 +316,26 @@ window.addEvent('load', function() {
syncMainDataLastResponseId = response['rid'];
}
if (response['categories']) {
response['categories'].each(function(category) {
var categoryHash = genHash(category.name);
category_list[categoryHash] = {
name: category.name,
savePath: category.savePath,
torrents: []
};
});
for (var key in response['categories']) {
var category = response['categories'][key];
var categoryHash = genHash(key);
if (category_list[categoryHash] !== undefined) {
// only the save path can change for existing categories
category_list[categoryHash].savePath = category.savePath;
}
else {
category_list[categoryHash] = {
name: category.name,
savePath: category.savePath,
torrents: []
};
}
}
update_categories = true;
}
if (response['categories_removed']) {
response['categories_removed'].each(function(category) {
var categoryHash = genHash(category.name);
var categoryHash = genHash(category);
delete category_list[categoryHash];
});
update_categories = true;