@saooti/octopus-sdk 40.2.19 → 41.0.0
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/index.ts +2 -1
- package/package.json +4 -3
- package/src/App.vue +71 -95
- package/src/components/composable/player/usePlayerLive.ts +13 -4
- package/src/components/composable/player/usePlayerLogic.ts +6 -6
- package/src/components/composable/player/usePlayerVast.ts +7 -7
- package/src/components/composable/podcasts/usePodcastView.ts +3 -3
- package/src/components/composable/route/useAdvancedParamInit.ts +1 -1
- package/src/components/composable/route/useRouteUpdateParams.ts +4 -4
- package/src/components/composable/route/useSimplePageParam.ts +15 -8
- package/src/components/composable/useInit.ts +2 -2
- package/src/components/composable/useMetaTitleWatch.ts +2 -2
- package/src/components/display/accessibility/AccessibilityModal.vue +56 -68
- package/src/components/display/categories/CategoryChooser.vue +144 -145
- package/src/components/display/categories/CategoryFilter.vue +172 -198
- package/src/components/display/categories/CategoryList.vue +122 -147
- package/src/components/display/comments/CommentInput.vue +100 -122
- package/src/components/display/comments/CommentList.vue +169 -191
- package/src/components/display/comments/CommentName.vue +35 -45
- package/src/components/display/comments/CommentParentInfo.vue +28 -34
- package/src/components/display/comments/CommentPlayer.vue +38 -50
- package/src/components/display/comments/CommentSection.vue +85 -103
- package/src/components/display/comments/item/CommentBasicView.vue +48 -61
- package/src/components/display/comments/item/CommentItem.vue +104 -115
- package/src/components/display/comments/item/CommentMoreActions.vue +174 -189
- package/src/components/display/comments/item/CommentMoreActionsAdmin.vue +1 -3
- package/src/components/display/comments/like/LikeButton.vue +36 -41
- package/src/components/display/comments/like/LikeSection.vue +128 -136
- package/src/components/display/comments/modal/CheckIdentityModal.vue +35 -40
- package/src/components/display/comments/modal/EditCommentModal.vue +72 -78
- package/src/components/display/comments/modal/RecaptchaModal.vue +58 -63
- package/src/components/display/comments/modal/ReportAbuseModal.vue +59 -66
- package/src/components/display/edit/EditBox.vue +9 -8
- package/src/components/display/edit/EditBoxRadio.vue +1 -5
- package/src/components/display/emission/EmissionInlineList.vue +82 -97
- package/src/components/display/emission/EmissionItem.vue +57 -69
- package/src/components/display/emission/EmissionList.vue +189 -218
- package/src/components/display/emission/EmissionPlayerItem.vue +47 -64
- package/src/components/display/emission/EmissionPresentationItem.vue +44 -54
- package/src/components/display/emission/EmissionPresentationList.vue +51 -61
- package/src/components/display/filter/AdvancedSearch.vue +151 -176
- package/src/components/display/filter/CategorySearchFilter.vue +43 -46
- package/src/components/display/filter/DateFilter.vue +76 -91
- package/src/components/display/filter/MonetizableFilter.vue +27 -30
- package/src/components/display/filter/ProductorSearch.vue +87 -90
- package/src/components/display/filter/RubriqueChoice.vue +58 -63
- package/src/components/display/filter/RubriqueFilter.vue +154 -169
- package/src/components/display/filter/SearchOrder.vue +35 -35
- package/src/components/display/list/ListPaginate.vue +72 -93
- package/src/components/display/list/PaginateParams.vue +36 -40
- package/src/components/display/list/PaginateSection.vue +113 -124
- package/src/components/display/list/SwiperList.vue +97 -109
- package/src/components/display/live/CountDown.vue +15 -9
- package/src/components/display/live/CountdownOctopus.vue +16 -10
- package/src/components/display/live/LiveHorizontalList.vue +95 -103
- package/src/components/display/live/LiveItem.vue +64 -73
- package/src/components/display/live/LiveList.vue +125 -137
- package/src/components/display/live/RadioCurrently.vue +66 -73
- package/src/components/display/live/RadioImage.vue +39 -50
- package/src/components/display/live/RadioItem.vue +9 -14
- package/src/components/display/live/RadioList.vue +39 -53
- package/src/components/display/live/RadioPlanning.vue +210 -222
- package/src/components/display/organisation/OrganisationChooser.vue +116 -122
- package/src/components/display/organisation/OrganisationChooserLight.vue +44 -52
- package/src/components/display/participant/ParticipantInlineList.vue +42 -58
- package/src/components/display/participant/ParticipantItem.vue +66 -74
- package/src/components/display/participant/ParticipantList.vue +116 -141
- package/src/components/display/playlist/PlaylistItem.vue +33 -46
- package/src/components/display/playlist/PlaylistList.vue +115 -144
- package/src/components/display/playlist/PodcastList.vue +90 -103
- package/src/components/display/playlist/PodcastPlaylistInlineList.vue +58 -70
- package/src/components/display/podcastmaker/PodcastmakerHeader.vue +21 -22
- package/src/components/display/podcasts/AnimatorsItem.vue +15 -16
- package/src/components/display/podcasts/DownloadPodcastButton.vue +21 -29
- package/src/components/display/podcasts/ParticipantDescription.vue +22 -24
- package/src/components/display/podcasts/PodcastFilterList.vue +62 -56
- package/src/components/display/podcasts/PodcastImage.vue +96 -99
- package/src/components/display/podcasts/PodcastInlineList.vue +30 -28
- package/src/components/display/podcasts/PodcastInlineListTemplate.vue +107 -114
- package/src/components/display/podcasts/PodcastIsPlaying.vue +4 -12
- package/src/components/display/podcasts/PodcastItem.vue +48 -63
- package/src/components/display/podcasts/PodcastItemInfo.vue +19 -35
- package/src/components/display/podcasts/PodcastList.vue +182 -206
- package/src/components/display/podcasts/PodcastModuleBox.vue +100 -137
- package/src/components/display/podcasts/PodcastPlannedSpinner.vue +4 -6
- package/src/components/display/podcasts/PodcastPlayBar.vue +50 -61
- package/src/components/display/podcasts/PodcastPlayBasicButton.vue +38 -41
- package/src/components/display/podcasts/PodcastPlayButton.vue +164 -175
- package/src/components/display/podcasts/PodcastRawTranscript.vue +69 -80
- package/src/components/display/podcasts/PodcastRubriqueList.vue +35 -38
- package/src/components/display/podcasts/PodcastSwiperList.vue +100 -110
- package/src/components/display/podcasts/TagList.vue +48 -50
- package/src/components/display/podcasts/VideoModuleBox.vue +13 -24
- package/src/components/display/rubriques/RubriqueChooser.vue +135 -140
- package/src/components/display/rubriques/RubriqueList.vue +140 -160
- package/src/components/display/sharing/ChooseEpisodesNumber.vue +34 -33
- package/src/components/display/sharing/FormatSwitch.vue +16 -11
- package/src/components/display/sharing/PlayerAnonymousModal.vue +24 -27
- package/src/components/display/sharing/PlayerCommonParameters.vue +20 -13
- package/src/components/display/sharing/PlayerParameters.vue +69 -71
- package/src/components/display/sharing/QrCode.vue +55 -67
- package/src/components/display/sharing/ShareAnonymous.vue +160 -178
- package/src/components/display/sharing/ShareDistribution.vue +103 -117
- package/src/components/display/sharing/ShareNewsletter.vue +154 -161
- package/src/components/display/sharing/SharePlayer.vue +273 -295
- package/src/components/display/sharing/SharePlayerColors.vue +25 -16
- package/src/components/display/sharing/SharePlayerRadio.vue +61 -69
- package/src/components/display/sharing/SharePlayerTypes.vue +176 -176
- package/src/components/display/sharing/ShareSocialsButtons.vue +63 -75
- package/src/components/display/sharing/SubscribeButtons.vue +184 -207
- package/src/components/display/studio/RecordingItemButton.vue +1 -4
- package/src/components/form/ClassicCheckbox.vue +26 -30
- package/src/components/form/ClassicContentEditable.vue +37 -33
- package/src/components/form/ClassicCopyButton.vue +40 -44
- package/src/components/form/ClassicDatePicker.vue +114 -114
- package/src/components/form/ClassicEmojiPicker.vue +20 -28
- package/src/components/form/ClassicInputText.vue +116 -120
- package/src/components/form/ClassicLoading.vue +7 -12
- package/src/components/form/ClassicMultiselect.vue +115 -117
- package/src/components/form/ClassicRadio.vue +21 -16
- package/src/components/form/ClassicRadioLabel.vue +23 -22
- package/src/components/form/ClassicSearch.vue +24 -19
- package/src/components/form/ClassicSelect.vue +47 -38
- package/src/components/form/ClassicWysiwyg.vue +116 -123
- package/src/components/icons/AmazonMusicIcon.vue +7 -10
- package/src/components/icons/ApplePodcastIcon.vue +7 -11
- package/src/components/icons/BlueSkyIcon.vue +8 -11
- package/src/components/icons/DeezerIcon.vue +8 -11
- package/src/components/icons/EditFtpIcon.vue +8 -11
- package/src/components/icons/IHeartIcon.vue +8 -11
- package/src/components/icons/PlayVideoIcon.vue +7 -10
- package/src/components/icons/PlayerFmIcon.vue +7 -10
- package/src/components/icons/PocketCastIcon.vue +8 -11
- package/src/components/icons/PodcastAddictIcon.vue +7 -10
- package/src/components/icons/RadiolineIcon.vue +8 -11
- package/src/components/icons/TuninIcon.vue +8 -11
- package/src/components/icons/XIcon.vue +7 -10
- package/src/components/misc/AcpmImage.vue +6 -7
- package/src/components/misc/ClassicAccordion.vue +26 -31
- package/src/components/misc/ClassicLazy.vue +86 -90
- package/src/components/misc/ClassicNav.vue +16 -20
- package/src/components/misc/ClassicPopover.vue +271 -282
- package/src/components/misc/ClassicSpinner.vue +5 -27
- package/src/components/misc/ErrorMessage.vue +11 -12
- package/src/components/misc/FooterGarSection.vue +33 -41
- package/src/components/misc/FooterSection.vue +94 -131
- package/src/components/misc/HomeDropdown.vue +83 -105
- package/src/components/misc/MobileMenu.vue +101 -111
- package/src/components/misc/ProgressBar.vue +53 -62
- package/src/components/misc/TopBar.vue +98 -120
- package/src/components/misc/TopBarMainContent.vue +114 -133
- package/src/components/misc/modal/ClassicModal.vue +40 -33
- package/src/components/misc/modal/ClassicModalInBody.vue +34 -28
- package/src/components/misc/modal/ClipboardModal.vue +27 -30
- package/src/components/misc/modal/ContractPreviewModal.vue +64 -62
- package/src/components/misc/modal/MessageModal.vue +50 -47
- package/src/components/misc/modal/NewsletterModal.vue +30 -31
- package/src/components/misc/modal/QrCodeModal.vue +21 -21
- package/src/components/misc/modal/ShareModalPlayer.vue +43 -52
- package/src/components/misc/player/PlayerCompact.vue +6 -4
- package/src/components/misc/player/PlayerComponent.vue +8 -9
- package/src/components/misc/player/PlayerLarge.vue +9 -8
- package/src/components/misc/player/ads/AdsProgressBar.vue +8 -11
- package/src/components/misc/player/ads/AdsSkipButton.vue +24 -30
- package/src/components/misc/player/chaptering/ChapteringModal.vue +44 -54
- package/src/components/misc/player/chaptering/PlayerChaptering.vue +50 -62
- package/src/components/misc/player/elements/PlayerImage.vue +51 -57
- package/src/components/misc/player/elements/PlayerPlayButton.vue +81 -92
- package/src/components/misc/player/elements/PlayerSpeedButton.vue +23 -27
- package/src/components/misc/player/elements/PlayerTitle.vue +85 -111
- package/src/components/misc/player/progressbar/PlayerProgressBar.vue +18 -29
- package/src/components/misc/player/progressbar/PodcastProgressBar.vue +45 -56
- package/src/components/misc/player/radio/RadioHistory.vue +80 -99
- package/src/components/misc/player/radio/RadioProgressBar.vue +43 -54
- package/src/components/misc/player/video/PlayerVideo.vue +27 -40
- package/src/components/misc/player/video/PlayerVideoDigiteka.vue +32 -37
- package/src/components/misc/player/video/PlayerVideoHls.vue +199 -198
- package/src/components/misc/player/video/PlayerYoutubeEmbed.vue +10 -12
- package/src/components/pages/CategoryPage.vue +28 -33
- package/src/components/pages/EmissionPage.vue +113 -132
- package/src/components/pages/EmissionsPage.vue +2 -0
- package/src/components/pages/Error403Page.vue +21 -20
- package/src/components/pages/HomePage.vue +91 -100
- package/src/components/pages/LivesPage.vue +35 -37
- package/src/components/pages/MapPage.vue +209 -241
- package/src/components/pages/PageLogout.vue +8 -11
- package/src/components/pages/PageNotFound.vue +9 -5
- package/src/components/pages/ParticipantPage.vue +96 -110
- package/src/components/pages/ParticipantsPage.vue +3 -0
- package/src/components/pages/PlaylistPage.vue +112 -117
- package/src/components/pages/PlaylistsPage.vue +9 -2
- package/src/components/pages/PodcastPage.vue +224 -238
- package/src/components/pages/PodcastsPage.vue +9 -2
- package/src/components/pages/RadioPage.vue +56 -70
- package/src/components/pages/RubriquePage.vue +7 -3
- package/src/components/pages/SearchPage.vue +31 -36
- package/src/components/pages/TagPage.vue +11 -9
- package/src/components/pages/VideoPage.vue +14 -11
- package/src/helper/displayHelper.ts +1 -1
- package/src/helper/loadScript.ts +4 -4
- package/src/i18n.ts +2 -2
- package/src/main.ts +1 -1
- package/src/router/router.ts +17 -4
- package/src/stores/AuthStore.ts +12 -12
- package/src/stores/FilterStore.ts +1 -1
- package/src/stores/VastStore.ts +2 -2
- package/src/stores/class/general/player.ts +1 -0
- package/public/css/fonts/icomoon.eot +0 -0
- package/public/css/fonts/icomoon.svg +0 -113
- package/public/css/fonts/icomoon.ttf +0 -0
- package/public/css/fonts/icomoon.woff +0 -0
- package/public/css/fonts/icomoon.woff2 +0 -0
- package/public/css/fonts/style.css +0 -352
- package/sonarqube-scanner.js +0 -10
|
@@ -6,19 +6,20 @@
|
|
|
6
6
|
v-model:is-mobile="isMobile"
|
|
7
7
|
:text-count="
|
|
8
8
|
showCount && podcasts.length > 1
|
|
9
|
-
?
|
|
9
|
+
? t('Number podcasts', { nb: totalCount }) + sortText
|
|
10
10
|
: undefined
|
|
11
11
|
"
|
|
12
12
|
:total-count="totalCount"
|
|
13
13
|
:loading="loading"
|
|
14
|
-
:loading-text="loading ?
|
|
14
|
+
:loading-text="loading ? t('Loading podcasts ...') : undefined"
|
|
15
15
|
:error-text="
|
|
16
16
|
!loading && !podcasts.length
|
|
17
|
-
?
|
|
17
|
+
? t(`No podcast match your query`)
|
|
18
18
|
: undefined
|
|
19
19
|
"
|
|
20
20
|
:just-size-chosen="justSizeChosen"
|
|
21
21
|
:player-responsive="true"
|
|
22
|
+
:force-update-parameters="forceUpdateParameters"
|
|
22
23
|
>
|
|
23
24
|
<template #list>
|
|
24
25
|
<div class="octopus-element-list">
|
|
@@ -34,7 +35,7 @@
|
|
|
34
35
|
name: 'podcast',
|
|
35
36
|
params: { podcastId: p.podcastId },
|
|
36
37
|
}"
|
|
37
|
-
:title="
|
|
38
|
+
:title="t('Episode name page', { name: p.title })"
|
|
38
39
|
>
|
|
39
40
|
{{ p.title }}
|
|
40
41
|
</router-link>
|
|
@@ -45,222 +46,197 @@
|
|
|
45
46
|
</ListPaginate>
|
|
46
47
|
</template>
|
|
47
48
|
|
|
48
|
-
<script lang="ts">
|
|
49
|
+
<script setup lang="ts">
|
|
49
50
|
import ListPaginate from "../list/ListPaginate.vue";
|
|
50
51
|
import {useErrorHandler} from "../../composable/useErrorHandler";
|
|
51
52
|
import classicApi from "../../../api/classicApi";
|
|
52
53
|
import PodcastItem from "./PodcastItem.vue";
|
|
53
54
|
import ClassicLazy from "../../misc/ClassicLazy.vue";
|
|
54
|
-
import { useAuthStore } from "../../../stores/AuthStore";
|
|
55
55
|
import { useFilterStore } from "../../../stores/FilterStore";
|
|
56
|
-
import { mapState } from "pinia";
|
|
57
56
|
import { Podcast, emptyPodcastData } from "@/stores/class/general/podcast";
|
|
58
|
-
import {
|
|
57
|
+
import { computed, onBeforeMount, Ref, ref, watch } from "vue";
|
|
59
58
|
import { FetchParam } from "@/stores/class/general/fetchParam";
|
|
60
59
|
import { AxiosError } from "axios";
|
|
61
60
|
import { ListClassicReturn } from "@/stores/class/general/listReturn";
|
|
62
|
-
|
|
63
|
-
name: "PodcastList",
|
|
61
|
+
import { useI18n } from "vue-i18n";
|
|
64
62
|
|
|
65
|
-
components: {
|
|
66
|
-
PodcastItem,
|
|
67
|
-
ListPaginate,
|
|
68
|
-
ClassicLazy,
|
|
69
|
-
},
|
|
70
63
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
},
|
|
96
|
-
|
|
64
|
+
//Props
|
|
65
|
+
const props = defineProps({
|
|
66
|
+
first: { default: 0, type: Number },
|
|
67
|
+
size: { default: 30, type: Number },
|
|
68
|
+
organisationId: { default: () => [], type: Array as () => Array<string> },
|
|
69
|
+
emissionId: { default: undefined, type: Number },
|
|
70
|
+
iabId: { default: undefined, type: Number },
|
|
71
|
+
participantId: { default: undefined, type: Number },
|
|
72
|
+
query: { default: undefined, type: String },
|
|
73
|
+
monetisable: { default: undefined, type: String },
|
|
74
|
+
popularSort: { default: false, type: Boolean },
|
|
75
|
+
reload: { default: false, type: Boolean },
|
|
76
|
+
before: { default: undefined, type: String },
|
|
77
|
+
after: { default: undefined, type: String },
|
|
78
|
+
includeHidden: { default: false, type: Boolean },
|
|
79
|
+
showCount: { default: false, type: Boolean },
|
|
80
|
+
displaySortText: { default: true, type: Boolean },
|
|
81
|
+
sortCriteria: { default: undefined, type: String },
|
|
82
|
+
validity: { default: 'true', type: String },
|
|
83
|
+
rubriqueId: { default: () => [], type: Array as () => Array<number> },
|
|
84
|
+
rubriquageId: { default: () => [], type: Array as () => Array<number> },
|
|
85
|
+
noRubriquageId: { default: () => [], type: Array as () => Array<number> },
|
|
86
|
+
justSizeChosen: { default: false, type: Boolean },
|
|
87
|
+
withVideo: { default: undefined, type: Boolean },
|
|
88
|
+
includeTag:{ default: () => [], type: Array as () => Array<string> },
|
|
89
|
+
forceUpdateParameters: { default: false, type: Boolean },
|
|
90
|
+
})
|
|
97
91
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
return { handle403 }
|
|
101
|
-
},
|
|
92
|
+
//Emits
|
|
93
|
+
const emit = defineEmits(["fetch", "emptyList"]);
|
|
102
94
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
isMobile: false as boolean,
|
|
111
|
-
};
|
|
112
|
-
},
|
|
95
|
+
//Data
|
|
96
|
+
const loading = ref(true);
|
|
97
|
+
const dfirst = ref(props.first);
|
|
98
|
+
const dsize = ref(props.size);
|
|
99
|
+
const totalCount = ref(0);
|
|
100
|
+
const isMobile = ref(false);
|
|
101
|
+
const podcasts: Ref<Array<Podcast>> = ref([]);
|
|
113
102
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
sort(): string {
|
|
142
|
-
return this.popularSort ? "POPULARITY" : (this.sortCriteria ?? "DATE");
|
|
143
|
-
},
|
|
144
|
-
sortText(): string {
|
|
145
|
-
if (!this.displaySortText) {
|
|
146
|
-
return "";
|
|
147
|
-
}
|
|
148
|
-
switch (this.sortCriteria) {
|
|
149
|
-
case "SCORE":
|
|
150
|
-
return " " + this.$t("sort by score");
|
|
151
|
-
case "DATE":
|
|
152
|
-
return " " + this.$t("sort by date");
|
|
153
|
-
case "NAME":
|
|
154
|
-
return " " + this.$t("sort by alphabetical");
|
|
155
|
-
default:
|
|
156
|
-
return " " + this.$t("sort by date");
|
|
157
|
-
}
|
|
158
|
-
},
|
|
159
|
-
},
|
|
160
|
-
watch: {
|
|
161
|
-
changePaginate() {
|
|
162
|
-
this.dfirst = this.first;
|
|
163
|
-
this.dsize = this.size;
|
|
164
|
-
},
|
|
165
|
-
changed(): void {
|
|
166
|
-
this.reloadList();
|
|
167
|
-
},
|
|
168
|
-
reload(): void {
|
|
169
|
-
this.reloadList();
|
|
170
|
-
},
|
|
171
|
-
dsize(): void {
|
|
172
|
-
this.reloadList();
|
|
173
|
-
},
|
|
174
|
-
dfirst(): void {
|
|
175
|
-
if (
|
|
176
|
-
!this.podcasts[this.dfirst] ||
|
|
177
|
-
0 === this.podcasts[this.dfirst].podcastId
|
|
178
|
-
) {
|
|
179
|
-
this.fetchContent(false);
|
|
180
|
-
}
|
|
181
|
-
},
|
|
182
|
-
},
|
|
183
|
-
created() {
|
|
184
|
-
this.fetchContent(true);
|
|
185
|
-
},
|
|
186
|
-
methods: {
|
|
187
|
-
reloadList() {
|
|
188
|
-
this.dfirst = 0;
|
|
189
|
-
this.fetchContent(true);
|
|
190
|
-
},
|
|
191
|
-
async fetchContent(reset: boolean): Promise<void> {
|
|
192
|
-
this.loading = true;
|
|
193
|
-
const param: FetchParam = {
|
|
194
|
-
first: this.dfirst,
|
|
195
|
-
size: this.dsize,
|
|
196
|
-
organisationId: this.organisation,
|
|
197
|
-
emissionId: this.emissionId,
|
|
198
|
-
iabId: this.iabId,
|
|
199
|
-
participantId: this.participantId,
|
|
200
|
-
query: this.query,
|
|
201
|
-
monetisable: this.monetisable,
|
|
202
|
-
sort: this.sort,
|
|
203
|
-
before: this.before,
|
|
204
|
-
after: this.after,
|
|
205
|
-
noRubriquageId: this.noRubriquageId.length
|
|
206
|
-
? this.noRubriquageId
|
|
207
|
-
: undefined,
|
|
208
|
-
rubriqueId: this.rubriqueId.length ? this.rubriqueId : undefined,
|
|
209
|
-
rubriquageId: this.rubriquageId.length ? this.rubriquageId : undefined,
|
|
210
|
-
includeHidden: this.includeHidden,
|
|
211
|
-
validity: this.validity,
|
|
212
|
-
/* publisherId:
|
|
213
|
-
!this.onlyValid && !this.isRoleProduction
|
|
214
|
-
? this.authProfile?.userId
|
|
215
|
-
: undefined, */
|
|
216
|
-
includeStatus: ["READY", "PROCESSING"],
|
|
217
|
-
withVideo: this.withVideo,
|
|
218
|
-
includeTag: this.includeTag.length ? this.includeTag : undefined,
|
|
219
|
-
};
|
|
220
|
-
try {
|
|
221
|
-
const data = await classicApi.fetchData<ListClassicReturn<Podcast>>({
|
|
222
|
-
api: 0,
|
|
223
|
-
path: "podcast/search",
|
|
224
|
-
parameters: param,
|
|
225
|
-
specialTreatement: true,
|
|
226
|
-
});
|
|
227
|
-
this.afterFetching(reset, data);
|
|
228
|
-
} catch (error) {
|
|
229
|
-
this.handle403(error as AxiosError);
|
|
230
|
-
}
|
|
231
|
-
},
|
|
232
|
-
afterFetching(
|
|
233
|
-
reset: boolean,
|
|
234
|
-
data: { count: number; result: Array<Podcast>; sort: string },
|
|
235
|
-
): void {
|
|
236
|
-
if (reset) {
|
|
237
|
-
this.podcasts.length = 0;
|
|
238
|
-
}
|
|
239
|
-
if (this.dfirst > this.podcasts.length) {
|
|
240
|
-
for (
|
|
241
|
-
let i = this.podcasts.length - 1, len = this.dfirst + this.dsize;
|
|
242
|
-
i < len;
|
|
243
|
-
i++
|
|
244
|
-
) {
|
|
245
|
-
this.podcasts.push(emptyPodcastData());
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
const responsePodcasts = data.result.filter((p: Podcast | null) => {
|
|
249
|
-
return null !== p;
|
|
250
|
-
});
|
|
251
|
-
this.podcasts = this.podcasts
|
|
252
|
-
.slice(0, this.dfirst)
|
|
253
|
-
.concat(responsePodcasts)
|
|
254
|
-
.concat(
|
|
255
|
-
this.podcasts.slice(this.dfirst + this.dsize, this.podcasts.length),
|
|
256
|
-
);
|
|
257
|
-
this.$emit("fetch", this.podcasts);
|
|
258
|
-
this.totalCount = this.justSizeChosen ? this.size : data.count;
|
|
259
|
-
if (0 === this.podcasts.length) {
|
|
260
|
-
this.$emit("emptyList");
|
|
261
|
-
}
|
|
262
|
-
this.loading = false;
|
|
263
|
-
},
|
|
264
|
-
},
|
|
103
|
+
//Composables
|
|
104
|
+
const { t } = useI18n();
|
|
105
|
+
const {handle403} = useErrorHandler();
|
|
106
|
+
const filterStore = useFilterStore();
|
|
107
|
+
|
|
108
|
+
//Computed
|
|
109
|
+
const displayArray = computed(() => {
|
|
110
|
+
if (isMobile.value || props.justSizeChosen) {
|
|
111
|
+
return podcasts.value;
|
|
112
|
+
}
|
|
113
|
+
return podcasts.value.slice(
|
|
114
|
+
dfirst.value,
|
|
115
|
+
Math.min(dfirst.value + dsize.value, totalCount.value),
|
|
116
|
+
);
|
|
117
|
+
});
|
|
118
|
+
const changePaginate = computed(() => `${props.first}|${props.size}`);
|
|
119
|
+
const changed = computed(() => {
|
|
120
|
+
return `${organisation.value}|${props.emissionId}|${props.sortCriteria}|${sort.value}
|
|
121
|
+
${props.iabId}|${props.participantId}|${props.query}|${props.monetisable}|${props.popularSort}|
|
|
122
|
+
${props.rubriqueId}|${props.rubriquageId}|${props.before}|${props.after}|${props.includeHidden}|${props.noRubriquageId}|${props.validity}|
|
|
123
|
+
${props.withVideo}|${props.includeTag}`;
|
|
124
|
+
});
|
|
125
|
+
const organisation = computed(() => {
|
|
126
|
+
if (props.organisationId) {
|
|
127
|
+
return props.organisationId;
|
|
128
|
+
}
|
|
129
|
+
return filterStore.filterOrgaId ? [filterStore.filterOrgaId] : [];
|
|
265
130
|
});
|
|
131
|
+
const sort = computed(() => props.popularSort ? "POPULARITY" : (props.sortCriteria ?? "DATE"));
|
|
132
|
+
const sortText = computed(() => {
|
|
133
|
+
if (!props.displaySortText) {
|
|
134
|
+
return "";
|
|
135
|
+
}
|
|
136
|
+
switch (props.sortCriteria) {
|
|
137
|
+
case "SCORE":
|
|
138
|
+
return " " + t("sort by score");
|
|
139
|
+
case "DATE":
|
|
140
|
+
return " " + t("sort by date");
|
|
141
|
+
case "NAME":
|
|
142
|
+
return " " + t("sort by alphabetical");
|
|
143
|
+
default:
|
|
144
|
+
return " " + t("sort by date");
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
//Watch
|
|
149
|
+
watch(changePaginate, () => {
|
|
150
|
+
dfirst.value = props.first;
|
|
151
|
+
dsize.value = props.size;
|
|
152
|
+
});
|
|
153
|
+
watch(changed, () => fetchContent(true));
|
|
154
|
+
watch(()=>props.reload, () => fetchContent(true));
|
|
155
|
+
watch(dsize, () => fetchContent(true));
|
|
156
|
+
watch(dfirst, () => {
|
|
157
|
+
if (
|
|
158
|
+
!podcasts.value[dfirst.value] ||
|
|
159
|
+
0 === podcasts.value[dfirst.value].podcastId
|
|
160
|
+
) {
|
|
161
|
+
fetchContent(false);
|
|
162
|
+
}
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
onBeforeMount(()=>fetchContent(false))
|
|
166
|
+
|
|
167
|
+
//Methods
|
|
168
|
+
async function fetchContent(reset: boolean): Promise<void> {
|
|
169
|
+
loading.value = true;
|
|
170
|
+
const param: FetchParam = {
|
|
171
|
+
first: reset ? 0 : dfirst.value,
|
|
172
|
+
size: dsize.value,
|
|
173
|
+
organisationId: organisation.value,
|
|
174
|
+
emissionId: props.emissionId,
|
|
175
|
+
iabId: props.iabId,
|
|
176
|
+
participantId: props.participantId,
|
|
177
|
+
query: props.query,
|
|
178
|
+
monetisable: props.monetisable,
|
|
179
|
+
sort: sort.value,
|
|
180
|
+
before: props.before,
|
|
181
|
+
after: props.after,
|
|
182
|
+
noRubriquageId: props.noRubriquageId.length
|
|
183
|
+
? props.noRubriquageId
|
|
184
|
+
: undefined,
|
|
185
|
+
rubriqueId: props.rubriqueId.length ? props.rubriqueId : undefined,
|
|
186
|
+
rubriquageId: props.rubriquageId.length ? props.rubriquageId : undefined,
|
|
187
|
+
includeHidden: props.includeHidden,
|
|
188
|
+
validity: props.validity,
|
|
189
|
+
/* publisherId:
|
|
190
|
+
!this.onlyValid && !authStore.isRoleProduction
|
|
191
|
+
? authStore.authProfile?.userId
|
|
192
|
+
: undefined, */
|
|
193
|
+
includeStatus: ["READY", "PROCESSING"],
|
|
194
|
+
withVideo: props.withVideo,
|
|
195
|
+
includeTag: props.includeTag.length ? props.includeTag : undefined,
|
|
196
|
+
};
|
|
197
|
+
try {
|
|
198
|
+
const data = await classicApi.fetchData<ListClassicReturn<Podcast>>({
|
|
199
|
+
api: 0,
|
|
200
|
+
path: "podcast/search",
|
|
201
|
+
parameters: param,
|
|
202
|
+
specialTreatement: true,
|
|
203
|
+
});
|
|
204
|
+
afterFetching(reset, data);
|
|
205
|
+
} catch (error) {
|
|
206
|
+
handle403(error as AxiosError);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
function afterFetching(
|
|
210
|
+
reset: boolean,
|
|
211
|
+
data: { count: number; result: Array<Podcast>; sort: string },
|
|
212
|
+
): void {
|
|
213
|
+
if (reset) {
|
|
214
|
+
dfirst.value = 0;
|
|
215
|
+
podcasts.value.length = 0;
|
|
216
|
+
}
|
|
217
|
+
if (dfirst.value > podcasts.value.length) {
|
|
218
|
+
for (
|
|
219
|
+
let i = podcasts.value.length - 1, len = dfirst.value + dsize.value;
|
|
220
|
+
i < len;
|
|
221
|
+
i++
|
|
222
|
+
) {
|
|
223
|
+
podcasts.value.push(emptyPodcastData());
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
const responsePodcasts = data.result.filter((p: Podcast | null) => {
|
|
227
|
+
return null !== p;
|
|
228
|
+
});
|
|
229
|
+
podcasts.value = podcasts.value
|
|
230
|
+
.slice(0, dfirst.value)
|
|
231
|
+
.concat(responsePodcasts)
|
|
232
|
+
.concat(
|
|
233
|
+
podcasts.value.slice(dfirst.value + dsize.value, podcasts.value.length),
|
|
234
|
+
);
|
|
235
|
+
emit("fetch", podcasts.value);
|
|
236
|
+
totalCount.value = props.justSizeChosen ? props.size : data.count;
|
|
237
|
+
if (0 === podcasts.value.length) {
|
|
238
|
+
emit("emptyList");
|
|
239
|
+
}
|
|
240
|
+
loading.value = false;
|
|
241
|
+
}
|
|
266
242
|
</script>
|