@saooti/octopus-sdk 41.1.5 → 41.1.6

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 41.1.6 (10/12/2025)
4
+
5
+ **Fixes**
6
+
7
+ - `playlistApi.getContentFull` ne récupère chaque émission & organisation qu'une
8
+ seule fois
9
+
3
10
  ## 41.1.5 (10/12/2025)
4
11
 
5
12
  **Misc**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saooti/octopus-sdk",
3
- "version": "41.1.5",
3
+ "version": "41.1.6",
4
4
  "private": false,
5
5
  "description": "Javascript SDK for using octopus",
6
6
  "author": "Saooti",
@@ -29,6 +29,10 @@ async function getContent(playlistId: number): Promise<Array<SimplifiedPodcast>>
29
29
  });
30
30
  }
31
31
 
32
+ function unique<T>(value: T, index: number, array: Array<T>): boolean {
33
+ return array.indexOf(value) === index;
34
+ }
35
+
32
36
  /**
33
37
  * Retrieve the podcasts defined in the playlist, with all their data
34
38
  * This query is longer, because it also needs to retrieve organisations &
@@ -40,10 +44,10 @@ async function getContentFull(playlistId: number): Promise<Array<Podcast>> {
40
44
  const simplified = await this.getContent(playlistId);
41
45
  const full: Array<Podcast> = [];
42
46
 
43
- // TODO unique
44
- const organisationIds = simplified.map((p: SimplifiedPodcast) => p.organisationId);
45
- // TODO unique
46
- const emissionIds = simplified.map((p: SimplifiedPodcast) => p.emissionId);
47
+ const organisationIds = simplified.map((p: SimplifiedPodcast) => p.organisationId)
48
+ .filter(unique);
49
+ const emissionIds = simplified.map((p: SimplifiedPodcast) => p.emissionId)
50
+ .filter(unique);
47
51
 
48
52
  const organisations = await organisationApi.getAllById(organisationIds);
49
53
  const emissions = await emissionApi.getAllById(emissionIds);