@playpilot/tpi 8.21.2 → 8.21.4
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.21.
|
|
3
|
+
"version": "8.21.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "vite dev",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"release": "node release.js"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@playpilot/retargeting-tracking": "^1.
|
|
19
|
+
"@playpilot/retargeting-tracking": "^1.4.0",
|
|
20
20
|
"@sveltejs/adapter-auto": "^7.0.1",
|
|
21
21
|
"@sveltejs/kit": "^2.56.1",
|
|
22
22
|
"@sveltejs/vite-plugin-svelte": "^4.0.0",
|
package/src/routes/+page.svelte
CHANGED
|
@@ -92,10 +92,10 @@
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
try {
|
|
95
|
-
[response] = (await Promise.
|
|
95
|
+
[response] = (await Promise.all([
|
|
96
96
|
await (window.PlayPilotLinkInjections.initial_link_injections_promise || pollLinkInjections({ maxTries: 1, runAiWhenRelevant: !isCrawler() })),
|
|
97
97
|
await getRegionBasedOnIp(),
|
|
98
|
-
]))
|
|
98
|
+
])) as [LinkInjectionResponse | null, string]
|
|
99
99
|
|
|
100
100
|
loading = false
|
|
101
101
|
|
|
@@ -14,8 +14,6 @@
|
|
|
14
14
|
|
|
15
15
|
const { linkInjections }: Props = $props()
|
|
16
16
|
|
|
17
|
-
const previouslyTrackingTitles: string[] = []
|
|
18
|
-
|
|
19
17
|
onMount(() => {
|
|
20
18
|
if (!isPixelAllowed()) return
|
|
21
19
|
|
|
@@ -30,7 +28,6 @@
|
|
|
30
28
|
const title = matchingInjection?.title_details
|
|
31
29
|
|
|
32
30
|
if (!key || !matchingInjection || !title) return
|
|
33
|
-
if (previouslyTrackingTitles.includes(title.sid)) return
|
|
34
31
|
|
|
35
32
|
trackPixelsForTitle(title)
|
|
36
33
|
})
|
|
@@ -43,9 +40,7 @@
|
|
|
43
40
|
return () => observer.disconnect()
|
|
44
41
|
})
|
|
45
42
|
|
|
46
|
-
function trackPixelsForTitle({
|
|
47
|
-
previouslyTrackingTitles.push(sid)
|
|
48
|
-
|
|
43
|
+
function trackPixelsForTitle({ genres, participants, providers, title }: TitleData): void {
|
|
49
44
|
trackViaPixel(MetaEvent.TitleInterest, { title, source: MetaSource.Link })
|
|
50
45
|
|
|
51
46
|
genres.slice(0, 3).forEach(genre => {
|