mirror of
https://github.com/BreizhHardware/Jellystat.git
synced 2026-01-18 16:27:20 +01:00
Cleaned up Audio section for audio type media. Added Artist name to session card.
This commit is contained in:
@@ -122,16 +122,22 @@ function SessionCard(props) {
|
||||
</Col>
|
||||
</Row>
|
||||
<Row className="d-flex flex-column flex-md-row">
|
||||
{props.data.session.NowPlayingItem.VideoStream !== "" &&
|
||||
<Col className="col-auto ellipse">
|
||||
<span>{props.data.session.NowPlayingItem.VideoStream}</span>
|
||||
</Col>
|
||||
}
|
||||
<Col className="col-auto ellipse">
|
||||
<span>{props.data.session.NowPlayingItem.VideoStream}</span>
|
||||
{props.data.session.NowPlayingItem.AudioStream !== "" &&
|
||||
<span>{props.data.session.NowPlayingItem.AudioStream}</span>
|
||||
}
|
||||
</Col>
|
||||
<Col className="col-auto ellipse">
|
||||
<span>{props.data.session.NowPlayingItem.AudioStream}</span>
|
||||
</Col>
|
||||
<Col className="col-auto ellipse">
|
||||
<Tooltip title={props.data.session.NowPlayingItem.SubtitleStream}>
|
||||
<span>{props.data.session.NowPlayingItem.SubtitleStream}</span>
|
||||
</Tooltip>
|
||||
{props.data.session.NowPlayingItem.SubtitleStream !== "" &&
|
||||
<Tooltip title={props.data.session.NowPlayingItem.SubtitleStream}>
|
||||
<span>{props.data.session.NowPlayingItem.SubtitleStream}</span>
|
||||
</Tooltip>
|
||||
}
|
||||
</Col>
|
||||
</Row>
|
||||
<Row>
|
||||
@@ -185,7 +191,14 @@ function SessionCard(props) {
|
||||
</Link>
|
||||
</Card.Text>
|
||||
</Row>
|
||||
) : (
|
||||
) : (props.data.session.NowPlayingItem.Type === "Audio" && props.data.session.NowPlayingItem.Artists.length > 0) ? (
|
||||
<Col className="col-auto p-0">
|
||||
<Card.Text>
|
||||
{props.data.session.NowPlayingItem.Artists[0]}
|
||||
</Card.Text>
|
||||
</Col>
|
||||
) :
|
||||
(
|
||||
<></>
|
||||
)}
|
||||
<Row className="d-flex flex-row justify-content-between p-0 m-0">
|
||||
|
||||
@@ -79,11 +79,10 @@ function Sessions() {
|
||||
}
|
||||
|
||||
const getAudioStream = (row) => {
|
||||
let result = "";
|
||||
|
||||
let mediaTypeAudio = row.NowPlayingItem.Type === 'Audio';
|
||||
let streamIndex = row.PlayState.AudioStreamIndex;
|
||||
if (streamIndex === undefined || streamIndex === -1) {
|
||||
return result;
|
||||
if ((streamIndex === undefined || streamIndex === -1) && !mediaTypeAudio) {
|
||||
return "";
|
||||
}
|
||||
|
||||
let transcodeType = "Direct Stream";
|
||||
@@ -93,12 +92,24 @@ function Sessions() {
|
||||
transcodeCodec = ` -> ${row.TranscodingInfo.AudioCodec.toUpperCase()}`;
|
||||
}
|
||||
|
||||
let originalCodec = "";
|
||||
if (row.NowPlayingItem.MediaStreams && row.NowPlayingItem.MediaStreams.length && streamIndex < row.NowPlayingItem.MediaStreams.length) {
|
||||
originalCodec = row.NowPlayingItem.MediaStreams[streamIndex].Codec.toUpperCase();
|
||||
let bitRate = "";
|
||||
if (mediaTypeAudio) {
|
||||
bitRate = " - " + convertBitrate(
|
||||
row.TranscodingInfo
|
||||
? row.TranscodingInfo.Bitrate
|
||||
: row.NowPlayingItem.Bitrate);
|
||||
}
|
||||
|
||||
return originalCodec != "" ? `Audio: ${transcodeType} (${originalCodec}${transcodeCodec})`
|
||||
let originalCodec = "";
|
||||
if (mediaTypeAudio){
|
||||
|
||||
originalCodec = `${row.NowPlayingItem.Container.toUpperCase()}`;
|
||||
}
|
||||
else if (row.NowPlayingItem.MediaStreams && row.NowPlayingItem.MediaStreams.length && streamIndex < row.NowPlayingItem.MediaStreams.length) {
|
||||
originalCodec = row.NowPlayingItem.MediaStreams[streamIndex].Codec.toUpperCase();
|
||||
}
|
||||
|
||||
return originalCodec != "" ? `Audio: ${transcodeType} (${originalCodec}${transcodeCodec}${bitRate})`
|
||||
: `Audio: ${transcodeType}`;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user