Skip to content

Commit

Permalink
fix(providers): update imports to prevent issue with typecheck
Browse files Browse the repository at this point in the history
Signed-off-by: Jordan Shatford <[email protected]>
  • Loading branch information
jordanshatford committed Dec 16, 2024
1 parent d4ab822 commit e3e27fb
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 15 deletions.
27 changes: 21 additions & 6 deletions apps/web/src/stores/__tests__/queue.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,12 @@ describe('clips.ts', () => {
const queue = useQueue()
queue.add(clipFromTwitch)
queue.add(clipFromKick)
queue.play({ id: 'not-valid', provider: ClipProvider.TWITCH, submitters: [] })
queue.play({
...clipFromTwitch,
id: 'not-valid',
provider: ClipProvider.TWITCH,
submitters: []
})
expect(queue.upcoming.toArray()).toContainEqual(clipFromTwitch)
expect(queue.upcoming.toArray()).toContainEqual(clipFromKick)
expect(queue.current).toEqual(undefined)
Expand All @@ -79,7 +84,12 @@ describe('clips.ts', () => {
queue.remove(clipFromTwitch)
expect(queue.upcoming.toArray()).not.toContainEqual(clipFromTwitch)
expect(queue.upcoming.size()).toEqual(queueLength - 1)
queue.remove({ id: 'not-valid', provider: ClipProvider.TWITCH, submitters: [] })
queue.remove({
...clipFromTwitch,
id: 'not-valid',
provider: ClipProvider.TWITCH,
submitters: []
})
expect(queue.upcoming.size()).toEqual(queueLength - 1)
})

Expand Down Expand Up @@ -173,14 +183,19 @@ describe('clips.ts', () => {
const queue = useQueue()
const settings = useSettings()
settings.queue.limit = 2
queue.add({ id: 'test', submitters: ['s'], provider: ClipProvider.TWITCH })
queue.add({ id: 'test2', submitters: ['s'], provider: ClipProvider.TWITCH })
queue.add({ id: 'test3', submitters: ['s'], provider: ClipProvider.TWITCH })
queue.add({ ...clipFromTwitch, id: 'test', submitters: ['s'], provider: ClipProvider.TWITCH })
queue.add({ ...clipFromTwitch, id: 'test2', submitters: ['s'], provider: ClipProvider.TWITCH })
queue.add({ ...clipFromTwitch, id: 'test3', submitters: ['s'], provider: ClipProvider.TWITCH })
expect(queue.upcoming.size()).toEqual(2)
})

it('adds clips that are already there (even when full) to update submitters', () => {
const clip: Clip = { id: 'test', submitters: ['testsubmitter'], provider: ClipProvider.TWITCH }
const clip: Clip = {
...clipFromTwitch,
id: 'test',
submitters: ['testsubmitter'],
provider: ClipProvider.TWITCH
}
const queue = useQueue()
const settings = useSettings()
settings.queue.limit = 1
Expand Down
3 changes: 2 additions & 1 deletion packages/providers/src/kick.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import kick from '@cq/services/kick'

import { BaseClipProvider, Clip, ClipProvider, PlayerFormat } from './types'
import type { Clip, PlayerFormat } from './types'
import { BaseClipProvider, ClipProvider } from './types'

export class KickProvider extends BaseClipProvider {
public name = ClipProvider.KICK
Expand Down
9 changes: 2 additions & 7 deletions packages/providers/src/twitch.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import twitch from '@cq/services/twitch'

import {
BaseClipProvider,
Clip,
ClipProvider,
ClipProviderCtxCallback,
PlayerFormat
} from './types'
import type { Clip, ClipProviderCtxCallback, PlayerFormat } from './types'
import { BaseClipProvider, ClipProvider } from './types'

export class TwitchProvider extends BaseClipProvider {
public name = ClipProvider.TWITCH
Expand Down
3 changes: 2 additions & 1 deletion packages/providers/src/youtube.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import youtube from '@cq/services/youtube'

import { BaseClipProvider, Clip, ClipProvider, PlayerFormat } from './types'
import type { Clip, PlayerFormat } from './types'
import { BaseClipProvider, ClipProvider } from './types'

export class YouTubeProvider extends BaseClipProvider {
public name = ClipProvider.YOUTUBE
Expand Down

0 comments on commit e3e27fb

Please sign in to comment.