Properly decrement viewer count when RTMP viewers quit
parent
90f3c31ffb
commit
53aa632da4
|
@ -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)');
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Reference in New Issue