@saooti/octopus-sdk 36.0.8 → 36.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": "36.0.8",
3
+ "version": "36.0.9",
4
4
  "private": false,
5
5
  "description": "Javascript SDK for using octopus",
6
6
  "author": "Saooti",
@@ -240,6 +240,9 @@
240
240
  .bg-secondary{
241
241
  background: #eee !important;
242
242
  }
243
+ .bg-complementary{
244
+ background: $octopus-complementary-color !important;
245
+ }
243
246
  .w-50-responsive{
244
247
  display: flex;
245
248
  align-items: center;
@@ -250,6 +253,9 @@
250
253
  padding: 0 !important;
251
254
  }
252
255
  }
256
+ .font-italic{
257
+ font-style: italic;
258
+ }
253
259
  }
254
260
 
255
261
 
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div
3
3
  v-if="live"
4
- class="d-flex w-100"
4
+ class="d-flex-column live-item-container w-100"
5
5
  >
6
6
  <router-link
7
7
  class="live-date-box"
@@ -29,7 +29,7 @@
29
29
  }"
30
30
  >
31
31
  <PodcastImage
32
- class="me-3"
32
+ class="me-3 flex-shrink-0"
33
33
  :podcast="live"
34
34
  :hide-play="false"
35
35
  :playing-podcast="false"
@@ -37,7 +37,7 @@
37
37
  :is-animator-live="organisationRight"
38
38
  />
39
39
  </router-link>
40
- <div class="d-flex flex-column live-special-width">
40
+ <div class="d-flex flex-column">
41
41
  <router-link
42
42
  class="text-uppercase fw-bold text-truncate"
43
43
  :to="{
@@ -246,36 +246,38 @@ export default defineComponent({
246
246
 
247
247
  <style lang="scss">
248
248
  .octopus-app{
249
- .live-date-box {
250
- width: 200px;
251
- display: flex;
252
- flex-shrink: 0;
253
- flex-direction: column;
254
- }
255
- .font-size-smaller {
256
- font-size: smaller;
257
- }
258
- .live-description-container {
259
- overflow: hidden;
260
- margin-top: 0.5em;
261
- word-break: break-word;
262
- max-height: 6rem;
263
- position: relative;
264
- &.after-live-description:after {
265
- content: '...';
266
- position: absolute;
267
- padding-left: 1rem;
268
- right: 0;
269
- bottom: 0;
270
- width: 100%;
271
- font-size: 1rem;
272
- font-weight: bolder;
273
- background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #f3f3f3 40%);
249
+ .live-item-container{
250
+ @media (max-width: 960px) {
251
+ align-items: center;
252
+ justify-content: center;
253
+ }
254
+ }
255
+ .live-date-box {
256
+ width: 200px;
257
+ display: flex;
258
+ flex-shrink: 0;
259
+ flex-direction: column;
260
+ }
261
+ .font-size-smaller {
262
+ font-size: smaller;
263
+ }
264
+ .live-description-container {
265
+ overflow: hidden;
266
+ margin-top: 0.5em;
267
+ word-break: break-word;
268
+ max-height: 6rem;
269
+ position: relative;
270
+ &.after-live-description:after {
271
+ content: '...';
272
+ position: absolute;
273
+ padding-left: 1rem;
274
+ right: 0;
275
+ bottom: 0;
276
+ width: 100%;
277
+ font-size: 1rem;
278
+ font-weight: bolder;
279
+ background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #f3f3f3 40%);
280
+ }
274
281
  }
275
- }
276
- .live-special-width {
277
- width: 0;
278
- flex-grow: 1;
279
- }
280
282
  }
281
283
  </style>
@@ -372,8 +372,8 @@ export default defineComponent({
372
372
  background-color: #ffd663;
373
373
  border-radius: 50%;
374
374
  position: absolute;
375
- right: 4.5rem;
376
- top: 6rem;
375
+ left: 4.5rem;
376
+ bottom: 4rem;
377
377
  font-size: 0.9rem;
378
378
  font-weight: bold;
379
379
  display: flex;
@@ -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> {
@@ -71,6 +71,7 @@ import { RouteLocationRaw } from 'vue-router';
71
71
  import { useFilterStore } from '@/stores/FilterStore';
72
72
  import { mapState, mapActions } from 'pinia';
73
73
  import { Rubrique } from '@/stores/class/rubrique/rubrique';
74
+ import { Rubriquage } from '@/stores/class/rubrique/rubriquage';
74
75
  export default defineComponent({
75
76
  name: 'PodcastInlineListTemplate',
76
77
 
@@ -150,13 +151,18 @@ export default defineComponent({
150
151
  nameRubrique: ''
151
152
  };
152
153
  if(this.filterRubriquage.length){
153
- const rubriqueChosen = this.filterRubriquage[this.rubriqueId.length - 1].rubriques.find((element: Rubrique) => element.rubriqueId === rubriqueChosenId);
154
- filterToAdd = {
155
- rubriquageId: this.filterRubriquage[this.rubriqueId.length - 1].rubriquageId,
156
- rubriqueId: rubriqueChosenId,
157
- nameRubriquage: this.filterRubriquage[this.rubriqueId.length - 1].title,
158
- nameRubrique: rubriqueChosen.name
159
- };
154
+ this.filterRubriquage.forEach((element:Rubriquage) => {
155
+ const rubriqueChosen = element.rubriques.find((element: Rubrique) => element.rubriqueId === rubriqueChosenId);
156
+ if(rubriqueChosen){
157
+ filterToAdd = {
158
+ rubriquageId: element.rubriquageId??0,
159
+ rubriqueId: rubriqueChosenId,
160
+ nameRubriquage: element.title,
161
+ nameRubrique: rubriqueChosen.name
162
+ };
163
+ return;
164
+ }
165
+ });
160
166
  }
161
167
  const newFilter: Array<RubriquageFilter> = Array.from(this.filterRubrique);
162
168
  newFilter.push(filterToAdd);
@@ -11,6 +11,16 @@
11
11
  aria-valuemax="100"
12
12
  :style="'width: ' + secondaryProgress + '%'"
13
13
  />
14
+ <template v-if="playerMedia">
15
+ <div
16
+ class="octopus-progress-bar bg-complementary"
17
+ :style="{'width': + mediaCueInPercent + '%'}"
18
+ />
19
+ <div
20
+ class="octopus-progress-bar end-0 bg-complementary"
21
+ :style="{'width': + 100- mediaCueOutPercent + '%'}"
22
+ />
23
+ </template>
14
24
  <div
15
25
  class="octopus-progress-bar bg-primary"
16
26
  role="progressbar"
@@ -19,6 +29,16 @@
19
29
  aria-valuemax="100"
20
30
  :style="'width: ' + mainProgress + '%'"
21
31
  />
32
+ <template v-if="playerMedia">
33
+ <div
34
+ class="octopus-progress-bar octopus-progress-bar-duration bg-complementary"
35
+ :style="{'left': + mediaCueInPercent + '%'}"
36
+ />
37
+ <div
38
+ class="octopus-progress-bar end-0 octopus-progress-bar-duration bg-complementary"
39
+ :style="{'right': + 100- mediaCueOutPercent + '%'}"
40
+ />
41
+ </template>
22
42
  <div
23
43
  v-if="alertBar"
24
44
  class="octopus-progress-bar octopus-progress-bar-duration bg-danger"
@@ -33,6 +53,8 @@
33
53
  </template>
34
54
 
35
55
  <script lang="ts">
56
+ import { usePlayerStore } from '@/stores/PlayerStore';
57
+ import { mapState } from 'pinia';
36
58
  import { defineComponent } from 'vue';
37
59
  export default defineComponent({
38
60
  name: 'ProgressBar',
@@ -42,6 +64,33 @@ export default defineComponent({
42
64
  secondaryProgress: { default: 0, type: Number},
43
65
  isProgressCursor: { default: false, type: Boolean},
44
66
  },
67
+ data() {
68
+ return {
69
+ mediaCueInPercent: 0 as number,
70
+ mediaCueOutPercent: 100 as number,
71
+ };
72
+ },
73
+ computed:{
74
+ ...mapState(usePlayerStore, ['playerMedia']),
75
+ },
76
+ watch:{
77
+ playerMedia: {
78
+ deep: true,
79
+ immediate:true,
80
+ handler(){
81
+ if(this.playerMedia){
82
+ this.mediaCueInPercent = this.timeMediaToPercent(this.playerMedia.cueIn??0);
83
+ this.mediaCueOutPercent = this.timeMediaToPercent(this.playerMedia.cueOut??null);
84
+ }
85
+ }
86
+ },
87
+ },
88
+ methods:{
89
+ timeMediaToPercent(value: number|null):number{
90
+ if(null===value || !this.playerMedia){return 100;}
91
+ return (value*100)/(this.playerMedia?.duration??1);
92
+ },
93
+ }
45
94
  })
46
95
  </script>
47
96
 
@@ -91,6 +140,9 @@ export default defineComponent({
91
140
  align-self: center;
92
141
  position: absolute;
93
142
  }
143
+ .end-0{
144
+ right: 0;
145
+ }
94
146
  }
95
147
  }
96
148
  </style>
@@ -15,6 +15,7 @@
15
15
  @durationChange="onTimeUpdate"
16
16
  @error="onError"
17
17
  @seeked="onSeeked"
18
+ @pause="onPause"
18
19
  />
19
20
  <PlayerCompact
20
21
  v-if="!playerLargeVersion"
@@ -93,13 +94,18 @@ export default defineComponent({
93
94
  },
94
95
 
95
96
  methods: {
96
- ...mapActions(usePlayerStore, ['playerPlay', 'playerUpdateLargeVersion']),
97
+ ...mapActions(usePlayerStore, ['playerPlay', 'playerUpdateLargeVersion', 'playerChangeStatus']),
97
98
  onHidden(): void {
98
99
  if (this.forceHide) {
99
100
  this.playerPlay();
100
101
  this.forceHide = false;
101
102
  }
102
103
  },
104
+ onPause(){
105
+ if("PLAYING"===this.playerStatus){
106
+ this.playerChangeStatus(true);
107
+ }
108
+ }
103
109
  },
104
110
  })
105
111
  </script>
@@ -137,6 +137,7 @@ export default defineComponent({
137
137
  flex-shrink: 1;
138
138
  overflow: hidden;
139
139
  font-size: 0.8rem;
140
+ padding: 0 0.5rem;
140
141
  }
141
142
  .player-image {
142
143
  border-radius: $octopus-borderradius;
@@ -13,7 +13,7 @@ $secondary: #636C73 !default;
13
13
  $danger: #E22C27 !default;
14
14
 
15
15
  $blue-octopus: #08667E !default;
16
-
16
+ $octopus-complementary-color: #813257;
17
17
  //SDK Octopus style
18
18
  $octopus-background: white !default;
19
19
  $octopus-primary-color: #1a8658 !default;
@@ -1,7 +1,6 @@
1
1
  export interface Media {
2
2
  mediaId: number;
3
- imageUrl?: string;
4
- organisationId: string;
3
+ organisationId?: string;
5
4
  title: string;
6
5
  year?: string;
7
6
  type?: string;
@@ -9,6 +8,21 @@ export interface Media {
9
8
  album?: string;
10
9
  creation?: string;
11
10
  duration?: number;
11
+ contentType?: string;
12
12
  filePath?: string;
13
13
  audioUrl?: string;
14
- }
14
+ cueIn?: number;
15
+ cueOut?: number;
16
+ bpm?: number;
17
+ }
18
+
19
+ export function emptyMediaData(): Media{
20
+ return {
21
+ mediaId: 0,
22
+ album: '',
23
+ artiste: '',
24
+ title: '',
25
+ type: '',
26
+ year: '',
27
+ }
28
+ }