Now both Media and Media.Part in the JSON object about a stream is a list and need to index the first element of the stream to get this info.
This commit is contained in:
@@ -5,11 +5,13 @@ const convertStreamToUser = require('src/plex/stream/convertStreamToUser');
|
|||||||
const ConvertStreamToPlayback = require('src/plex/stream/convertStreamToPlayback');
|
const ConvertStreamToPlayback = require('src/plex/stream/convertStreamToPlayback');
|
||||||
|
|
||||||
function convertPlexToStream(plexStream) {
|
function convertPlexToStream(plexStream) {
|
||||||
const stream = convertPlexToSeasoned(plexStream);
|
const stream = convertPlexToSeasoned(plexStream)
|
||||||
stream.mediaInfo = convertStreamToMediaInfo(plexStream.Media);
|
const plexStreamMedia = plexStream.Media[0]
|
||||||
|
stream.mediaInfo = convertStreamToMediaInfo(plexStreamMedia);
|
||||||
stream.player = convertStreamToPlayer(plexStream.Player);
|
stream.player = convertStreamToPlayer(plexStream.Player);
|
||||||
|
|
||||||
stream.user = convertStreamToUser(plexStream.User);
|
stream.user = convertStreamToUser(plexStream.User);
|
||||||
stream.playback = new ConvertStreamToPlayback(plexStream.Media.Part);
|
stream.playback = new ConvertStreamToPlayback(plexStreamMedia.Part[0]);
|
||||||
|
|
||||||
return stream;
|
return stream;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ function convertStreamToMediaInfo(plexStream) {
|
|||||||
mediaInfo.container = plexStream.container;
|
mediaInfo.container = plexStream.container;
|
||||||
mediaInfo.audioCodec = plexStream.audioCodec;
|
mediaInfo.audioCodec = plexStream.audioCodec;
|
||||||
|
|
||||||
|
console.log(mediaInfo)
|
||||||
|
|
||||||
return mediaInfo;
|
return mediaInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user