Merge pull request #9228 from Piccirello/addCategory

Add save path and category editing to WebUI
This commit is contained in:
Vladimir Golovnev 2018-09-13 19:43:28 +03:00 committed by GitHub
commit 28a6ac3197
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 199 additions and 65 deletions

View file

@ -327,13 +327,21 @@ window.addEvent('load', function() {
syncMainDataLastResponseId = response['rid'];
}
if (response['categories']) {
response['categories'].each(function(category) {
var categoryHash = genHash(category);
category_list[categoryHash] = {
name: category,
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']) {