Don't store useless data in db
This commit is contained in:
parent
6ab1adfe5b
commit
533566fde8
|
@ -69,11 +69,9 @@ export default new class EmoteModule extends BuiltinModule {
|
||||||
} else {
|
} else {
|
||||||
this.mostUsed.push({
|
this.mostUsed.push({
|
||||||
key: emote.name,
|
key: emote.name,
|
||||||
useCount: 1,
|
id: emote.id,
|
||||||
value: {
|
type: emote.type,
|
||||||
src: EMOTE_SOURCES[emote.type].replace(':id', emote.id),
|
useCount: 1
|
||||||
replaceWith: `;${emote.name};`
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
Database.insertOrUpdate({ 'id': 'EmoteModule' }, { 'id': 'EmoteModule', favourites: this.favourites, mostused: this.mostUsed })
|
Database.insertOrUpdate({ 'id': 'EmoteModule' }, { 'id': 'EmoteModule', favourites: this.favourites, mostused: this.mostUsed })
|
||||||
|
@ -229,7 +227,10 @@ export default new class EmoteModule extends BuiltinModule {
|
||||||
items: this.mostUsed.sort((a,b) => b.useCount - a.useCount).slice(0, 10).map(mu => {
|
items: this.mostUsed.sort((a,b) => b.useCount - a.useCount).slice(0, 10).map(mu => {
|
||||||
return {
|
return {
|
||||||
key: `${mu.key} | ${mu.useCount}`,
|
key: `${mu.key} | ${mu.useCount}`,
|
||||||
value: mu.value
|
value: {
|
||||||
|
src: EMOTE_SOURCES[mu.type].replace(':id', mu.id),
|
||||||
|
replaceWith: `;${mu.key};`
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue