Classes for holding info from different parts of a plex stream
This commit is contained in:
10
src/plex/stream/convertStreamToPlayback.js
Normal file
10
src/plex/stream/convertStreamToPlayback.js
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
class convertStreamToPlayback {
|
||||||
|
constructor(plexStream) {
|
||||||
|
this.bitrate = plexStream.bitrate;
|
||||||
|
this.width = plexStream.width;
|
||||||
|
this.height = plexStream.height;
|
||||||
|
this.decision = plexStream.decision;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = convertStreamToPlayback;
|
||||||
13
src/plex/stream/convertStreamToPlayer.js
Normal file
13
src/plex/stream/convertStreamToPlayer.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
const Player = require('src/media_classes/player');
|
||||||
|
|
||||||
|
function convertStreamToPlayer(plexStream) {
|
||||||
|
const player = new Player(plexStream.device, plexStream.address);
|
||||||
|
player.platform = plexStream.platform;
|
||||||
|
player.product = plexStream.product;
|
||||||
|
player.title = plexStream.title;
|
||||||
|
player.state = plexStream.state;
|
||||||
|
|
||||||
|
return player;
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = convertStreamToPlayer;
|
||||||
7
src/plex/stream/convertStreamToUser.js
Normal file
7
src/plex/stream/convertStreamToUser.js
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
const User = require('src/media_classes/user');
|
||||||
|
|
||||||
|
function convertStreamToUser(plexStream) {
|
||||||
|
return new User(plexStream.id, plexStream.title);
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = convertStreamToUser;
|
||||||
Reference in New Issue
Block a user