@saooti/octopus-sdk 41.0.2 → 41.0.3
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 +1 -1
- package/src/components/composable/radio/usefetchRadioData.ts +12 -29
- package/src/components/display/categories/CategoryChooser.vue +4 -0
- package/src/components/display/live/RadioCurrently.vue +5 -2
- package/src/components/form/ClassicInputText.vue +3 -0
- package/src/components/form/ClassicMultiselect.vue +32 -7
- package/src/components/misc/ClassicAccordion.vue +4 -4
- package/src/components/misc/ClassicSpinner.vue +1 -1
- package/src/components/misc/TopBar.vue +2 -10
- package/src/components/misc/player/elements/PlayerTitle.vue +3 -3
- package/src/components/misc/player/radio/RadioHistory.vue +2 -3
- package/src/components/pages/PageLogout.vue +1 -6
- package/src/helper/radio/radioHelper.ts +15 -0
- package/src/locale/de.ts +0 -1
- package/src/locale/en.ts +0 -1
- package/src/locale/es.ts +0 -1
- package/src/locale/fr.ts +0 -1
- package/src/locale/it.ts +0 -1
- package/src/locale/sl.ts +0 -1
- package/src/stores/PlayerStore.ts +1 -1
- package/src/stores/class/general/player.ts +2 -2
- package/src/style/_variables.scss +3 -0
- package/src/style/general.scss +5 -0
package/package.json
CHANGED
|
@@ -2,19 +2,17 @@ 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";
|
|
5
6
|
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();
|
|
12
10
|
|
|
13
11
|
async function fetchRadioMetadata(
|
|
14
12
|
canalId: number,
|
|
15
13
|
previousTitle: string,
|
|
16
14
|
callbackMetadata: (
|
|
17
|
-
metadata: MediaRadio
|
|
15
|
+
metadata: MediaRadio,
|
|
18
16
|
podcast: Podcast | undefined,
|
|
19
17
|
history: Array<MediaRadio>
|
|
20
18
|
) => void,
|
|
@@ -35,19 +33,15 @@ export const useFetchRadio = ()=>{
|
|
|
35
33
|
callbackAdvertising(metadata.nextAdvertising);
|
|
36
34
|
}
|
|
37
35
|
const arrayMetadata = metadata.previously;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
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;
|
|
48
44
|
}
|
|
49
|
-
}else{
|
|
50
|
-
callbackMetadata(undefined, undefined, arrayMetadata);
|
|
51
45
|
}
|
|
52
46
|
}
|
|
53
47
|
async function useCallbackIfNewMetadata(previousTitle: string, arrayMetadata: Array<MediaRadio>, index:number, len: number, callbackMetadata: (
|
|
@@ -69,22 +63,11 @@ export const useFetchRadio = ()=>{
|
|
|
69
63
|
}
|
|
70
64
|
}
|
|
71
65
|
}
|
|
72
|
-
function displayTitle(metadata: MediaRadio
|
|
73
|
-
|
|
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;
|
|
66
|
+
function displayTitle(metadata: MediaRadio): string {
|
|
67
|
+
return radioHelper.displayTitle(metadata);
|
|
84
68
|
}
|
|
85
69
|
|
|
86
70
|
|
|
87
|
-
|
|
88
71
|
onBeforeUnmount(() => {
|
|
89
72
|
clearInterval(radioInterval.value as unknown as number);
|
|
90
73
|
})
|
|
@@ -17,6 +17,8 @@
|
|
|
17
17
|
:is-disabled="isDisabled"
|
|
18
18
|
:no-deselect="noDeselect"
|
|
19
19
|
:display-required="displayRequired"
|
|
20
|
+
:popover="popover"
|
|
21
|
+
:popover-relative-class="popoverRelativeClass"
|
|
20
22
|
@on-search="onSearchCategory"
|
|
21
23
|
@selected="onCategorySelected"
|
|
22
24
|
/>
|
|
@@ -52,6 +54,8 @@ const props = defineProps({
|
|
|
52
54
|
displayLabel: { default: false, type: Boolean },
|
|
53
55
|
textDanger :{ default: undefined, type: String },
|
|
54
56
|
displayRequired: { default: false, type: Boolean },
|
|
57
|
+
popover: { default: undefined, type: String },
|
|
58
|
+
popoverRelativeClass: { default: undefined, type: String },
|
|
55
59
|
})
|
|
56
60
|
|
|
57
61
|
//Emits
|
|
@@ -72,7 +72,10 @@ const currentlyPlayingString = computed(() => {
|
|
|
72
72
|
if (playingRadio.value && playerStore.playerRadio) {
|
|
73
73
|
return displayTitle(playerStore.playerRadio.metadata);
|
|
74
74
|
}
|
|
75
|
-
|
|
75
|
+
if (currentMetadata.value) {
|
|
76
|
+
return displayTitle(currentMetadata.value);
|
|
77
|
+
}
|
|
78
|
+
return "";
|
|
76
79
|
});
|
|
77
80
|
|
|
78
81
|
onMounted(()=>{
|
|
@@ -99,7 +102,7 @@ async function fetchCurrentlyPlaying(): Promise<void> {
|
|
|
99
102
|
updateMetadata,
|
|
100
103
|
);
|
|
101
104
|
}
|
|
102
|
-
function updateMetadata(metadata: MediaRadio
|
|
105
|
+
function updateMetadata(metadata: MediaRadio, podcast?: Podcast): void {
|
|
103
106
|
currentMetadata.value = metadata;
|
|
104
107
|
currentPodcast.value = podcast;
|
|
105
108
|
}
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
>{{ label }}
|
|
13
13
|
<AsteriskIcon v-if="displayRequired" :size="10" class="ms-1 mb-2" :title="t('Mandatory input')"/>
|
|
14
14
|
</component>
|
|
15
|
+
<slot name="afterTitle"/>
|
|
15
16
|
<template v-if="popover">
|
|
16
17
|
<button
|
|
17
18
|
:id="'popover' + inputId"
|
|
@@ -31,7 +32,9 @@
|
|
|
31
32
|
<!-- eslint-enable -->
|
|
32
33
|
</ClassicPopover>
|
|
33
34
|
</template>
|
|
35
|
+
<slot name="afterHelp"/>
|
|
34
36
|
</div>
|
|
37
|
+
<slot name="betweenTitleInput"/>
|
|
35
38
|
<input
|
|
36
39
|
v-if="!isWysiwyg && !isTextarea"
|
|
37
40
|
v-show="showField"
|
|
@@ -7,11 +7,31 @@
|
|
|
7
7
|
}"
|
|
8
8
|
:style="{ width: width, height: height }"
|
|
9
9
|
>
|
|
10
|
-
<
|
|
11
|
-
label
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
<div class="d-flex align-items-center">
|
|
11
|
+
<label :class="displayLabel ? '' : 'd-none'" :for="id" class="form-label">{{
|
|
12
|
+
label
|
|
13
|
+
}}
|
|
14
|
+
<AsteriskIcon v-if="displayRequired" :size="10" class="ms-1 mb-2" :title="t('Mandatory input')"/>
|
|
15
|
+
</label>
|
|
16
|
+
<template v-if="popover">
|
|
17
|
+
<button
|
|
18
|
+
:id="'popover' + id"
|
|
19
|
+
:title="t('Help')"
|
|
20
|
+
class="btn-transparent"
|
|
21
|
+
>
|
|
22
|
+
<HelpCircleIcon :size="30" />
|
|
23
|
+
</button>
|
|
24
|
+
<ClassicPopover
|
|
25
|
+
:target="'popover' + id"
|
|
26
|
+
popover-class="popover-z-index"
|
|
27
|
+
:relative-class="popoverRelativeClass"
|
|
28
|
+
>
|
|
29
|
+
<!-- eslint-disable vue/no-v-html -->
|
|
30
|
+
<div v-html="popover" />
|
|
31
|
+
<!-- eslint-enable -->
|
|
32
|
+
</ClassicPopover>
|
|
33
|
+
</template>
|
|
34
|
+
</div>
|
|
15
35
|
<vSelect
|
|
16
36
|
v-model="optionSelected"
|
|
17
37
|
:input-id="id"
|
|
@@ -77,12 +97,15 @@
|
|
|
77
97
|
</template>
|
|
78
98
|
|
|
79
99
|
<script setup lang="ts">
|
|
80
|
-
import { computed, ref, Ref, watch } from "vue";
|
|
100
|
+
import { computed, defineAsyncComponent, ref, Ref, watch } from "vue";
|
|
81
101
|
import { useI18n } from "vue-i18n";
|
|
82
102
|
import AsteriskIcon from "vue-material-design-icons/Asterisk.vue";
|
|
83
103
|
import ChevronDownIcon from "vue-material-design-icons/ChevronDown.vue";
|
|
84
104
|
import vSelect from "vue-select";
|
|
85
|
-
|
|
105
|
+
import HelpCircleIcon from "vue-material-design-icons/HelpCircle.vue";
|
|
106
|
+
const ClassicPopover = defineAsyncComponent(
|
|
107
|
+
() => import("../misc/ClassicPopover.vue"),
|
|
108
|
+
);
|
|
86
109
|
|
|
87
110
|
//Props
|
|
88
111
|
const props = defineProps({
|
|
@@ -106,6 +129,8 @@ const props = defineProps({
|
|
|
106
129
|
allowEmpty: { default: true, type: Boolean },
|
|
107
130
|
textDanger :{ default: undefined, type: String },
|
|
108
131
|
displayRequired: { default: false, type: Boolean },
|
|
132
|
+
popover: { default: undefined, type: String },
|
|
133
|
+
popoverRelativeClass: { default: undefined, type: String },
|
|
109
134
|
})
|
|
110
135
|
|
|
111
136
|
//Emits
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
class="img-accordion"
|
|
21
21
|
:src="imageUrl"
|
|
22
22
|
aria-hidden="true"
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
alt=""
|
|
25
24
|
/>
|
|
26
|
-
<span
|
|
27
|
-
<
|
|
25
|
+
<span>{{ title }}</span>
|
|
26
|
+
<slot name="afterTitle"/>
|
|
27
|
+
<ChevronDownIcon class="ms-auto" :class="{ 'arrow-transform': isOpen }" />
|
|
28
28
|
</button>
|
|
29
29
|
<div v-show="isOpen" class="body p-2">
|
|
30
30
|
<slot />
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
role="banner"
|
|
4
4
|
class="header-saooti-play"
|
|
5
5
|
:style="headerBackgroundImage"
|
|
6
|
-
:class="[generalStore.contentToDisplay ? 'header-img-bg':'
|
|
6
|
+
:class="[generalStore.contentToDisplay ? 'header-img-bg':'bg-gradient', scrolled? 'scrolled':'', needToBlur ? 'header-force-blur':'']"
|
|
7
7
|
>
|
|
8
8
|
<TopBarMainContent
|
|
9
9
|
:is-phone="isPhone"
|
|
@@ -160,15 +160,7 @@ function handleScroll(): void {
|
|
|
160
160
|
background-repeat: no-repeat;
|
|
161
161
|
background-size: cover;
|
|
162
162
|
}
|
|
163
|
-
&.
|
|
164
|
-
background: var(--octopus-primary);
|
|
165
|
-
background: linear-gradient(
|
|
166
|
-
90deg,
|
|
167
|
-
var(--octopus-primary) 0%,
|
|
168
|
-
var(--octopus-tertiary) 100%
|
|
169
|
-
);
|
|
170
|
-
}
|
|
171
|
-
&.header-color-bg, &.scrolled{
|
|
163
|
+
&.bg-gradient, &.scrolled{
|
|
172
164
|
box-shadow: 0 2px 15px 5px var(--octopus-shadow) !important;
|
|
173
165
|
}
|
|
174
166
|
}
|
|
@@ -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
|
|
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,
|
|
102
102
|
podcast: Podcast | undefined,
|
|
103
103
|
history: Array<MediaRadio>,
|
|
104
104
|
): void {
|
|
105
|
-
playerStore.playerMetadata(metadata, history);
|
|
105
|
+
playerStore.playerMetadata(metadata, history);
|
|
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";
|
|
43
44
|
import { computed, nextTick, onMounted, onUnmounted, ref, useTemplateRef, watch } from "vue";
|
|
44
45
|
import { MediaRadio } from "@/stores/class/general/player";
|
|
45
46
|
import { useI18n } from "vue-i18n";
|
|
46
|
-
import { useFetchRadio } from "../../../composable/radio/usefetchRadioData";
|
|
47
47
|
|
|
48
48
|
|
|
49
49
|
//Data
|
|
@@ -54,7 +54,6 @@ const historyListContainerRef = useTemplateRef('historyListContainer');
|
|
|
54
54
|
//Composables
|
|
55
55
|
const { t } = useI18n();
|
|
56
56
|
const playerStore = usePlayerStore();
|
|
57
|
-
const {displayTitle} = useFetchRadio();
|
|
58
57
|
|
|
59
58
|
|
|
60
59
|
//Computed
|
|
@@ -120,7 +119,7 @@ function displayPreviousItem(item: MediaRadio): string {
|
|
|
120
119
|
if (item.podcastId) {
|
|
121
120
|
return item.title;
|
|
122
121
|
}
|
|
123
|
-
return displayTitle(item);
|
|
122
|
+
return radioHelper.displayTitle(item);
|
|
124
123
|
}
|
|
125
124
|
</script>
|
|
126
125
|
<style lang="scss">
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<section
|
|
3
|
-
class="page-box page-box-absolute page-logout"
|
|
3
|
+
class="page-box page-box-absolute page-logout bg-gradient"
|
|
4
4
|
>
|
|
5
5
|
<div class="logout-section">
|
|
6
6
|
<h1 class="mb-3">{{ t("Logout") }}</h1>
|
|
@@ -19,11 +19,6 @@ const { t } = useI18n();
|
|
|
19
19
|
</script>
|
|
20
20
|
<style lang="scss">
|
|
21
21
|
.octopus-app .page-logout {
|
|
22
|
-
background: linear-gradient(
|
|
23
|
-
90deg,
|
|
24
|
-
var(--octopus-primary) 0%,
|
|
25
|
-
var(--octopus-tertiary) 100%
|
|
26
|
-
);
|
|
27
22
|
display: flex;
|
|
28
23
|
align-items: center;
|
|
29
24
|
justify-content: center;
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
|
package/src/locale/de.ts
CHANGED
package/src/locale/en.ts
CHANGED
package/src/locale/es.ts
CHANGED
package/src/locale/fr.ts
CHANGED
package/src/locale/it.ts
CHANGED
package/src/locale/sl.ts
CHANGED
|
@@ -210,7 +210,7 @@ export const usePlayerStore = defineStore("PlayerStore", {
|
|
|
210
210
|
playerUpdateSeekTime(seekTime: number) {
|
|
211
211
|
this.playerSeekTime = seekTime;
|
|
212
212
|
},
|
|
213
|
-
playerMetadata(metadata: MediaRadio
|
|
213
|
+
playerMetadata(metadata: MediaRadio, history: Array<MediaRadio>) {
|
|
214
214
|
if (!this.playerRadio) {
|
|
215
215
|
return;
|
|
216
216
|
}
|
|
@@ -4,7 +4,7 @@ import { Podcast } from "./podcast";
|
|
|
4
4
|
export interface Radio {
|
|
5
5
|
canalId: number;
|
|
6
6
|
url: string;
|
|
7
|
-
metadata
|
|
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;
|
|
34
34
|
previously: Array<MediaRadio>;
|
|
35
35
|
nextAdvertising: NextAdvertising;
|
|
36
36
|
}
|
|
@@ -27,6 +27,9 @@
|
|
|
27
27
|
--octopus-background-transparent: oklch(from var(--octopus-background) l c h / 40%);
|
|
28
28
|
--octopus-tertiary-really-transparent: oklch(from var(--octopus-tertiary) l c h / 30%);
|
|
29
29
|
|
|
30
|
+
//Gradient
|
|
31
|
+
--octopus-gradient : linear-gradient(90deg,var(--octopus-primary) 0%, var(--octopus-tertiary) 100%);
|
|
32
|
+
|
|
30
33
|
// Size
|
|
31
34
|
--octopus-image-size: 12.5rem;
|
|
32
35
|
--octopus-podcast-size: 13.5rem;
|
package/src/style/general.scss
CHANGED
|
@@ -114,6 +114,11 @@ main, #app{
|
|
|
114
114
|
background: var(--octopus-complementary-color) !important;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
+
.bg-gradient{
|
|
118
|
+
background: var(--octopus-primary);
|
|
119
|
+
background:var(--octopus-gradient);
|
|
120
|
+
}
|
|
121
|
+
|
|
117
122
|
.text-blue-octopus{
|
|
118
123
|
color: var(--octopus-tertiary) !important
|
|
119
124
|
}
|