Skip to content

Commit

Permalink
Fix linter issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mrlika committed Sep 26, 2024
1 parent 27adef8 commit cf2da6d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ export class ManifestParserDecorator implements shaka.extern.ManifestParser {

// For version 4.2; Retrieving mediaSequence map for each HLS playlist
const manifestVariantsMap = maps.find((map) => {
const item = map.values().next().value as unknown;
const item = map.values().next().value;

return (
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access
Expand All @@ -237,8 +237,7 @@ export class ManifestParserDecorator implements shaka.extern.ManifestParser {
const mediaSequenceTimeMap = getMapPropertiesFromObject(
variant as Record<string, unknown>,
).find((map) => {
const [key, value] =
(map.entries().next().value as [unknown, unknown] | undefined) ?? [];
const [key, value] = map.entries().next().value ?? [];
return typeof key === "number" && typeof value === "number";
});

Expand Down
6 changes: 2 additions & 4 deletions packages/p2p-media-loader-shaka/src/stream-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,12 @@ export function getSegmentInfoFromReference(
};
}

export function getStreamLastMediaSequence(
stream: StreamWithReadonlySegments,
): number | undefined {
export function getStreamLastMediaSequence(stream: StreamWithReadonlySegments) {
const { shakaStream } = stream;
const map = shakaStream.mediaSequenceTimeMap;
if (!map) return;

const firstMediaSequence = map.keys().next().value as number | undefined;
const firstMediaSequence = map.keys().next().value;
if (firstMediaSequence === undefined) return;
return firstMediaSequence + map.size - 1;
}

0 comments on commit cf2da6d

Please sign in to comment.