Properly decrement viewer count when RTMP viewers quit

develop
knotteye 2021-02-21 13:16:33 -06:00
parent 90f3c31ffb
commit 53aa632da4
1 changed files with 1 additions and 1 deletions

View File

@ -130,7 +130,7 @@ function init () {
let app: string = StreamPath.split("/")[1];
let key: string = StreamPath.split("/")[2];
// decrement viewer count
db.query('update user_meta,users set user_meta.viewers = user_meta.viewers - 1 where users.stream_key='+db.raw.escape(key));
db.query('update user_meta set viewers = viewers - 1 where username=(select username from users where stream_key='+db.raw.escape(key)+' limit 1)');
});
}