@playpilot/tpi 8.36.0-beta.1 → 8.36.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playpilot/tpi",
3
- "version": "8.36.0-beta.1",
3
+ "version": "8.36.1",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
@@ -256,6 +256,11 @@ export const translations = {
256
256
  [Language.Swedish]: 'Toppbetyg',
257
257
  [Language.Danish]: 'Højst vurderet',
258
258
  },
259
+ 'IMDb Rating': {
260
+ [Language.English]: 'IMDb Rating',
261
+ [Language.Swedish]: 'IMDb-betyg',
262
+ [Language.Danish]: 'IMDb-vurdering',
263
+ },
259
264
  '-popularity': {
260
265
  [Language.English]: 'Popularity',
261
266
  [Language.Swedish]: 'Popularitet',
@@ -271,6 +276,11 @@ export const translations = {
271
276
  [Language.Swedish]: 'Toppbetyg',
272
277
  [Language.Danish]: 'Højst vurderet',
273
278
  },
279
+ '-imdb_score': {
280
+ [Language.English]: 'IMDb Rating',
281
+ [Language.Swedish]: 'IMDb-betyg',
282
+ [Language.Danish]: 'IMDb-vurdering',
283
+ },
274
284
  'Search': {
275
285
  [Language.English]: 'Search',
276
286
  [Language.Swedish]: 'Sök',
@@ -3,4 +3,5 @@ export const Sorting = Object.freeze({
3
3
  New: '-new',
4
4
  Best: '-best',
5
5
  Chronological: '-year',
6
+ IMDb: '-imdb_score',
6
7
  })
@@ -20,6 +20,7 @@
20
20
  { label: 'Popularity', value: Sorting.Popular },
21
21
  { label: 'New', value: Sorting.New },
22
22
  { label: 'Top Rated', value: Sorting.Best },
23
+ { label: 'IMDb Rating', value: Sorting.IMDb },
23
24
  ])
24
25
 
25
26
  const label = $derived(options.find(({ value }) => value === filter[param]?.value)?.label || 'Sort By')
@@ -41,7 +42,7 @@
41
42
  {/snippet}
42
43
 
43
44
  {#snippet content()}
44
- <div class="content" data-testid="content">
45
+ <div data-testid="content">
45
46
  {#each options as { label, value }}
46
47
  {@const active = value === filter[param]?.value}
47
48
  <button class="option" class:active onclick={() => setFilter(value)}>{t(label)}</button>
@@ -51,10 +52,6 @@
51
52
  </Dropdown>
52
53
 
53
54
  <style lang="scss">
54
- .content {
55
- width: margin(7);
56
- }
57
-
58
55
  .option {
59
56
  appearance: none;
60
57
  padding: margin(0.75) margin(1);
@@ -65,6 +62,7 @@
65
62
  font-family: inherit;
66
63
  font-size: inherit;
67
64
  color: theme(text-color-alt);
65
+ white-space: nowrap;
68
66
  cursor: pointer;
69
67
 
70
68
  &:hover,
@@ -27,6 +27,7 @@
27
27
  const sortings: ExploreTitleSorting[] = [
28
28
  { label: 'Popularity', value: Sorting.Popular },
29
29
  { label: 'Top Rated', value: Sorting.Best },
30
+ { label: 'IMDb Rating', value: Sorting.IMDb },
30
31
  { label: 'Year', value: Sorting.Chronological },
31
32
  ]
32
33
 
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import { fetchParticipantsForTitle } from '$lib/api/participants'
2
+ import { fetchParticipantBySid, fetchParticipantsForTitle } from '$lib/api/participants'
3
3
  import { TrackingEvent } from '$lib/enums/TrackingEvent'
4
4
  import { getLinkInjectionElements, getLinkInjectionsParentElement, getPageText } from '$lib/injectionElements'
5
5
  import { t } from '$lib/localization'
@@ -42,11 +42,13 @@
42
42
  return participantsSortedByCount.map(({ participant }) => participant)
43
43
  }
44
44
 
45
- function onclick(event: MouseEvent, participant: ParticipantData): void {
45
+ async function onclick(event: MouseEvent, participant: ParticipantData): Promise<void> {
46
46
  track(TrackingEvent.ParticipantClick, null, { title_source: title.original_title || title.title, participant: participant.name })
47
47
 
48
48
  if (!window.PlayPilotLinkInjections?.config?.open_tpi_links_in_explore || window.location.href.includes(window.PlayPilotLinkInjections.config.explore_navigation_path || '')) {
49
- openModal({ event, type: 'participant', data: participant })
49
+ const fetchedParticipant = await fetchParticipantBySid(participant.sid)
50
+
51
+ openModal({ event, type: 'participant', data: fetchedParticipant })
50
52
  return
51
53
  }
52
54