@saooti/octopus-sdk 35.2.16 → 35.2.17

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": "@saooti/octopus-sdk",
3
- "version": "35.2.16",
3
+ "version": "35.2.17",
4
4
  "private": false,
5
5
  "description": "Javascript SDK for using octopus",
6
6
  "author": "Saooti",
@@ -156,19 +156,25 @@ export default defineComponent({
156
156
  },
157
157
  methods: {
158
158
  async fetchRecommendations(): Promise<void>{
159
- const podcastIdsArray = await octopusApi.fetchDataPublicWithParams<Array<number>>(13, 'get_predicts',{
160
- reco: this.podcastId,
161
- n_neightbors: 5,
162
- });
163
- for (let podcastIdReco of podcastIdsArray) {
164
- try {
165
- const entirePodcast = await octopusApi.fetchData<Podcast>(0, 'podcast/'+podcastIdReco);
166
- this.allPodcasts.push(entirePodcast);
167
- } catch {
168
- //If doesn't exist, do nothing
159
+ try {
160
+ const podcastIdsArray = await octopusApi.fetchDataPublicWithParams<Array<number>>(13, 'get_predicts',{
161
+ reco: this.podcastId,
162
+ n_neightbors: 5,
163
+ });
164
+ for (let podcastIdReco of podcastIdsArray) {
165
+ try {
166
+ const entirePodcast = await octopusApi.fetchData<Podcast>(0, 'podcast/'+podcastIdReco);
167
+ this.allPodcasts.push(entirePodcast);
168
+ } catch {
169
+ //If doesn't exist, do nothing
170
+ }
169
171
  }
172
+ this.totalCount = podcastIdsArray.length;
173
+ this.loading = false;
174
+ } catch {
175
+ this.allPodcasts=[];
176
+ this.totalCount = 0;
170
177
  }
171
- this.totalCount = podcastIdsArray.length;
172
178
  this.loading = false;
173
179
  },
174
180
  async fetchNext(): Promise<void> {
@@ -78,6 +78,7 @@ import { RouteLocationRaw } from 'vue-router';
78
78
  import { useFilterStore } from '@/stores/FilterStore';
79
79
  import { mapState, mapActions } from 'pinia';
80
80
  import { Rubrique } from '@/stores/class/rubrique/rubrique';
81
+ import { Rubriquage } from '@/stores/class/rubrique/rubriquage';
81
82
  export default defineComponent({
82
83
  name: 'PodcastInlineListTemplate',
83
84
 
@@ -158,13 +159,18 @@ export default defineComponent({
158
159
  nameRubrique: ''
159
160
  };
160
161
  if(this.filterRubriquage.length){
161
- const rubriqueChosen = this.filterRubriquage[this.rubriqueId.length - 1].rubriques.find((element: Rubrique) => element.rubriqueId === rubriqueChosenId);
162
- filterToAdd = {
163
- rubriquageId: this.filterRubriquage[this.rubriqueId.length - 1].rubriquageId,
164
- rubriqueId: rubriqueChosenId,
165
- nameRubriquage: this.filterRubriquage[this.rubriqueId.length - 1].title,
166
- nameRubrique: rubriqueChosen.name
167
- };
162
+ this.filterRubriquage.forEach((element:Rubriquage) => {
163
+ const rubriqueChosen = element.rubriques.find((element: Rubrique) => element.rubriqueId === rubriqueChosenId);
164
+ if(rubriqueChosen){
165
+ filterToAdd = {
166
+ rubriquageId: element.rubriquageId??0,
167
+ rubriqueId: rubriqueChosenId,
168
+ nameRubriquage: element.title,
169
+ nameRubrique: rubriqueChosen.name
170
+ };
171
+ return;
172
+ }
173
+ });
168
174
  }
169
175
  const newFilter: Array<RubriquageFilter> = Array.from(this.filterRubrique);
170
176
  newFilter.push(filterToAdd);
@@ -71,10 +71,10 @@
71
71
  :title="$t('More episodes of this emission')"
72
72
  :button-text="$t('All podcast emission button')"
73
73
  />
74
- <!-- <PodcastInlineList
74
+ <PodcastInlineList
75
75
  :podcast-id="podcastId"
76
76
  :title="$t('Suggested listening')"
77
- /> -->
77
+ />
78
78
  <PodcastInlineList
79
79
  v-for="c in categories"
80
80
  :key="c.id"