Suggested fixes.
This commit is contained in:
parent
75fa42dc83
commit
4b4d96ff75
1 changed files with 12 additions and 8 deletions
|
@ -222,14 +222,14 @@ export function Player({ id }: { id: number }) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var channel_duration: number = 0;
|
let channelDuration = 0;
|
||||||
var channel_unplayed: number = 0;
|
let channelUnplayed = 0;
|
||||||
const plan = useSelector((state: RootState) => state.showplan.plan);
|
const plan = useSelector((state: RootState) => state.showplan.plan);
|
||||||
plan?.forEach((pItem) => {
|
plan?.forEach((pItem) => {
|
||||||
if (pItem.channel === id) {
|
if (pItem.channel === id) {
|
||||||
channel_duration += HHMMTosec(pItem.length);
|
channelDuration += HHMMTosec(pItem.length);
|
||||||
if (!pItem.played) {
|
if (!pItem.played) {
|
||||||
channel_unplayed += HHMMTosec(pItem.length);
|
channelUnplayed += HHMMTosec(pItem.length);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -243,10 +243,14 @@ export function Player({ id }: { id: number }) {
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<div className="card text-center">
|
<div className="card text-center">
|
||||||
<span>
|
<div className="d-inline mx-1">
|
||||||
Total: {secToHHMM(channel_duration)} <strong>-</strong>
|
<span className="float-left">
|
||||||
Un-played: {secToHHMM(channel_unplayed)}
|
Total: {secToHHMM(channelDuration)}
|
||||||
</span>
|
</span>
|
||||||
|
<span className="float-right">
|
||||||
|
Unplayed: {secToHHMM(channelUnplayed)}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
<div className="row m-0 p-1 card-header channelButtons hover-menu">
|
<div className="row m-0 p-1 card-header channelButtons hover-menu">
|
||||||
<span className="hover-label">Channel Controls</span>
|
<span className="hover-label">Channel Controls</span>
|
||||||
<button
|
<button
|
||||||
|
|
Loading…
Reference in a new issue