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
12 changed files with 199 additions and 65 deletions

View File

@@ -1210,12 +1210,8 @@ void TorrentHandle::setName(const QString &name)
bool TorrentHandle::setCategory(const QString &category)
{
if (m_category != category) {
if (!category.isEmpty()) {
if (!Session::isValidCategoryName(category)) return false;
if (!m_session->categories().contains(category))
if (!m_session->addCategory(category))
return false;
}
if (!category.isEmpty() && !m_session->categories().contains(category))
return false;
QString oldCategory = m_category;
m_category = category;