mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +00:00
get public streams methods
This commit is contained in:
parent
2f717a179e
commit
5cb5f85b45
@ -1,3 +1,5 @@
|
||||
import lodash from "lodash"
|
||||
|
||||
export default class SessionsManager {
|
||||
constructor() {
|
||||
this.sessions = {}
|
||||
@ -26,7 +28,18 @@ export default class SessionsManager {
|
||||
this.publicStreams.push(payload)
|
||||
}
|
||||
|
||||
unpublishStream = (id) => {
|
||||
this.publicStreams = this.publicStreams.filter(stream => stream.id !== id)
|
||||
unpublishStream = (stream_key) => {
|
||||
this.publicStreams = this.publicStreams.filter(stream => stream.stream_key !== stream_key)
|
||||
}
|
||||
|
||||
getPublicStreams = () => {
|
||||
// return this.publicStreams but without stream_key property
|
||||
return lodash.map(this.publicStreams, stream => {
|
||||
return lodash.omit(stream, "stream_key")
|
||||
})
|
||||
}
|
||||
|
||||
getStreamsByUserId = (user_id) => {
|
||||
return lodash.filter(this.publicStreams, stream => stream.user_id === user_id)
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user