mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-08-14 23:57:27 +00:00
Use more consise logic
This commit is contained in:
parent
ba17bf39bd
commit
c2f49fd92e
1 changed files with 2 additions and 15 deletions
|
@ -636,21 +636,8 @@ export default {
|
|||
const start = (segment.segment[0] / this.video.duration) * 100;
|
||||
const end = (segment.segment[1] / this.video.duration) * 100;
|
||||
|
||||
var color;
|
||||
switch (segment.category) {
|
||||
case "sponsor":
|
||||
case "selfpromo":
|
||||
case "interaction":
|
||||
case "poi_highlight":
|
||||
case "intro":
|
||||
case "outro":
|
||||
case "preview":
|
||||
case "filler":
|
||||
case "music_offtopic":
|
||||
color = "var(--spon-seg-${segment.category})"
|
||||
default:
|
||||
color = "var(--spon-seg-default)";
|
||||
}
|
||||
var color = ["sponsor", "selfpromo", "interaction", "poi_highlight", "intro", "outro", "preview", "filler", "music_offtopic", ].includes(segment.category) ? "var(--spon-seg-${segment.category})" : "var(--spon-seg-default)";
|
||||
|
||||
|
||||
array.push(`transparent ${start}%`);
|
||||
array.push(`${color} ${start}%`);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue