diff --git a/src/features/MatchPage/components/FinishedMatch/helpers.tsx b/src/features/MatchPage/components/FinishedMatch/helpers.tsx deleted file mode 100644 index 9639a342..00000000 --- a/src/features/MatchPage/components/FinishedMatch/helpers.tsx +++ /dev/null @@ -1,137 +0,0 @@ -import map from 'lodash/map' -import last from 'lodash/last' -import uniq from 'lodash/uniq' -import filter from 'lodash/filter' -import reduce from 'lodash/reduce' -import concat from 'lodash/concat' -import orderBy from 'lodash/orderBy' -import isEmpty from 'lodash/isEmpty' -import groupBy from 'lodash/groupBy' - -import type { - Videos, - Episodes, - Episode, -} from 'requests' - -import type { Chapters, Urls } from 'features/MultiSourcePlayer/types' - -import type { PlaylistOption } from '../../types' -import { FULL_GAME_KEY } from '../../helpers/buildPlaylists' - -const getUniquePeriods = (videos: Videos) => uniq(map(videos, ({ period }) => period)) - -type Video = { - duration: number, - period: number, - urls: Urls, -} - -const getVideoByPeriod = (videos: Videos, period: number) => { - const videosWithSamePeriod = filter(videos, { period }) - if (isEmpty(videosWithSamePeriod)) return null - - const urls = reduce( - videosWithSamePeriod, - (acc: Urls, video) => ({ - ...acc, - [video.quality]: video.url, - }), - {}, - ) - const [video] = videosWithSamePeriod - return { - duration: video.duration, - period: video.period, - urls, - } -} - -const getVideoByPeriods = (videos: Videos, periods: Array) => ( - reduce( - periods, - (acc: Array