@saooti/octopus-sdk 41.0.8 → 41.0.9

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": "41.0.8",
3
+ "version": "41.0.9",
4
4
  "private": false,
5
5
  "description": "Javascript SDK for using octopus",
6
6
  "author": "Saooti",
@@ -2,17 +2,19 @@ import classicApi from "../../../api/classicApi";
2
2
  import { MediaRadio, MetadataRadio, NextAdvertising } from '@/stores/class/general/player';
3
3
  import { Podcast } from '@/stores/class/general/podcast';
4
4
  import dayjs from 'dayjs';
5
- import radioHelper from "../../../helper/radio/radioHelper";
6
5
  import {onBeforeUnmount, Ref, ref} from 'vue';
6
+ import { useI18n } from "vue-i18n";
7
7
  export const useFetchRadio = ()=>{
8
8
 
9
9
  const radioInterval : Ref<ReturnType<typeof setTimeout> | undefined> = ref(undefined);
10
+
11
+ const {t} = useI18n();
10
12
 
11
13
  async function fetchRadioMetadata(
12
14
  canalId: number,
13
15
  previousTitle: string,
14
16
  callbackMetadata: (
15
- metadata: MediaRadio,
17
+ metadata: MediaRadio|undefined,
16
18
  podcast: Podcast | undefined,
17
19
  history: Array<MediaRadio>
18
20
  ) => void,
@@ -33,15 +35,19 @@ export const useFetchRadio = ()=>{
33
35
  callbackAdvertising(metadata.nextAdvertising);
34
36
  }
35
37
  const arrayMetadata = metadata.previously;
36
- arrayMetadata.unshift(metadata.currently);
37
- for (let index = 0, len = arrayMetadata.length; index < len; index++) {
38
- if (
39
- dayjs().valueOf() - 18000 >
40
- dayjs(arrayMetadata[index].startDate).valueOf()
41
- ) {
42
- await useCallbackIfNewMetadata(previousTitle, arrayMetadata, index, len,callbackMetadata);
43
- return;
38
+ if(null!==metadata.currently){
39
+ arrayMetadata.unshift(metadata.currently);
40
+ for (let index = 0, len = arrayMetadata.length; index < len; index++) {
41
+ if (
42
+ dayjs().valueOf() - 18000 >
43
+ dayjs(arrayMetadata[index].startDate).valueOf()
44
+ ) {
45
+ await useCallbackIfNewMetadata(previousTitle, arrayMetadata, index, len,callbackMetadata);
46
+ return;
47
+ }
44
48
  }
49
+ }else{
50
+ callbackMetadata(undefined, undefined, arrayMetadata);
45
51
  }
46
52
  }
47
53
  async function useCallbackIfNewMetadata(previousTitle: string, arrayMetadata: Array<MediaRadio>, index:number, len: number, callbackMetadata: (
@@ -63,11 +69,22 @@ export const useFetchRadio = ()=>{
63
69
  }
64
70
  }
65
71
  }
66
- function displayTitle(metadata: MediaRadio): string {
67
- return radioHelper.displayTitle(metadata);
72
+ function displayTitle(metadata: MediaRadio|undefined): string {
73
+ if(!metadata){
74
+ return t("Silent stream");
75
+ }
76
+ let title = "";
77
+ if (metadata?.title) {
78
+ title += metadata.title;
79
+ }
80
+ if (metadata?.artist) {
81
+ title += " - " + metadata.artist;
82
+ }
83
+ return title;
68
84
  }
69
85
 
70
86
 
87
+
71
88
  onBeforeUnmount(() => {
72
89
  clearInterval(radioInterval.value as unknown as number);
73
90
  })
@@ -72,10 +72,7 @@ const currentlyPlayingString = computed(() => {
72
72
  if (playingRadio.value && playerStore.playerRadio) {
73
73
  return displayTitle(playerStore.playerRadio.metadata);
74
74
  }
75
- if (currentMetadata.value) {
76
- return displayTitle(currentMetadata.value);
77
- }
78
- return "";
75
+ return displayTitle(currentMetadata.value);
79
76
  });
80
77
 
81
78
  onMounted(()=>{
@@ -102,7 +99,7 @@ async function fetchCurrentlyPlaying(): Promise<void> {
102
99
  updateMetadata,
103
100
  );
104
101
  }
105
- function updateMetadata(metadata: MediaRadio, podcast?: Podcast): void {
102
+ function updateMetadata(metadata: MediaRadio|undefined, podcast?: Podcast): void {
106
103
  currentMetadata.value = metadata;
107
104
  currentPodcast.value = podcast;
108
105
  }
@@ -36,12 +36,6 @@
36
36
  </div>
37
37
  </div>
38
38
  <ChooseEpisodesNumber v-else :episodes-number="episodesNumber" @update-number="emit('update:episodesNumber', $event)"/>
39
- <ClassicCheckbox
40
- :text-init="proceedReading"
41
- id-checkbox="proceed-reading-checkbox"
42
- :label="t('Proceed reading')"
43
- @update:text-init="emit('update:proceedReading', $event)"
44
- />
45
39
  </template>
46
40
  <ClassicCheckbox
47
41
  v-if="displayIsVisible"
@@ -104,7 +98,6 @@ const props = defineProps({
104
98
  displayArticleParam: { default: false, type: Boolean },
105
99
  displayIsVisible: { default: false, type: Boolean },
106
100
  displayInsertCode: { default: false, type: Boolean },
107
- proceedReading: { default: true, type: Boolean },
108
101
  displayArticle: { default: true, type: Boolean },
109
102
  displayTranscript: { default: true, type: Boolean },
110
103
  displayWave: { default: true, type: Boolean },
@@ -118,7 +111,6 @@ const props = defineProps({
118
111
  //Emits
119
112
  const emit = defineEmits([
120
113
  "episodeChoiceDisplay",
121
- "update:proceedReading",
122
114
  "update:isVisible",
123
115
  "update:episodesNumber",
124
116
  "update:displayArticle",
@@ -44,7 +44,6 @@
44
44
  v-model:display-article="displayArticle"
45
45
  v-model:display-transcript="displayTranscript"
46
46
  v-model:display-wave="displayWave"
47
- v-model:proceed-reading="proceedReading"
48
47
  v-model:is-visible="isVisible"
49
48
  v-model:player-auto-play="playerAutoPlay"
50
49
  v-model:episodes-number="episodesNumber"
@@ -125,7 +124,6 @@ const iFrameModel = ref("default");
125
124
  const isShareModal = ref(false);
126
125
  const color = ref("#40a372");
127
126
  const theme = ref("#000000");
128
- const proceedReading = ref(true);
129
127
  const episodeChoiceDisplay = ref("number");
130
128
  const episodesNumber = ref(3);
131
129
  const isVisible = ref(false);
@@ -341,9 +339,6 @@ function addUrlParameters(url: Array<string>) {
341
339
  url.push(
342
340
  `&color=${color.value.substring(1)}&theme=${theme.value.substring(1)}`,
343
341
  );
344
- if (!proceedReading.value) {
345
- url.push("&proceed=false");
346
- }
347
342
  if (!displayArticle.value && displayArticleParam.value) {
348
343
  url.push("&article=false");
349
344
  }
@@ -89,7 +89,7 @@ onUnmounted(()=>{
89
89
  async function fetchCurrentlyPlaying(): Promise<void> {
90
90
  fetchRadioMetadata(
91
91
  playerStore.playerRadio?.canalId ?? 0,
92
- playerStore.playerRadio?.metadata.title ?? "",
92
+ playerStore.playerRadio?.metadata?.title ?? "",
93
93
  updateMetadata,
94
94
  updateAdvertising,
95
95
  );
@@ -98,11 +98,11 @@ function updateAdvertising(nextAdvertising: NextAdvertising): void {
98
98
  playerStore.playerRadioUpdateNextAdvertising(nextAdvertising);
99
99
  }
100
100
  function updateMetadata(
101
- metadata: MediaRadio,
101
+ metadata: MediaRadio|undefined,
102
102
  podcast: Podcast | undefined,
103
103
  history: Array<MediaRadio>,
104
104
  ): void {
105
- playerStore.playerMetadata(metadata, history);
105
+ playerStore.playerMetadata(metadata, history); //TODO
106
106
  playerStore.playerRadioPodcast(podcast);
107
107
  }
108
108
  </script>
@@ -40,10 +40,10 @@ import ChevronLeftIcon from "vue-material-design-icons/ChevronLeft.vue";
40
40
  import ChevronRightIcon from "vue-material-design-icons/ChevronRight.vue";
41
41
  import { usePlayerStore } from "../../../../stores/PlayerStore";
42
42
  import dayjs from "dayjs";
43
- import radioHelper from "../../../../helper/radio/radioHelper";
44
43
  import { computed, nextTick, onMounted, onUnmounted, ref, useTemplateRef, watch } from "vue";
45
44
  import { MediaRadio } from "@/stores/class/general/player";
46
45
  import { useI18n } from "vue-i18n";
46
+ import { useFetchRadio } from "../../../composable/radio/usefetchRadioData";
47
47
 
48
48
 
49
49
  //Data
@@ -54,6 +54,7 @@ const historyListContainerRef = useTemplateRef('historyListContainer');
54
54
  //Composables
55
55
  const { t } = useI18n();
56
56
  const playerStore = usePlayerStore();
57
+ const {displayTitle} = useFetchRadio();
57
58
 
58
59
 
59
60
  //Computed
@@ -119,7 +120,7 @@ function displayPreviousItem(item: MediaRadio): string {
119
120
  if (item.podcastId) {
120
121
  return item.title;
121
122
  }
122
- return radioHelper.displayTitle(item);
123
+ return displayTitle(item);
123
124
  }
124
125
  </script>
125
126
  <style lang="scss">
package/src/locale/de.ts CHANGED
@@ -167,7 +167,6 @@ export default {
167
167
  "open left Menu": "Menü öffnen/schließen",
168
168
  Participant: "Sprecher",
169
169
  "Number of player podcasts": "Anzahl der Podcasts im Player",
170
- "Proceed reading": "Weiterhören",
171
170
  "Without topic": "Ohne Thema",
172
171
  "Without rubric": "Ohne Rubrik",
173
172
  "Consider podcasts no visible":
@@ -414,4 +413,5 @@ export default {
414
413
  "Code copied!":"Code kopiert!",
415
414
  "Copied!":"Kopiert!",
416
415
  "Color of the QR Code": "Farbe des QR-Codes",
416
+ "Silent stream":"Stiller Fluss",
417
417
  }
package/src/locale/en.ts CHANGED
@@ -166,7 +166,6 @@ export default {
166
166
  "open left Menu": "Open/Close Menu",
167
167
  Participant: "Speaker",
168
168
  "Number of player podcasts": "Number of podcasts in the player ",
169
- "Proceed reading": "Continue Listening",
170
169
  "Without topic": "Without a topic",
171
170
  "Without rubric": "Without a rubric",
172
171
  "Consider podcasts no visible":
@@ -417,4 +416,5 @@ export default {
417
416
  "Code copied!":"Code copied!",
418
417
  "Copied!":"Copied!",
419
418
  "Color of the QR Code": "Color of the QR Code",
419
+ "Silent stream":"Silent stream",
420
420
  };
package/src/locale/es.ts CHANGED
@@ -167,7 +167,6 @@ export default {
167
167
  "open left Menu": "Abrir/Cerrar menú",
168
168
  Participant: "Participante",
169
169
  "Number of player podcasts": "Número de pódcast en el reproductor",
170
- "Proceed reading": "Seguir escuchando",
171
170
  "Without topic": "Sin tema",
172
171
  "Without rubric": "Sin sección",
173
172
  "Consider podcasts no visible":
@@ -415,4 +414,5 @@ export default {
415
414
  "Code copied!":"¡Código copiado!",
416
415
  "Copied!":"¡Copiado!",
417
416
  "Color of the QR Code": "Color del código QR",
417
+ "Silent stream":"Flujo silencioso",
418
418
  }
package/src/locale/fr.ts CHANGED
@@ -168,7 +168,6 @@ export default {
168
168
  "open left Menu": "Ouvrir/Fermer le menu",
169
169
  Participant: "Intervenant",
170
170
  "Number of player podcasts": "Nombre d'épisodes dans le miniplayer",
171
- "Proceed reading": "Poursuivre la lecture",
172
171
  "Without topic": "Sans rubriquage",
173
172
  "Without rubric": "Non rubriqué",
174
173
  "Consider podcasts no visible":
@@ -424,4 +423,5 @@ export default {
424
423
  "Code copied!":"Code copié !",
425
424
  "Copied!":"Copié !",
426
425
  "Color of the QR Code": "Couleur du Qr Code",
426
+ "Silent stream":"Flux silencieux",
427
427
  };
package/src/locale/it.ts CHANGED
@@ -163,7 +163,6 @@ export default{
163
163
  'open left Menu': 'Apri/Chiudi Menu',
164
164
  Participant: 'Speaker',
165
165
  'Number of player podcasts': "Numero di podcast nel lettore",
166
- 'Proceed reading': 'Continua ad ascoltare',
167
166
  'Without topic': 'Senza un tema',
168
167
  'Without rubric': 'Senza una rubrica',
169
168
  'Consider podcasts no visible':
@@ -411,4 +410,5 @@ export default{
411
410
  "Code copied!":"Codice copiato!",
412
411
  "Copied!":"Copiato!",
413
412
  "Color of the QR Code": "Colore del codice QR",
413
+ "Silent stream":"Flusso silenzioso",
414
414
  };
package/src/locale/sl.ts CHANGED
@@ -163,7 +163,6 @@ export default {
163
163
  "open left Menu": "Meni odpri/zapri",
164
164
  Participant: "Sodelujoči",
165
165
  "Number of player podcasts": "Število podkastov v predvajalniku",
166
- "Proceed reading": "Nadaljuj s poslušanjem",
167
166
  "Without topic": "Brez teme",
168
167
  "Without rubric": "Brez rubrike",
169
168
  "Consider podcasts no visible": "Občinstvu skriti podkasti",
@@ -406,4 +405,5 @@ export default {
406
405
  "Code copied!":"Koda kopirana!",
407
406
  "Copied!":"Kopirano!",
408
407
  "Color of the QR Code": "Barva kode QR",
408
+ "Silent stream":"Tihi tok",
409
409
  }
@@ -215,7 +215,7 @@ export const usePlayerStore = defineStore("PlayerStore", {
215
215
  playerUpdateSeekTime(seekTime: number) {
216
216
  this.playerSeekTime = seekTime;
217
217
  },
218
- playerMetadata(metadata: MediaRadio, history: Array<MediaRadio>) {
218
+ playerMetadata(metadata: MediaRadio|undefined, history: Array<MediaRadio>) {
219
219
  if (!this.playerRadio) {
220
220
  return;
221
221
  }
@@ -8,7 +8,7 @@ export interface Conference {
8
8
  deletionAttempts?: number;
9
9
  directCode?: string;
10
10
  externalRtmpUrl?: ExternalRtmpUrl;
11
- hlsIdentifier: string;
11
+ hlsIdentifier?: string;
12
12
  hostname?: string;
13
13
  jingleDuration?: number;
14
14
  jingleFilePath?: string;
@@ -4,7 +4,7 @@ import { Podcast } from "./podcast";
4
4
  export interface Radio {
5
5
  canalId: number;
6
6
  url: string;
7
- metadata: MediaRadio;
7
+ metadata?: MediaRadio;
8
8
  history: Array<MediaRadio>;
9
9
  nextAdvertising: NextAdvertising;
10
10
  isInit: boolean;
@@ -30,7 +30,7 @@ export interface NextAdvertising {
30
30
 
31
31
  export interface MetadataRadio {
32
32
  channelId: number;
33
- currently: MediaRadio;
33
+ currently: MediaRadio|null;
34
34
  previously: Array<MediaRadio>;
35
35
  nextAdvertising: NextAdvertising;
36
36
  }
@@ -1,15 +0,0 @@
1
- import { MediaRadio } from "@/stores/class/general/player";
2
-
3
- export default {
4
- displayTitle(metadata: MediaRadio): string {
5
- let title = "";
6
- if (metadata.title) {
7
- title += metadata.title;
8
- }
9
- if (metadata.artist) {
10
- title += " - " + metadata.artist;
11
- }
12
- return title;
13
- }
14
- };
15
-