|
|
|
@ -90,6 +90,15 @@ module.exports = function (Topics) {
|
|
|
|
|
}
|
|
|
|
|
newTagName = utils.cleanUpTag(newTagName, meta.config.maximumTagLength);
|
|
|
|
|
await Topics.createEmptyTag(newTagName);
|
|
|
|
|
const targetExists = await db.isSortedSetMember('tags:topic:count', newTagName);
|
|
|
|
|
const tagData = await db.getObject('tag:' + tag);
|
|
|
|
|
if (tagData && !targetExists) {
|
|
|
|
|
await db.setObject('tag:' + newTagName, {
|
|
|
|
|
color: tagData.color,
|
|
|
|
|
bgColor: tagData.bgColor,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await batch.processSortedSet('tag:' + tag + ':topics', async function (tids) {
|
|
|
|
|
const scores = await db.sortedSetScores('tag:' + tag + ':topics', tids);
|
|
|
|
|
await db.sortedSetAdd('tag:' + newTagName + ':topics', scores, tids);
|
|
|
|
|