Skip to content

Commit

Permalink
Changed method of checking array
Browse files Browse the repository at this point in the history
Instead of converting it, we now just check if it's an array and then uses .includes()
  • Loading branch information
edvinhed committed Jul 4, 2024
1 parent 62badad commit 0ace110
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/manifests/utils/configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,19 @@ export const corruptorConfigUtils = function (
}

// If bitrate is set, filter out segments that doesn't match
params = params.filter(
(config) =>
params = params.filter((config) => {
if (
!config?.br ||
config?.br === '*' ||
config?.br.toString().includes(segmentBitrate.toString()) //Checks if .br contains bitrates that need to be filtered
);
config?.br === segmentBitrate
) {
return true;
} else if (Array.isArray(config?.br)) {
return config?.br.includes(segmentBitrate);
} else {
return false;
}
});

// Replace relative sequence numbers with absolute ones
params = params.map((param) => {
Expand Down

0 comments on commit 0ace110

Please sign in to comment.