@saooti/octopus-sdk 35.2.16 → 35.2.18

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.18",
4
4
  "private": false,
5
5
  "description": "Javascript SDK for using octopus",
6
6
  "author": "Saooti",
@@ -244,7 +244,7 @@ export default defineComponent({
244
244
  if (
245
245
  undefined !== this.podcast &&(
246
246
  (this.playerPodcast?.podcastId ===this.podcast.podcastId) ||
247
- (this.playerLive?.livePodcastId ===this.podcast.podcastId))
247
+ (this.playerLive?.podcastId ===this.podcast.podcastId))
248
248
  ) {
249
249
  timeline = Math.round(
250
250
  this.playerElapsed * this.playerTotal
@@ -259,14 +259,7 @@ export default defineComponent({
259
259
  if (!this.recordingLive) {
260
260
  this.playerPlay(this.podcast);
261
261
  }else{
262
- this.playerPlay({
263
- title: this.podcast.title,
264
- audioUrl: this.podcast.audioUrl,
265
- duration: this.podcast.duration,
266
- conferenceId: this.fetchConference?.conferenceId,
267
- livePodcastId: this.podcast.podcastId,
268
- organisation: this.podcast.organisation,
269
- });
262
+ this.playerPlay({...this.podcast, ...{conferenceId:this.fetchConference?.conferenceId}});
270
263
  }
271
264
  if(this.clickPlayGoPage){
272
265
  this.$router.push('/main/pub/podcast/'+this.podcast.podcastId);
@@ -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);
@@ -70,7 +70,7 @@ export const playerComment = defineComponent({
70
70
  podcastId = this.playerPodcast.podcastId;
71
71
  organisation = this.playerPodcast.organisation.id;
72
72
  } else if (this.playerLive) {
73
- podcastId = this.playerLive.livePodcastId;
73
+ podcastId = this.playerLive.podcastId;
74
74
  organisation = this.playerLive.organisation.id;
75
75
  }
76
76
  if (
@@ -64,8 +64,8 @@ export const playerLive = defineComponent({
64
64
  if(!this.playerLive){ return;}
65
65
  let downloadId = null;
66
66
  try {
67
- downloadId = await octopusApi.putDataPublic<string | null>(0, 'podcast/prepare/live/'+this.playerLive.livePodcastId, undefined);
68
- await octopusApi.fetchDataPublicWithParams<string | null>(0,'podcast/download/live/' + this.playerLive.livePodcastId+".m3u8",{
67
+ downloadId = await octopusApi.putDataPublic<string | null>(0, 'podcast/prepare/live/'+this.playerLive.podcastId, undefined);
68
+ await octopusApi.fetchDataPublicWithParams<string | null>(0,'podcast/download/live/' +this.playerLive.podcastId +".m3u8",{
69
69
  'downloadId': null!==downloadId ? downloadId : undefined,
70
70
  'origin':'octopus',
71
71
  'distributorId':this.authOrgaId
@@ -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"
@@ -39,7 +39,6 @@ export interface Podcast {
39
39
  title: string;
40
40
  weekDownloadCount?: number;
41
41
  order?: number;
42
- livePodcastId?: number
43
42
  }
44
43
  export function emptyPodcastData(): Podcast {
45
44
  return {