@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.
Files changed (214) hide show
  1. package/index.ts +2 -1
  2. package/package.json +4 -3
  3. package/src/App.vue +71 -95
  4. package/src/components/composable/player/usePlayerLive.ts +13 -4
  5. package/src/components/composable/player/usePlayerLogic.ts +6 -6
  6. package/src/components/composable/player/usePlayerVast.ts +7 -7
  7. package/src/components/composable/podcasts/usePodcastView.ts +3 -3
  8. package/src/components/composable/route/useAdvancedParamInit.ts +1 -1
  9. package/src/components/composable/route/useRouteUpdateParams.ts +4 -4
  10. package/src/components/composable/route/useSimplePageParam.ts +15 -8
  11. package/src/components/composable/useInit.ts +2 -2
  12. package/src/components/composable/useMetaTitleWatch.ts +2 -2
  13. package/src/components/display/accessibility/AccessibilityModal.vue +56 -68
  14. package/src/components/display/categories/CategoryChooser.vue +144 -145
  15. package/src/components/display/categories/CategoryFilter.vue +172 -198
  16. package/src/components/display/categories/CategoryList.vue +122 -147
  17. package/src/components/display/comments/CommentInput.vue +100 -122
  18. package/src/components/display/comments/CommentList.vue +169 -191
  19. package/src/components/display/comments/CommentName.vue +35 -45
  20. package/src/components/display/comments/CommentParentInfo.vue +28 -34
  21. package/src/components/display/comments/CommentPlayer.vue +38 -50
  22. package/src/components/display/comments/CommentSection.vue +85 -103
  23. package/src/components/display/comments/item/CommentBasicView.vue +48 -61
  24. package/src/components/display/comments/item/CommentItem.vue +104 -115
  25. package/src/components/display/comments/item/CommentMoreActions.vue +174 -189
  26. package/src/components/display/comments/item/CommentMoreActionsAdmin.vue +1 -3
  27. package/src/components/display/comments/like/LikeButton.vue +36 -41
  28. package/src/components/display/comments/like/LikeSection.vue +128 -136
  29. package/src/components/display/comments/modal/CheckIdentityModal.vue +35 -40
  30. package/src/components/display/comments/modal/EditCommentModal.vue +72 -78
  31. package/src/components/display/comments/modal/RecaptchaModal.vue +58 -63
  32. package/src/components/display/comments/modal/ReportAbuseModal.vue +59 -66
  33. package/src/components/display/edit/EditBox.vue +9 -8
  34. package/src/components/display/edit/EditBoxRadio.vue +1 -5
  35. package/src/components/display/emission/EmissionInlineList.vue +82 -97
  36. package/src/components/display/emission/EmissionItem.vue +57 -69
  37. package/src/components/display/emission/EmissionList.vue +189 -218
  38. package/src/components/display/emission/EmissionPlayerItem.vue +47 -64
  39. package/src/components/display/emission/EmissionPresentationItem.vue +44 -54
  40. package/src/components/display/emission/EmissionPresentationList.vue +51 -61
  41. package/src/components/display/filter/AdvancedSearch.vue +151 -176
  42. package/src/components/display/filter/CategorySearchFilter.vue +43 -46
  43. package/src/components/display/filter/DateFilter.vue +76 -91
  44. package/src/components/display/filter/MonetizableFilter.vue +27 -30
  45. package/src/components/display/filter/ProductorSearch.vue +87 -90
  46. package/src/components/display/filter/RubriqueChoice.vue +58 -63
  47. package/src/components/display/filter/RubriqueFilter.vue +154 -169
  48. package/src/components/display/filter/SearchOrder.vue +35 -35
  49. package/src/components/display/list/ListPaginate.vue +72 -93
  50. package/src/components/display/list/PaginateParams.vue +36 -40
  51. package/src/components/display/list/PaginateSection.vue +113 -124
  52. package/src/components/display/list/SwiperList.vue +97 -109
  53. package/src/components/display/live/CountDown.vue +15 -9
  54. package/src/components/display/live/CountdownOctopus.vue +16 -10
  55. package/src/components/display/live/LiveHorizontalList.vue +95 -103
  56. package/src/components/display/live/LiveItem.vue +64 -73
  57. package/src/components/display/live/LiveList.vue +125 -137
  58. package/src/components/display/live/RadioCurrently.vue +66 -73
  59. package/src/components/display/live/RadioImage.vue +39 -50
  60. package/src/components/display/live/RadioItem.vue +9 -14
  61. package/src/components/display/live/RadioList.vue +39 -53
  62. package/src/components/display/live/RadioPlanning.vue +210 -222
  63. package/src/components/display/organisation/OrganisationChooser.vue +116 -122
  64. package/src/components/display/organisation/OrganisationChooserLight.vue +44 -52
  65. package/src/components/display/participant/ParticipantInlineList.vue +42 -58
  66. package/src/components/display/participant/ParticipantItem.vue +66 -74
  67. package/src/components/display/participant/ParticipantList.vue +116 -141
  68. package/src/components/display/playlist/PlaylistItem.vue +33 -46
  69. package/src/components/display/playlist/PlaylistList.vue +115 -144
  70. package/src/components/display/playlist/PodcastList.vue +90 -103
  71. package/src/components/display/playlist/PodcastPlaylistInlineList.vue +58 -70
  72. package/src/components/display/podcastmaker/PodcastmakerHeader.vue +21 -22
  73. package/src/components/display/podcasts/AnimatorsItem.vue +15 -16
  74. package/src/components/display/podcasts/DownloadPodcastButton.vue +21 -29
  75. package/src/components/display/podcasts/ParticipantDescription.vue +22 -24
  76. package/src/components/display/podcasts/PodcastFilterList.vue +62 -56
  77. package/src/components/display/podcasts/PodcastImage.vue +96 -99
  78. package/src/components/display/podcasts/PodcastInlineList.vue +30 -28
  79. package/src/components/display/podcasts/PodcastInlineListTemplate.vue +107 -114
  80. package/src/components/display/podcasts/PodcastIsPlaying.vue +4 -12
  81. package/src/components/display/podcasts/PodcastItem.vue +48 -63
  82. package/src/components/display/podcasts/PodcastItemInfo.vue +19 -35
  83. package/src/components/display/podcasts/PodcastList.vue +182 -206
  84. package/src/components/display/podcasts/PodcastModuleBox.vue +100 -137
  85. package/src/components/display/podcasts/PodcastPlannedSpinner.vue +4 -6
  86. package/src/components/display/podcasts/PodcastPlayBar.vue +50 -61
  87. package/src/components/display/podcasts/PodcastPlayBasicButton.vue +38 -41
  88. package/src/components/display/podcasts/PodcastPlayButton.vue +164 -175
  89. package/src/components/display/podcasts/PodcastRawTranscript.vue +69 -80
  90. package/src/components/display/podcasts/PodcastRubriqueList.vue +35 -38
  91. package/src/components/display/podcasts/PodcastSwiperList.vue +100 -110
  92. package/src/components/display/podcasts/TagList.vue +48 -50
  93. package/src/components/display/podcasts/VideoModuleBox.vue +13 -24
  94. package/src/components/display/rubriques/RubriqueChooser.vue +135 -140
  95. package/src/components/display/rubriques/RubriqueList.vue +140 -160
  96. package/src/components/display/sharing/ChooseEpisodesNumber.vue +34 -33
  97. package/src/components/display/sharing/FormatSwitch.vue +16 -11
  98. package/src/components/display/sharing/PlayerAnonymousModal.vue +24 -27
  99. package/src/components/display/sharing/PlayerCommonParameters.vue +20 -13
  100. package/src/components/display/sharing/PlayerParameters.vue +69 -71
  101. package/src/components/display/sharing/QrCode.vue +55 -67
  102. package/src/components/display/sharing/ShareAnonymous.vue +160 -178
  103. package/src/components/display/sharing/ShareDistribution.vue +103 -117
  104. package/src/components/display/sharing/ShareNewsletter.vue +154 -161
  105. package/src/components/display/sharing/SharePlayer.vue +273 -295
  106. package/src/components/display/sharing/SharePlayerColors.vue +25 -16
  107. package/src/components/display/sharing/SharePlayerRadio.vue +61 -69
  108. package/src/components/display/sharing/SharePlayerTypes.vue +176 -176
  109. package/src/components/display/sharing/ShareSocialsButtons.vue +63 -75
  110. package/src/components/display/sharing/SubscribeButtons.vue +184 -207
  111. package/src/components/display/studio/RecordingItemButton.vue +1 -4
  112. package/src/components/form/ClassicCheckbox.vue +26 -30
  113. package/src/components/form/ClassicContentEditable.vue +37 -33
  114. package/src/components/form/ClassicCopyButton.vue +40 -44
  115. package/src/components/form/ClassicDatePicker.vue +114 -114
  116. package/src/components/form/ClassicEmojiPicker.vue +20 -28
  117. package/src/components/form/ClassicInputText.vue +116 -120
  118. package/src/components/form/ClassicLoading.vue +7 -12
  119. package/src/components/form/ClassicMultiselect.vue +115 -117
  120. package/src/components/form/ClassicRadio.vue +21 -16
  121. package/src/components/form/ClassicRadioLabel.vue +23 -22
  122. package/src/components/form/ClassicSearch.vue +24 -19
  123. package/src/components/form/ClassicSelect.vue +47 -38
  124. package/src/components/form/ClassicWysiwyg.vue +116 -123
  125. package/src/components/icons/AmazonMusicIcon.vue +7 -10
  126. package/src/components/icons/ApplePodcastIcon.vue +7 -11
  127. package/src/components/icons/BlueSkyIcon.vue +8 -11
  128. package/src/components/icons/DeezerIcon.vue +8 -11
  129. package/src/components/icons/EditFtpIcon.vue +8 -11
  130. package/src/components/icons/IHeartIcon.vue +8 -11
  131. package/src/components/icons/PlayVideoIcon.vue +7 -10
  132. package/src/components/icons/PlayerFmIcon.vue +7 -10
  133. package/src/components/icons/PocketCastIcon.vue +8 -11
  134. package/src/components/icons/PodcastAddictIcon.vue +7 -10
  135. package/src/components/icons/RadiolineIcon.vue +8 -11
  136. package/src/components/icons/TuninIcon.vue +8 -11
  137. package/src/components/icons/XIcon.vue +7 -10
  138. package/src/components/misc/AcpmImage.vue +6 -7
  139. package/src/components/misc/ClassicAccordion.vue +26 -31
  140. package/src/components/misc/ClassicLazy.vue +86 -90
  141. package/src/components/misc/ClassicNav.vue +16 -20
  142. package/src/components/misc/ClassicPopover.vue +271 -282
  143. package/src/components/misc/ClassicSpinner.vue +5 -27
  144. package/src/components/misc/ErrorMessage.vue +11 -12
  145. package/src/components/misc/FooterGarSection.vue +33 -41
  146. package/src/components/misc/FooterSection.vue +94 -131
  147. package/src/components/misc/HomeDropdown.vue +83 -105
  148. package/src/components/misc/MobileMenu.vue +101 -111
  149. package/src/components/misc/ProgressBar.vue +53 -62
  150. package/src/components/misc/TopBar.vue +98 -120
  151. package/src/components/misc/TopBarMainContent.vue +114 -133
  152. package/src/components/misc/modal/ClassicModal.vue +40 -33
  153. package/src/components/misc/modal/ClassicModalInBody.vue +34 -28
  154. package/src/components/misc/modal/ClipboardModal.vue +27 -30
  155. package/src/components/misc/modal/ContractPreviewModal.vue +64 -62
  156. package/src/components/misc/modal/MessageModal.vue +50 -47
  157. package/src/components/misc/modal/NewsletterModal.vue +30 -31
  158. package/src/components/misc/modal/QrCodeModal.vue +21 -21
  159. package/src/components/misc/modal/ShareModalPlayer.vue +43 -52
  160. package/src/components/misc/player/PlayerCompact.vue +6 -4
  161. package/src/components/misc/player/PlayerComponent.vue +8 -9
  162. package/src/components/misc/player/PlayerLarge.vue +9 -8
  163. package/src/components/misc/player/ads/AdsProgressBar.vue +8 -11
  164. package/src/components/misc/player/ads/AdsSkipButton.vue +24 -30
  165. package/src/components/misc/player/chaptering/ChapteringModal.vue +44 -54
  166. package/src/components/misc/player/chaptering/PlayerChaptering.vue +50 -62
  167. package/src/components/misc/player/elements/PlayerImage.vue +51 -57
  168. package/src/components/misc/player/elements/PlayerPlayButton.vue +81 -92
  169. package/src/components/misc/player/elements/PlayerSpeedButton.vue +23 -27
  170. package/src/components/misc/player/elements/PlayerTitle.vue +85 -111
  171. package/src/components/misc/player/progressbar/PlayerProgressBar.vue +18 -29
  172. package/src/components/misc/player/progressbar/PodcastProgressBar.vue +45 -56
  173. package/src/components/misc/player/radio/RadioHistory.vue +80 -99
  174. package/src/components/misc/player/radio/RadioProgressBar.vue +43 -54
  175. package/src/components/misc/player/video/PlayerVideo.vue +27 -40
  176. package/src/components/misc/player/video/PlayerVideoDigiteka.vue +32 -37
  177. package/src/components/misc/player/video/PlayerVideoHls.vue +199 -198
  178. package/src/components/misc/player/video/PlayerYoutubeEmbed.vue +10 -12
  179. package/src/components/pages/CategoryPage.vue +28 -33
  180. package/src/components/pages/EmissionPage.vue +113 -132
  181. package/src/components/pages/EmissionsPage.vue +2 -0
  182. package/src/components/pages/Error403Page.vue +21 -20
  183. package/src/components/pages/HomePage.vue +91 -100
  184. package/src/components/pages/LivesPage.vue +35 -37
  185. package/src/components/pages/MapPage.vue +209 -241
  186. package/src/components/pages/PageLogout.vue +8 -11
  187. package/src/components/pages/PageNotFound.vue +9 -5
  188. package/src/components/pages/ParticipantPage.vue +96 -110
  189. package/src/components/pages/ParticipantsPage.vue +3 -0
  190. package/src/components/pages/PlaylistPage.vue +112 -117
  191. package/src/components/pages/PlaylistsPage.vue +9 -2
  192. package/src/components/pages/PodcastPage.vue +224 -238
  193. package/src/components/pages/PodcastsPage.vue +9 -2
  194. package/src/components/pages/RadioPage.vue +56 -70
  195. package/src/components/pages/RubriquePage.vue +7 -3
  196. package/src/components/pages/SearchPage.vue +31 -36
  197. package/src/components/pages/TagPage.vue +11 -9
  198. package/src/components/pages/VideoPage.vue +14 -11
  199. package/src/helper/displayHelper.ts +1 -1
  200. package/src/helper/loadScript.ts +4 -4
  201. package/src/i18n.ts +2 -2
  202. package/src/main.ts +1 -1
  203. package/src/router/router.ts +17 -4
  204. package/src/stores/AuthStore.ts +12 -12
  205. package/src/stores/FilterStore.ts +1 -1
  206. package/src/stores/VastStore.ts +2 -2
  207. package/src/stores/class/general/player.ts +1 -0
  208. package/public/css/fonts/icomoon.eot +0 -0
  209. package/public/css/fonts/icomoon.svg +0 -113
  210. package/public/css/fonts/icomoon.ttf +0 -0
  211. package/public/css/fonts/icomoon.woff +0 -0
  212. package/public/css/fonts/icomoon.woff2 +0 -0
  213. package/public/css/fonts/style.css +0 -352
  214. package/sonarqube-scanner.js +0 -10
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <section class="page-box">
3
- <template v-if="loaded && !error">
3
+ <template v-if="loaded && !error && podcast">
4
4
  <PodcastmakerHeader
5
5
  v-if="isPodcastmaker"
6
6
  :page-title="titlePage"
@@ -17,7 +17,7 @@
17
17
  @update-podcast="updatePodcast"
18
18
  />
19
19
  <ShareSocialsButtons
20
- v-if="pageParameters.isShareButtons"
20
+ v-if="state.podcastPage.ShareButtons"
21
21
  :organisation-id="podcast.organisation.id"
22
22
  />
23
23
  <SharePlayer
@@ -30,8 +30,8 @@
30
30
  <PodcastInlineList
31
31
  :emission-id="podcast.emission.emissionId"
32
32
  :href="'/main/pub/emission/' + podcast.emission.emissionId"
33
- :title="$t('More episodes of this emission')"
34
- :button-text="$t('All podcast emission button')"
33
+ :title="t('More episodes of this emission')"
34
+ :button-text="t('All podcast emission button')"
35
35
  title-tag="h3"
36
36
  />
37
37
  <section v-if="!hideSuggestions">
@@ -40,7 +40,7 @@
40
40
  class="mt-4"
41
41
  title-tag="h3"
42
42
  :podcast-id="podcastId"
43
- :title="$t('Suggested listening')"
43
+ :title="t('Suggested listening')"
44
44
  />
45
45
  </ClassicLazy>
46
46
  <ClassicLazy v-for="c in categories" :key="c.id" :min-height="550">
@@ -49,25 +49,25 @@
49
49
  title-tag="h3"
50
50
  :iab-id="c.id"
51
51
  :href="'/main/pub/category/' + c.id"
52
- :title="$t('More episodes of this category : ', { name: c.name })"
53
- :button-text="$t('All podcast button', { name: c.name })"
52
+ :title="t('More episodes of this category : ', { name: c.name })"
53
+ :button-text="t('All podcast button', { name: c.name })"
54
54
  />
55
55
  </ClassicLazy>
56
56
  </section>
57
57
  </div>
58
58
  </template>
59
59
  <ClassicLoading
60
- :loading-text="!loaded ? $t('Loading content ...') : undefined"
60
+ :loading-text="!loaded ? t('Loading content ...') : undefined"
61
61
  :error-text="
62
62
  error
63
- ? $t(`This episode is not available for (re)listening`)
63
+ ? t(`This episode is not available for (re)listening`)
64
64
  : undefined
65
65
  "
66
66
  />
67
67
  </section>
68
68
  </template>
69
69
 
70
- <script lang="ts">
70
+ <script setup lang="ts">
71
71
  import youtubeVideoHelper from "../../helper/youtubeVideoHelper";
72
72
  import {useOrgaComputed} from "../composable/useOrgaComputed";
73
73
  import PodcastInlineList from "../display/podcasts/PodcastInlineList.vue";
@@ -84,13 +84,14 @@ import {
84
84
  } from "@/stores/class/conference/conference";
85
85
  import {useErrorHandler} from "../composable/useErrorHandler";
86
86
  import {useSeoTitleUrl} from "../composable/route/useSeoTitleUrl";
87
- import { defineComponent, defineAsyncComponent } from "vue";
87
+ import { computed, defineAsyncComponent, onBeforeUnmount, ref, Ref, watch } from "vue";
88
88
  import { Category } from "@/stores/class/general/category";
89
89
  import { useAuthStore } from "../../stores/AuthStore";
90
90
  import { useGeneralStore } from "../../stores/GeneralStore";
91
- import { mapState, mapActions } from "pinia";
92
91
  import { AxiosError } from "axios";
93
92
  import { useCommentStore } from "../../stores/CommentStore";
93
+ import { useI18n } from "vue-i18n";
94
+ import { useRoute } from "vue-router";
94
95
  const ShareSocialsButtons = defineAsyncComponent(
95
96
  () => import("../display/sharing/ShareSocialsButtons.vue"),
96
97
  );
@@ -103,240 +104,225 @@ const CommentSection = defineAsyncComponent(
103
104
  const PodcastmakerHeader = defineAsyncComponent(
104
105
  () => import("../display/podcastmaker/PodcastmakerHeader.vue"),
105
106
  );
106
- export default defineComponent({
107
- name: "PodcastPage",
108
- components: {
109
- PodcastInlineList,
110
- ShareSocialsButtons,
111
- SharePlayer,
112
- CommentSection,
113
- PodcastModuleBox,
114
- ClassicLoading,
115
- ClassicLazy,
116
- PodcastmakerHeader,
117
- },
118
107
 
119
- props: {
120
- updateStatus: { default: undefined, type: String },
121
- playingPodcast: { default: undefined, type: Object as () => Podcast },
122
- podcastId: { default: 0, type: Number },
123
- },
108
+ //Props
109
+ const props = defineProps({
110
+ updateStatus: { default: undefined, type: String },
111
+ playingPodcast: { default: undefined, type: Object as () => Podcast },
112
+ podcastId: { default: 0, type: Number },
113
+ });
114
+
124
115
 
125
- setup(){
126
- const { isPodcastmaker, isEditRights, authOrgaId } = useOrgaComputed();
127
- const { updatePathParams } = useSeoTitleUrl();
128
- const {handle403} = useErrorHandler();
129
- return { isPodcastmaker, isEditRights, authOrgaId, updatePathParams, handle403 }
130
- },
116
+ //Data
117
+ const loaded = ref(false);
118
+ const error = ref(false);
119
+ const podcast: Ref<Podcast | undefined> = ref(undefined);
120
+ const fetchConference: Ref<Conference | undefined> = ref(undefined);
121
+ const infoReload: Ref<ReturnType<typeof setTimeout>| undefined> = ref(undefined);
122
+ const youtubeId: Ref<string| undefined> = ref(undefined);
131
123
 
132
- data() {
133
- return {
134
- loaded: false as boolean,
135
- podcast: undefined as Podcast | undefined,
136
- error: false as boolean,
137
- fetchConference: undefined as Conference | undefined,
138
- infoReload: undefined as ReturnType<typeof setTimeout> | undefined,
139
- youtubeId: undefined as string|undefined,
140
- };
141
- },
124
+ //Composables
125
+ const route = useRoute();
126
+ const { t } = useI18n();
127
+ const { isPodcastmaker, isEditRights, authOrgaId } = useOrgaComputed();
128
+ const { updatePathParams } = useSeoTitleUrl();
129
+ const {handle403} = useErrorHandler();
130
+ const authStore = useAuthStore();
131
+ const generalStore = useGeneralStore();
132
+ const filterStore = useFilterStore();
133
+ const commentStore = useCommentStore();
134
+
135
+ //Computed
136
+ const hideSuggestions = computed(() =>{
137
+ return (
138
+ "true" ===
139
+ (podcast.value?.emission?.annotations?.["HIDE_SUGGESTIONS"] as
140
+ | string
141
+ | undefined)
142
+ );
143
+ });
144
+ const emissionMainCategory = computed(() =>{
145
+ if (!podcast.value) {
146
+ return 0;
147
+ }
148
+ if (podcast.value.emission.annotations?.mainIabId) {
149
+ return parseInt(
150
+ podcast.value.emission.annotations.mainIabId as string,
151
+ 10,
152
+ );
153
+ } else if(podcast.value.emission.iabIds?.length) {
154
+ return podcast.value.emission.iabIds[0];
155
+ }
156
+ return 0;
157
+ });
142
158
 
143
- computed: {
144
- ...mapState(useFilterStore, ["filterOrgaId"]),
145
- ...mapState(useAuthStore, ["isRoleLive"]),
146
- ...mapState(useGeneralStore, ["storedCategories"]),
147
- hideSuggestions(): boolean {
159
+ const categories = computed(() =>{
160
+ if ("undefined" === typeof podcast.value) return [];
161
+ return generalStore.storedCategories
162
+ .filter((item: Category) => {
148
163
  return (
149
- "true" ===
150
- (this.podcast?.emission?.annotations?.["HIDE_SUGGESTIONS"] as
151
- | string
152
- | undefined)
164
+ podcast.value?.emission.iabIds &&
165
+ -1 !== podcast.value.emission.iabIds.indexOf(item.id)
153
166
  );
154
- },
155
- pageParameters() {
156
- return {
157
- isShareButtons: state.podcastPage.ShareButtons as boolean,
158
- };
159
- },
160
- emissionMainCategory(): number {
161
- if (!this.podcast) {
162
- return 0;
163
- }
164
- if (this.podcast.emission.annotations?.mainIabId) {
165
- return parseInt(
166
- this.podcast.emission.annotations.mainIabId as string,
167
- 10,
168
- );
169
- } else if (this.podcast.emission.iabIds?.length) {
170
- return this.podcast.emission.iabIds[0];
171
- }
167
+ })
168
+ .sort((a: Category, b: Category) => {
169
+ if (a.id === emissionMainCategory.value) return -1;
170
+ if (b.id === emissionMainCategory.value) return 1;
172
171
  return 0;
173
- },
174
- categories(): Array<Category> {
175
- if ("undefined" === typeof this.podcast) return [];
176
- return this.storedCategories
177
- .filter((item: Category) => {
178
- return (
179
- this.podcast?.emission.iabIds &&
180
- -1 !== this.podcast.emission.iabIds.indexOf(item.id)
181
- );
182
- })
183
- .sort((a: Category, b: Category) => {
184
- if (a.id === this.emissionMainCategory) return -1;
185
- if (b.id === this.emissionMainCategory) return 1;
186
- return 0;
187
- });
188
- },
189
- editRight(): boolean {
190
- return this.isEditRights(this.podcast?.organisation.id);
191
- },
192
- isLiveReadyToRecord(): boolean {
193
- return (
194
- undefined !== this.podcast?.conferenceId &&
195
- 0 !== this.podcast?.conferenceId &&
196
- "READY_TO_RECORD" === this.podcast?.processingStatus
197
- );
198
- },
199
- isOctopusAndAnimator(): boolean {
200
- return !this.isPodcastmaker && this.editRight && this.isRoleLive;
201
- },
202
- titlePage(): string {
203
- return this.isLiveReadyToRecord
204
- ? this.$t("Live episode")
205
- : this.$t("Episode");
206
- },
207
- },
208
- watch: {
209
- updateStatus(): void {
210
- if (this.fetchConference && null !== this.fetchConference) {
211
- this.fetchConference.status = this.updateStatus;
212
- }
213
- },
214
- podcastId: {
215
- immediate: true,
216
- async handler() {
217
- await this.getPodcastDetails();
218
- if (!this.podcast || this.error) {
219
- return;
220
- }
221
- this.initCommentUser();
222
- },
223
- },
224
- },
225
- beforeUnmount() {
226
- this.contentToDisplayUpdate(null);
227
- clearTimeout(this.infoReload);
228
- },
172
+ });
173
+ });
229
174
 
230
- methods: {
231
- ...mapActions(useGeneralStore, ["contentToDisplayUpdate"]),
232
- ...mapActions(useCommentStore, ["getCommentsConfig", "initCommentUser"]),
233
- async initConference() {
234
- if (!this.podcast || undefined == this.podcast.conferenceId || "READY_TO_RECORD" !== this.podcast.processingStatus) return;
235
- this.fetchConference = { conferenceId: this.podcast.conferenceId, title: "" };
236
- if (this.isOctopusAndAnimator) {
237
- try {
238
- this.fetchConference = await classicApi.fetchData<Conference>({
239
- api: 9,
240
- path: "conference/" + this.podcast.conferenceId,
241
- });
242
- } catch {
243
- await this.fetchConferenceStatus();
244
- }
245
- } else {
246
- await this.fetchConferenceStatus();
247
- }
248
- if (
249
- this.fetchConference &&
250
- -1 !== this.fetchConference.conferenceId &&
251
- "PUBLISHING" !== this.fetchConference.status &&
252
- "DEBRIEFING" !== this.fetchConference.status
253
- ) {
254
- this.fetchConferenceStatusLoop();
255
- }
256
- },
257
- async fetchConferenceStatusLoop() {
258
- if("PUBLISHING" ===this.fetchConference?.status){
259
- return;
260
- }
261
- this.infoReload = setTimeout(async () => {
262
- await this.fetchConferenceStatus();
263
- this.fetchConferenceStatusLoop();
264
- }, 3000);
265
- },
266
- async fetchConferenceStatus() {
267
- try {
268
- const data = await classicApi.fetchData<ConferencePublicInfo>({
269
- api: 9,
270
- path: "conference/info/" + this.podcast?.conferenceId,
271
- });
272
- this.fetchConference.status = data.status;
273
- } catch {
274
- //Do nothing
275
- }
276
- },
277
- updatePodcast(podcastUpdated: Podcast): void {
278
- this.podcast = podcastUpdated;
279
- },
280
- initError(): void {
281
- this.error = true;
282
- this.loaded = true;
283
- },
284
- async getPodcastDetails(): Promise<void> {
285
- this.loaded = false;
286
- this.error = false;
287
- try {
288
- const data = await classicApi.fetchData<Podcast>({
289
- api: 0,
290
- path: "podcast/" + this.podcastId,
291
- });
292
- if (
293
- "PUBLIC" !== data.organisation.privacy &&
294
- this.filterOrgaId !== data.organisation.id &&
295
- this.$route.query.productor !== data.organisation.id
296
- ) {
297
- this.initError();
298
- return;
299
- }
300
- this.podcast = data;
301
- this.contentToDisplayUpdate(data);
302
- if (
303
- (!this.podcast.availability.visibility ||
304
- ("READY_TO_RECORD" !== this.podcast.processingStatus &&
305
- "READY" !== this.podcast.processingStatus &&
306
- "PROCESSING" !== this.podcast.processingStatus) ||
307
- false === this.podcast.valid) &&
308
- !this.editRight
309
- ) {
310
- this.error = true;
311
- this.loaded = true;
312
- return;
313
- }
314
- this.podcastInProcessing();
315
- this.updatePathParams(this.podcast.title);
316
- await this.getCommentsConfig(this.podcast);
317
- if((this.fetchConference?.videoProfile?.includes("video_") && "READY_TO_RECORD" === this.podcast.processingStatus) || undefined !== this.podcast.video?.videoId){
318
- this.youtubeId = youtubeVideoHelper.getYoutubeId(this.podcast?.tags ?? []);
319
- }
320
- this.loaded = true;
321
- } catch (error) {
322
- this.handle403(error as AxiosError);
323
- this.initError();
324
- }
325
- },
175
+ const editRight = computed(() =>{
176
+ return isEditRights(podcast.value?.organisation.id);
177
+ });
326
178
 
327
- podcastInProcessing(){
328
- if("PLANNED" !== this.podcast?.processingStatus){
329
- this.initConference();
330
- return;
331
- }
332
- this.infoReload = setTimeout(async () => {
333
- this.podcast = await classicApi.fetchData<Podcast>({
334
- api: 0,
335
- path: "podcast/" + this.podcastId,
336
- });
337
- this.podcastInProcessing();
338
- }, 2000);
339
- }
340
- },
179
+ const isLiveReadyToRecord = computed(() =>{
180
+ return (
181
+ undefined !== podcast.value?.conferenceId &&
182
+ 0 !== podcast.value?.conferenceId &&
183
+ "READY_TO_RECORD" === podcast.value?.processingStatus
184
+ );
185
+ });
186
+
187
+ const isOctopusAndAnimator = computed(() =>{
188
+ return !isPodcastmaker.value && editRight.value && authStore.isRoleLive;
189
+ });
190
+
191
+ const titlePage = computed(() =>{
192
+ return isLiveReadyToRecord.value? t("Live episode"): t("Episode");
193
+ });
194
+
195
+
196
+ //Watch
197
+ watch(()=>props.updateStatus, () => {
198
+ if (fetchConference.value && null !== fetchConference.value) {
199
+ fetchConference.value.status = props.updateStatus;
200
+ }
201
+ });
202
+ watch(()=>props.podcastId, async () => {
203
+ await getPodcastDetails();
204
+ if (!podcast.value || error.value) {
205
+ return;
206
+ }
207
+ commentStore.initCommentUser();
208
+ }, {immediate: true});
209
+
210
+
211
+ onBeforeUnmount(() => {
212
+ generalStore.contentToDisplayUpdate(null);
213
+ clearTimeout(infoReload.value);
341
214
  });
215
+
216
+
217
+ //Methods
218
+ async function initConference() {
219
+ if (!podcast.value || undefined == podcast.value.conferenceId || "READY_TO_RECORD" !== podcast.value.processingStatus) return;
220
+ fetchConference.value = { conferenceId: podcast.value.conferenceId, title: "" };
221
+ if (isOctopusAndAnimator.value) {
222
+ try {
223
+ fetchConference.value = await classicApi.fetchData<Conference>({
224
+ api: 9,
225
+ path: "conference/" + podcast.value.conferenceId,
226
+ });
227
+ } catch {
228
+ await fetchConferenceStatus();
229
+ }
230
+ } else {
231
+ await fetchConferenceStatus();
232
+ }
233
+ if (
234
+ fetchConference.value &&
235
+ -1 !== fetchConference.value.conferenceId &&
236
+ "PUBLISHING" !== fetchConference.value.status &&
237
+ "DEBRIEFING" !== fetchConference.value.status
238
+ ) {
239
+ fetchConferenceStatusLoop();
240
+ }
241
+ }
242
+
243
+ async function fetchConferenceStatusLoop() {
244
+ if("PUBLISHING" ===fetchConference.value?.status){
245
+ return;
246
+ }
247
+ infoReload.value = setTimeout(async () => {
248
+ await fetchConferenceStatus();
249
+ fetchConferenceStatusLoop();
250
+ }, 3000);
251
+ }
252
+ async function fetchConferenceStatus() {
253
+ try {
254
+ const data = await classicApi.fetchData<ConferencePublicInfo>({
255
+ api: 9,
256
+ path: "conference/info/" + podcast.value?.conferenceId,
257
+ });
258
+
259
+ fetchConference.value = {...fetchConference.value, ...data};
260
+ } catch {
261
+ //Do nothing
262
+ }
263
+ }
264
+ function updatePodcast(podcastUpdated: Podcast): void {
265
+ podcast.value = podcastUpdated;
266
+ }
267
+ function initError(): void {
268
+ error.value = true;
269
+ loaded.value = true;
270
+ }
271
+
272
+ async function getPodcastDetails(): Promise<void> {
273
+ loaded.value = false;
274
+ error.value = false;
275
+ try {
276
+ const data = await classicApi.fetchData<Podcast>({
277
+ api: 0,
278
+ path: "podcast/" + props.podcastId,
279
+ });
280
+ if (
281
+ "PUBLIC" !== data.organisation.privacy &&
282
+ filterStore.filterOrgaId !== data.organisation.id &&
283
+ route.query.productor !== data.organisation.id
284
+ ) {
285
+ initError();
286
+ return;
287
+ }
288
+ podcast.value = data;
289
+ generalStore.contentToDisplayUpdate(data);
290
+ if (
291
+ (!podcast.value.availability.visibility ||
292
+ ("READY_TO_RECORD" !== podcast.value.processingStatus &&
293
+ "READY" !== podcast.value.processingStatus &&
294
+ "PROCESSING" !== podcast.value.processingStatus) ||
295
+ false === podcast.value.valid) &&
296
+ !editRight.value
297
+ ) {
298
+ error.value = true;
299
+ loaded.value = true;
300
+ return;
301
+ }
302
+ podcastInProcessing();
303
+ updatePathParams(podcast.value.title);
304
+ await commentStore.getCommentsConfig(podcast.value);
305
+ if((fetchConference.value?.videoProfile?.includes("video_") && "READY_TO_RECORD" === podcast.value.processingStatus) || undefined !== podcast.value.video?.videoId){
306
+ youtubeId.value = youtubeVideoHelper.getYoutubeId(podcast.value?.tags ?? []);
307
+ }
308
+ loaded.value = true;
309
+ } catch (error) {
310
+ handle403(error as AxiosError);
311
+ initError();
312
+ }
313
+ }
314
+
315
+ function podcastInProcessing(){
316
+ if("PLANNED" !== podcast.value?.processingStatus){
317
+ initConference();
318
+ return;
319
+ }
320
+ infoReload.value = setTimeout(async () => {
321
+ podcast.value = await classicApi.fetchData<Podcast>({
322
+ api: 0,
323
+ path: "podcast/" + props.podcastId,
324
+ });
325
+ podcastInProcessing();
326
+ }, 2000);
327
+ }
342
328
  </script>
@@ -45,6 +45,7 @@ import AdvancedSearch from "../display/filter/AdvancedSearch.vue";
45
45
  import {useAdvancedParamInit} from "../composable/route/useAdvancedParamInit";
46
46
  import { computed, ref, watch } from "vue";
47
47
 
48
+ //Props
48
49
  const props = defineProps({
49
50
  pr: { default: 0, type: Number },
50
51
  ps: { default: 30, type: Number },
@@ -61,6 +62,12 @@ const props = defineProps({
61
62
  routeRubriques: { default: "", type: String },
62
63
  });
63
64
 
65
+
66
+ //Data
67
+ const onlyVideo = ref(false);
68
+
69
+
70
+ //Composables
64
71
  const {
65
72
  organisationId,
66
73
  searchPattern,
@@ -78,13 +85,13 @@ const {
78
85
  isInit
79
86
  } = useAdvancedParamInit(props, false);
80
87
 
81
- const onlyVideo = ref(false);
82
-
83
88
 
89
+ //Computed
84
90
  const orgaArray = computed(() => organisationId.value ? [organisationId.value] : []);
85
91
  const withVideo = computed(() => false === onlyVideo.value ? undefined : true);
86
92
 
87
93
 
94
+ //Watch
88
95
  watch(() => props.routeOnlyVideo, () =>{
89
96
  onlyVideo.value = "true" === props.routeOnlyVideo;
90
97
  }, {immediate: true});