diff --git a/scripts/commands/database/cleanup.js b/scripts/commands/database/cleanup.js index ede11d701e..5b23f52332 100644 --- a/scripts/commands/database/cleanup.js +++ b/scripts/commands/database/cleanup.js @@ -9,12 +9,12 @@ async function main() { let removed = 0 const buffer = {} for (const stream of streams) { - const duplicate = buffer[stream.channel_id] - if (duplicate && ['offline', 'timeout'].includes(stream.status.code)) { + const duplicate = buffer[stream.channel] + if (duplicate && !stream.is_online) { await db.streams.remove({ _id: stream._id }) removed++ } else { - buffer[stream.channel_id] = stream + buffer[stream.channel] = stream } } db.streams.compact()