mirror of
https://github.com/morpheus65535/bazarr
synced 2025-01-22 06:48:45 +00:00
Added series empty subtitle episodes progress bar labels (#2575)
This commit is contained in:
parent
ebf3471eec
commit
03f0bdbe39
1 changed files with 20 additions and 11 deletions
|
@ -65,25 +65,34 @@ const SeriesView: FunctionComponent = () => {
|
|||
cell: (row) => {
|
||||
const { episodeFileCount, episodeMissingCount, profileId, title } =
|
||||
row.row.original;
|
||||
let progress = 0;
|
||||
let label = "";
|
||||
if (episodeFileCount === 0 || !profileId) {
|
||||
progress = 0.0;
|
||||
} else {
|
||||
progress = (1.0 - episodeMissingCount / episodeFileCount) * 100.0;
|
||||
label = `${
|
||||
episodeFileCount - episodeMissingCount
|
||||
}/${episodeFileCount}`;
|
||||
}
|
||||
|
||||
const label = `${episodeFileCount - episodeMissingCount}/${episodeFileCount}`;
|
||||
return (
|
||||
<Progress.Root key={title} size="xl">
|
||||
<Progress.Section
|
||||
value={progress}
|
||||
value={
|
||||
episodeFileCount === 0 || !profileId
|
||||
? 0
|
||||
: (1.0 - episodeMissingCount / episodeFileCount) * 100.0
|
||||
}
|
||||
color={episodeMissingCount === 0 ? "brand" : "yellow"}
|
||||
>
|
||||
<Progress.Label>{label}</Progress.Label>
|
||||
</Progress.Section>
|
||||
{episodeMissingCount === episodeFileCount && (
|
||||
<Progress.Label
|
||||
styles={{
|
||||
label: {
|
||||
position: "absolute",
|
||||
top: "3px",
|
||||
left: "50%",
|
||||
transform: "translateX(-50%)",
|
||||
},
|
||||
}}
|
||||
>
|
||||
{label}
|
||||
</Progress.Label>
|
||||
)}
|
||||
</Progress.Root>
|
||||
);
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue