@saooti/octopus-sdk 35.1.6 → 35.2.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 (152) hide show
  1. package/package.json +3 -3
  2. package/src/App.vue +17 -8
  3. package/src/api/classicCrud.ts +6 -7
  4. package/src/components/display/categories/CategoryChooser.vue +4 -2
  5. package/src/components/display/categories/CategoryFilter.vue +22 -25
  6. package/src/components/display/categories/CategoryList.vue +18 -17
  7. package/src/components/display/comments/AddCommentModal.vue +5 -2
  8. package/src/components/display/comments/CommentInput.vue +14 -9
  9. package/src/components/display/comments/CommentItem.vue +7 -3
  10. package/src/components/display/comments/CommentList.vue +1 -1
  11. package/src/components/display/comments/CommentPlayer.vue +7 -4
  12. package/src/components/display/comments/CommentSection.vue +7 -4
  13. package/src/components/display/emission/EmissionInlineList.vue +1 -1
  14. package/src/components/display/emission/EmissionItem.vue +3 -3
  15. package/src/components/display/emission/EmissionList.vue +5 -2
  16. package/src/components/display/emission/EmissionPlayerItem.vue +24 -18
  17. package/src/components/display/filter/AdvancedSearch.vue +2 -2
  18. package/src/components/display/filter/CategorySearchFilter.vue +11 -11
  19. package/src/components/display/filter/ProductorSearch.vue +12 -11
  20. package/src/components/display/filter/RubriqueFilter.vue +13 -15
  21. package/src/components/display/list/ListPaginate.vue +1 -1
  22. package/src/components/display/live/LiveItem.vue +11 -9
  23. package/src/components/display/live/LiveList.vue +7 -7
  24. package/src/components/display/organisation/OrganisationChooser.vue +5 -3
  25. package/src/components/display/participant/ParticipantItem.vue +3 -3
  26. package/src/components/display/participant/ParticipantList.vue +4 -1
  27. package/src/components/display/playlist/PlaylistItem.vue +6 -3
  28. package/src/components/display/playlist/PlaylistList.vue +5 -3
  29. package/src/components/display/playlist/PodcastList.vue +1 -1
  30. package/src/components/display/playlist/PodcastPlaylistInlineList.vue +1 -1
  31. package/src/components/display/podcasts/AnimatorsItem.vue +5 -2
  32. package/src/components/display/podcasts/ParticipantDescription.vue +5 -2
  33. package/src/components/display/podcasts/PodcastImage.vue +15 -19
  34. package/src/components/display/podcasts/PodcastInlineList.vue +1 -1
  35. package/src/components/display/podcasts/PodcastInlineListClassic.vue +6 -6
  36. package/src/components/display/podcasts/PodcastInlineListTemplate.vue +15 -11
  37. package/src/components/display/podcasts/PodcastItem.vue +1 -1
  38. package/src/components/display/podcasts/PodcastItemInfo.vue +3 -3
  39. package/src/components/display/podcasts/PodcastList.vue +8 -3
  40. package/src/components/display/podcasts/PodcastModuleBox.vue +3 -3
  41. package/src/components/display/podcasts/PodcastPlayBar.vue +12 -11
  42. package/src/components/display/podcasts/PodcastSwiperList.vue +6 -6
  43. package/src/components/display/rubriques/RubriqueList.vue +13 -15
  44. package/src/components/display/sharing/QrCode.vue +10 -6
  45. package/src/components/display/sharing/ShareButtons.vue +1 -1
  46. package/src/components/display/sharing/ShareButtonsIntern.vue +1 -1
  47. package/src/components/display/sharing/ShareDistribution.vue +1 -1
  48. package/src/components/display/sharing/SharePlayer.vue +6 -3
  49. package/src/components/display/sharing/SharePlayerTypes.vue +1 -1
  50. package/src/components/misc/Footer.vue +19 -12
  51. package/src/components/misc/HomeDropdown.vue +6 -3
  52. package/src/components/misc/LeftMenu.vue +18 -19
  53. package/src/components/misc/TopBar.vue +21 -24
  54. package/src/components/misc/modal/ClipboardModal.vue +1 -1
  55. package/src/components/misc/modal/NewsletterModal.vue +8 -5
  56. package/src/components/misc/player/Player.vue +16 -14
  57. package/src/components/misc/player/PlayerCompact.vue +4 -4
  58. package/src/components/misc/player/PlayerProgressBar.vue +8 -8
  59. package/src/components/misc/player/PlayerTimeline.vue +1 -1
  60. package/src/components/mixins/handle403.ts +6 -1
  61. package/src/components/mixins/imageProxy.ts +1 -1
  62. package/src/components/mixins/init.ts +7 -4
  63. package/src/components/mixins/orgaComputed.ts +4 -4
  64. package/src/components/mixins/organisationFilter.ts +8 -5
  65. package/src/components/mixins/player/playerComment.ts +24 -30
  66. package/src/components/mixins/player/playerDisplay.ts +38 -67
  67. package/src/components/mixins/player/playerLive.ts +16 -15
  68. package/src/components/mixins/player/playerLogic.ts +54 -64
  69. package/src/components/mixins/player/playerTranscript.ts +16 -10
  70. package/src/components/pages/Category.vue +7 -9
  71. package/src/components/pages/Emission.vue +3 -3
  72. package/src/components/pages/Emissions.vue +9 -6
  73. package/src/components/pages/Error403Page.vue +5 -2
  74. package/src/components/pages/Home.vue +13 -8
  75. package/src/components/pages/Lives.vue +11 -9
  76. package/src/components/pages/PageNotFound.vue +10 -5
  77. package/src/components/pages/Participant.vue +2 -2
  78. package/src/components/pages/Participants.vue +2 -2
  79. package/src/components/pages/Playlist.vue +2 -2
  80. package/src/components/pages/Playlists.vue +2 -2
  81. package/src/components/pages/Podcast.vue +7 -4
  82. package/src/components/pages/Podcasts.vue +9 -7
  83. package/src/components/pages/Search.vue +1 -1
  84. package/src/main.ts +6 -4
  85. package/src/stores/ApiStore.ts +65 -0
  86. package/src/stores/AuthStore.ts +43 -0
  87. package/src/stores/FilterStore.ts +63 -0
  88. package/src/stores/GeneralStore.ts +57 -0
  89. package/src/stores/PlayerStore.ts +134 -0
  90. package/src/{store → stores}/class/general/playlist.ts +1 -1
  91. package/tsconfig.json +0 -1
  92. package/src/store/ApiStore.ts +0 -33
  93. package/src/store/AppStore.ts +0 -76
  94. package/src/store/PlayerStore.ts +0 -87
  95. package/src/store/classStore/typeApiStore.ts +0 -43
  96. package/src/store/classStore/typeAppStore.ts +0 -81
  97. package/src/store/classStore/typeAuthStore.ts +0 -44
  98. package/src/store/classStore/typePlayerStore.ts +0 -15
  99. package/src/vuex-shim.d.ts +0 -8
  100. /package/src/{store/paramStore.ts → stores/ParamSdkStore.ts} +0 -0
  101. /package/src/{store → stores}/class/adserver/adserverConfig.ts +0 -0
  102. /package/src/{store → stores}/class/adserver/adserverOtherEmission.ts +0 -0
  103. /package/src/{store → stores}/class/adserver/adserverTiming.ts +0 -0
  104. /package/src/{store → stores}/class/cartouchier/cartouche.ts +0 -0
  105. /package/src/{store → stores}/class/cartouchier/cartouchier.ts +0 -0
  106. /package/src/{store → stores}/class/conference/conference.ts +0 -0
  107. /package/src/{store → stores}/class/conference/conferenceMessage.ts +0 -0
  108. /package/src/{store → stores}/class/conference/conferenceParticipant.ts +0 -0
  109. /package/src/{store → stores}/class/conference/pad.ts +0 -0
  110. /package/src/{store → stores}/class/conference/studioCall.ts +0 -0
  111. /package/src/{store → stores}/class/contract/contract.ts +0 -0
  112. /package/src/{store → stores}/class/contract/contractOrganisation.ts +0 -0
  113. /package/src/{store → stores}/class/ftp/ftpEmission.ts +0 -0
  114. /package/src/{store → stores}/class/ftp/ftpParam.ts +0 -0
  115. /package/src/{store → stores}/class/ftp/testFtpEmission.ts +0 -0
  116. /package/src/{store → stores}/class/general/audioView.ts +0 -0
  117. /package/src/{store → stores}/class/general/category.ts +0 -0
  118. /package/src/{store → stores}/class/general/classicSelectType.ts +0 -0
  119. /package/src/{store → stores}/class/general/comment.ts +0 -0
  120. /package/src/{store → stores}/class/general/customPlayer.ts +0 -0
  121. /package/src/{store → stores}/class/general/emission.ts +0 -0
  122. /package/src/{store → stores}/class/general/fetchParam.ts +0 -0
  123. /package/src/{store → stores}/class/general/initState.ts +0 -0
  124. /package/src/{store → stores}/class/general/interfacePageable.ts +0 -0
  125. /package/src/{store → stores}/class/general/ituneCategory.ts +0 -0
  126. /package/src/{store → stores}/class/general/listReturn.ts +0 -0
  127. /package/src/{store → stores}/class/general/media.ts +0 -0
  128. /package/src/{store → stores}/class/general/organisation.ts +0 -0
  129. /package/src/{store → stores}/class/general/pageable.ts +0 -0
  130. /package/src/{store → stores}/class/general/participant.ts +0 -0
  131. /package/src/{store → stores}/class/general/player.ts +0 -0
  132. /package/src/{store → stores}/class/general/podcast.ts +0 -0
  133. /package/src/{store → stores}/class/general/sortPageable.ts +0 -0
  134. /package/src/{store → stores}/class/general/soundcastCategory.ts +0 -0
  135. /package/src/{store → stores}/class/ouestFrance/ofTag.ts +0 -0
  136. /package/src/{store → stores}/class/ouestFrance/ofTagInfo.ts +0 -0
  137. /package/src/{store → stores}/class/ouestFrance/ofTagPage.ts +0 -0
  138. /package/src/{store → stores}/class/ouestFrance/ofTagSeo.ts +0 -0
  139. /package/src/{store → stores}/class/ouestFrance/ofTagVente.ts +0 -0
  140. /package/src/{store → stores}/class/ouestFrance/ofTagWithParents.ts +0 -0
  141. /package/src/{store → stores}/class/rss/aggregator.ts +0 -0
  142. /package/src/{store → stores}/class/rss/rssEmission.ts +0 -0
  143. /package/src/{store → stores}/class/rss/rssInfo.ts +0 -0
  144. /package/src/{store → stores}/class/rubrique/rubriquage.ts +0 -0
  145. /package/src/{store → stores}/class/rubrique/rubriquageFilter.ts +0 -0
  146. /package/src/{store → stores}/class/rubrique/rubrique.ts +0 -0
  147. /package/src/{store → stores}/class/stat/statArrayIncome.ts +0 -0
  148. /package/src/{store → stores}/class/stat/statArrayObject.ts +0 -0
  149. /package/src/{store → stores}/class/stat/statGraph.ts +0 -0
  150. /package/src/{store → stores}/class/user/person.ts +0 -0
  151. /package/src/{store → stores}/class/user/profile.ts +0 -0
  152. /package/src/{store → stores}/class/user/userKeycloak.ts +0 -0
@@ -0,0 +1,43 @@
1
+ import { Organisation } from '@/stores/class/general/organisation';
2
+ import { Profile } from '@/stores/class/user/profile';
3
+ import { defineStore } from 'pinia';
4
+
5
+ interface AuthState{
6
+ authName: string;
7
+ authOrgaId?: string;
8
+ authOrgaName?: string;
9
+ authRole: Array<string>;
10
+ authParam: {
11
+ accessToken?: string;
12
+ refreshToken?: string;
13
+ expiration?: Date;
14
+ };
15
+ authProfile: Profile;
16
+ authOrganisation: Organisation;
17
+ }
18
+ export const useAuthStore = defineStore('AuthStore', {
19
+ state: (): AuthState => ({
20
+ authName: '',
21
+ authRole: [''],
22
+ authParam: {
23
+ accessToken: undefined,
24
+ refreshToken: undefined,
25
+ expiration: undefined,
26
+ },
27
+ authProfile: {
28
+ userId: '',
29
+ },
30
+ authOrganisation: {
31
+ id: '',
32
+ name: '',
33
+ imageUrl: '',
34
+ description: undefined,
35
+ monetisable: undefined,
36
+ location: undefined,
37
+ comments: undefined,
38
+ attributes: {
39
+ RSS_CONTACT: undefined,
40
+ },
41
+ },
42
+ }),
43
+ })
@@ -0,0 +1,63 @@
1
+ import { Category } from '@/stores/class/general/category';
2
+ import { Rubriquage } from '@/stores/class/rubrique/rubriquage';
3
+ import { RubriquageFilter } from '@/stores/class/rubrique/rubriquageFilter';
4
+ import { Rubrique } from '@/stores/class/rubrique/rubrique';
5
+ import { defineStore } from 'pinia';
6
+
7
+ interface FilterState{
8
+ filterOrgaId?: string;
9
+ filterImgUrl?: string;
10
+ filterName?: string;
11
+ filterRubriquage: Array<Rubriquage>;
12
+ filterRubrique: Array<RubriquageFilter>;
13
+ filterRubriqueDisplay: Array<Rubrique>;
14
+ filterTypeMedia?: string;
15
+ filterSortOrder?: string;
16
+ filterSortField?: string;
17
+ filterLive?: boolean;
18
+ filterIab?: Category;
19
+ }
20
+ export const useFilterStore = defineStore('FilterStore', {
21
+ state: (): FilterState => ({
22
+ filterRubriquage: [],
23
+ filterRubrique: [],
24
+ filterRubriqueDisplay: [],
25
+ filterLive: false,
26
+ }),
27
+ actions : {
28
+ filterUpdateOrga(filter: {orgaId?:string,imgUrl?:string,name?:string,rubriquageArray?:Array<Rubriquage>, isLive?:boolean }) {
29
+ this.filterOrgaId = filter.orgaId;
30
+ if (filter.imgUrl || !filter.orgaId) {
31
+ this.filterImgUrl = filter.imgUrl;
32
+ }
33
+ if (filter.name || !filter.orgaId) {
34
+ this.filterName = filter.name;
35
+ }
36
+ if(filter.rubriquageArray){
37
+ this.filterRubriquage = filter.rubriquageArray;
38
+ }
39
+ this.filterLive = filter.isLive;
40
+ this.filterIab = undefined;
41
+ },
42
+ filterUpdateIab(iab?:Category) {
43
+ this.filterIab = iab;
44
+ },
45
+ filterUpdateRubrique(rubriqueFilter: Array<RubriquageFilter>) {
46
+ this.filterRubrique = rubriqueFilter;
47
+ },
48
+ filterUpdateRubriqueDisplay(rubriques: Array<Rubrique>) {
49
+ this.filterRubriqueDisplay = rubriques;
50
+ },
51
+ filterUpdateMedia(filter: {type?:string, order?:string, field?:string}) {
52
+ if (filter.type) {
53
+ this.filterTypeMedia = filter.type;
54
+ }
55
+ if (filter.order) {
56
+ this.filterSortOrder = filter.order;
57
+ }
58
+ if (filter.field) {
59
+ this.filterSortField = filter.field;
60
+ }
61
+ },
62
+ }
63
+ })
@@ -0,0 +1,57 @@
1
+ import { Category } from '@/stores/class/general/category';
2
+ import { CommentPodcast } from '@/stores/class/general/comment';
3
+ import { defineStore } from 'pinia';
4
+
5
+ interface GeneralState{
6
+ metaTitle: string;
7
+ platformEducation: boolean;
8
+ generalLogoUrl: string;
9
+ storedCategories: Array<Category>;
10
+ storedCategoriesOrga: Array<Category>;
11
+ isBeforeLive: boolean;
12
+ generalComments: {
13
+ knownIdentity: string | null;
14
+ actualPodcastId?: number;
15
+ loadedComments: Array<CommentPodcast>;
16
+ totalCount: number;
17
+ };
18
+ }
19
+ export const useGeneralStore = defineStore('GeneralStore', {
20
+ state: (): GeneralState => ({
21
+ metaTitle: 'Octopus by Saooti',
22
+ platformEducation:false,
23
+ generalLogoUrl: '/img/logo_octopus_final.svg',
24
+ storedCategories: [],
25
+ storedCategoriesOrga: [],
26
+ isBeforeLive: true,
27
+ generalComments: {
28
+ knownIdentity: null,
29
+ actualPodcastId: 0,
30
+ loadedComments: [],
31
+ totalCount: 0,
32
+ },
33
+ }),
34
+ actions:{
35
+ storedUpdateCategories(categories: Array<Category>) {
36
+ this.storedCategories = categories;
37
+ },
38
+ storedUpdateCategoriesOrga(categories: Array<Category>) {
39
+ this.storedCategoriesOrga = categories;
40
+ },
41
+ isBeforeLiveUpdate(isBeforeLive: boolean) {
42
+ this.isBeforeLive = isBeforeLive;
43
+ },
44
+ setCommentIdentity(identity:string|null) {
45
+ this.generalComments.knownIdentity = identity;
46
+ },
47
+ setCommentLoaded(data: {podcastId?: number, comments:Array<CommentPodcast>}) {
48
+ this.generalComments.actualPodcastId = data.podcastId;
49
+ this.generalComments.loadedComments = data.comments;
50
+ },
51
+ platformUpdateEducation(isEducation: boolean) {
52
+ this.platformEducation = isEducation;
53
+ this.generalLogoUrl = '/img/logo_education.webp';
54
+ this.metaTitle = 'RadioEducation.org';
55
+ },
56
+ }
57
+ })
@@ -0,0 +1,134 @@
1
+ import DurationHelper from '../helper/duration';
2
+ import { Media } from '@/stores/class/general/media';
3
+ import { MediaRadio, Radio } from '@/stores/class/general/player';
4
+ import { Podcast } from '@/stores/class/general/podcast';
5
+ import { defineStore } from 'pinia';
6
+ interface Transcript{
7
+ actual: number,
8
+ actualText:string,
9
+ value : Array<{endTime: number, startTime:number, text: string}>
10
+ }
11
+ interface PlayerState{
12
+ playerStatus: string; //STOPPED, LOADING, PLAYING, PAUSED
13
+ playerPodcast: Podcast|undefined;
14
+ playerVolume?: number; //From 0 to 1
15
+ playerElapsed: number; //From 0 to 1
16
+ playerTotal: number;
17
+ playerMedia: Media|undefined;
18
+ playerLive: Podcast|undefined;
19
+ playerRadio: Radio|undefined;
20
+ playerStop?: boolean;
21
+ playerSeekTime?: number;
22
+ playerTranscript?:Transcript;
23
+ }
24
+ export const usePlayerStore = defineStore('PlayerStore', {
25
+ state: (): PlayerState => ({
26
+ playerStatus: 'STOPPED',
27
+ playerPodcast: undefined,
28
+ playerVolume: 1,
29
+ playerElapsed: 0,
30
+ playerTotal: 0,
31
+ playerMedia: undefined,
32
+ playerLive: undefined,
33
+ playerRadio: undefined,
34
+ playerSeekTime:0,
35
+ }),
36
+ getters: {
37
+ playedTime(): string{
38
+ if (this.playerElapsed && this.playerElapsed > 0 && this.playerTotal && this.playerTotal > 0) {
39
+ return DurationHelper.formatDuration(
40
+ Math.round(this.playerElapsed * this.playerTotal)
41
+ );
42
+ }
43
+ return '--:--';
44
+ },
45
+ totalTime(): string {
46
+ if (this.playerElapsed && this.playerElapsed > 0 && this.playerTotal && this.playerTotal > 0)
47
+ return DurationHelper.formatDuration(Math.round(this.playerTotal));
48
+ return '--:--';
49
+ },
50
+ isPlaying(): boolean {
51
+ return 'PLAYING' === this.playerStatus;
52
+ },
53
+ isPaused(): boolean {
54
+ return 'PAUSED' === this.playerStatus;
55
+ },
56
+ podcastImage(): string{
57
+ return this.playerPodcast?.imageUrl ?? "";
58
+ },
59
+ emissionName(): string {
60
+ return this.playerPodcast?.emission?.name ?? "";
61
+ },
62
+ transcriptText():string{
63
+ return this.playerTranscript?.actualText ?? "";
64
+ },
65
+ radioUrl(): string{
66
+ return this.playerRadio?.url ?? "";
67
+ }
68
+ },
69
+ actions: {
70
+ playerPlay(param?: any) {
71
+ if (!param) {
72
+ this.playerStatus = 'STOPPED';
73
+ this.playerPodcast = undefined;
74
+ this.playerMedia = undefined;
75
+ this.playerLive = undefined;
76
+ this.playerRadio = undefined;
77
+ this.playerElapsed = 0;
78
+ return;
79
+ }
80
+ if (
81
+ (this.playerPodcast && this.playerPodcast.podcastId === param.podcastId) ||
82
+ (this.playerMedia && this.playerMedia.mediaId === param.mediaId) ||
83
+ (this.playerLive && this.playerLive.conferenceId === param.conferenceId)
84
+ ) {
85
+ //Do nothing
86
+ return;
87
+ }
88
+ this.playerStatus = 'LOADING';
89
+ this.playerPodcast = undefined;
90
+ this.playerMedia = undefined;
91
+ this.playerLive = undefined;
92
+ this.playerRadio = undefined;
93
+ this.playerElapsed = 0;
94
+ if (
95
+ param.conferenceId &&
96
+ (!param.podcastId || param.processingStatus !== 'READY')
97
+ ) {
98
+ this.playerLive = param;
99
+ } else if (param.podcastId) {
100
+ this.playerPodcast = param;
101
+ } else if (param.mediaId) {
102
+ this.playerMedia = param;
103
+ }else if(param.canalId){
104
+ this.playerRadio = {...param,...{isInit: false}};
105
+ }
106
+ },
107
+
108
+ playerChangeStatus(isPause: boolean) {
109
+ if (isPause) {
110
+ this.playerStatus = 'PAUSED';
111
+ } else {
112
+ this.playerStatus = 'PLAYING';
113
+ }
114
+ },
115
+
116
+ playerUpdateSeekTime(seekTime: number){
117
+ this.playerSeekTime = seekTime;
118
+ },
119
+
120
+ playerMetadata(metadata: MediaRadio){
121
+ if(!this.playerRadio){return;}
122
+ this.playerRadio.metadata = metadata;
123
+ },
124
+
125
+ playerUpdateElapsed(elapsed: number, total:number){
126
+ this.playerElapsed = elapsed;
127
+ this.playerTotal = total;
128
+ },
129
+
130
+ playerUpdateTranscript(transcript?:Transcript) {
131
+ this.playerTranscript = transcript;
132
+ },
133
+ }
134
+ })
@@ -1,4 +1,4 @@
1
- import { Organisation } from '../general/organisation';
1
+ import { Organisation } from './organisation';
2
2
  import { Person } from '../user/person';
3
3
  import { FetchParam } from './fetchParam';
4
4
 
package/tsconfig.json CHANGED
@@ -39,6 +39,5 @@
39
39
  ],
40
40
  "files": [
41
41
  "src/shims-vue.d.ts",
42
- "src/vuex-shim.d.ts"
43
42
  ]
44
43
  }
@@ -1,33 +0,0 @@
1
- import { ApiState, getDefaultApiState } from './classStore/typeApiStore';
2
- import { Module, MutationTree } from 'vuex';
3
- import { StoreState } from './classStore/typeAppStore';
4
- const mutations = <MutationTree<ApiState>>{
5
- init(state, apiUrls: ApiState) {
6
- state.apiUrl= apiUrls.apiUrl;
7
- state.commentUrl= apiUrls.commentUrl;
8
- state.frontendUrl= apiUrls.frontendUrl;
9
- state.ftpUrl= apiUrls.ftpUrl;
10
- state.hlsUrl= apiUrls.hlsUrl;
11
- state.imageUrl= apiUrls.imageUrl;
12
- state.keycloakUrl= apiUrls.keycloakUrl;
13
- state.mediaUrl= apiUrls.mediaUrl;
14
- state.miniplayerUrl= apiUrls.miniplayerUrl;
15
- state.processorUrl= apiUrls.processorUrl;
16
- state.recoUrl= apiUrls.recoUrl;
17
- state.radioUrl= apiUrls.radioUrl;
18
- state.rssUrl= apiUrls.rssUrl;
19
- state.rtmpUrl= apiUrls.rtmpUrl;
20
- state.speechToTextUrl= apiUrls.speechToTextUrl;
21
- state.studioUrl= apiUrls.studioUrl;
22
- state.videoMakerUrl= apiUrls.videoMakerUrl;
23
- state.storageUrl= apiUrls.storageUrl;
24
- },
25
- };
26
-
27
- const ApiModule: Module<ApiState, StoreState> = {
28
- namespaced: true,
29
- state: getDefaultApiState(),
30
- mutations: mutations,
31
- };
32
-
33
- export default ApiModule;
@@ -1,76 +0,0 @@
1
- import { createStore, MutationTree } from 'vuex';
2
- import ApiStore from '@/store/ApiStore';
3
- import PlayerStore from '@/store/PlayerStore';
4
- import { AppStoreData, StoreState } from './classStore/typeAppStore';
5
-
6
- const mutations = <MutationTree<StoreState>>{
7
- categoriesSet(state, categories) {
8
- state.categories = categories;
9
- },
10
- categoriesOrgaSet(state, categories) {
11
- state.categoriesOrga = categories;
12
- },
13
- filterOrga(state, filter) {
14
- state.filter.organisationId = filter.orgaId;
15
- if (filter.imgUrl || !filter.orgaId) {
16
- state.filter.imgUrl = filter.imgUrl;
17
- }
18
- if (filter.name || !filter.orgaId) {
19
- state.filter.name = filter.name;
20
- }
21
- if(filter.rubriquageArray){
22
- state.filter.rubriquageArray = filter.rubriquageArray;
23
- }
24
- state.filter.live = filter.isLive;
25
- state.filter.iab = undefined;
26
- },
27
- filterIab(state, iab) {
28
- state.filter.iab = iab;
29
- },
30
- filterRubrique(state, rubriqueFilter) {
31
- state.filter.rubriqueFilter = rubriqueFilter;
32
- },
33
- filterRubriqueDisplay(state, rubriques) {
34
- state.filter.rubriqueDisplay = rubriques;
35
- },
36
- filterMedia(state, filter) {
37
- if (filter.type) {
38
- state.filter.typeMedia = filter.type;
39
- }
40
- if (filter.order) {
41
- state.filter.sortOrder = filter.order;
42
- }
43
- if (filter.field) {
44
- state.filter.sortField = filter.field;
45
- }
46
- },
47
- initFilter(state, data) {
48
- state.filter = {
49
- ...state.filter,
50
- ...data,
51
- };
52
- },
53
- liveUpdate(state, isBeforeLive) {
54
- state.liveUpdate.isBeforeLive = isBeforeLive;
55
- },
56
- setCommentIdentity(state, identity) {
57
- state.comments.knownIdentity = identity;
58
- },
59
- setCommentLoaded(state, data) {
60
- state.comments.actualPodcastId = data.podcastId;
61
- state.comments.loadedComments = data.comments;
62
- },
63
- isEducation(state, isEducation) {
64
- state.general.education = isEducation;
65
- state.general.logoUrl = '/img/logo_education.webp';
66
- state.general.metaTitle = 'RadioEducation.org';
67
- },
68
- };
69
- export default createStore({
70
- state: AppStoreData(),
71
- modules: {
72
- api : ApiStore,
73
- player: PlayerStore
74
- },
75
- mutations: mutations,
76
- });
@@ -1,87 +0,0 @@
1
- import { getDefaultPlayerState } from './classStore/typePlayerStore';
2
- import { Module, MutationTree } from 'vuex';
3
- import { StoreState } from './classStore/typeAppStore';
4
- import { Player } from './class/general/player';
5
-
6
- const mutations = <MutationTree<Player>>{
7
- playPodcast(state, podcast) {
8
- if (!podcast) {
9
- state.status = 'STOPPED';
10
- state.podcast = undefined;
11
- state.media = undefined;
12
- state.live = undefined;
13
- state.radio = undefined;
14
- state.elapsed = 0;
15
- return;
16
- }
17
- if (
18
- (state.podcast &&
19
- state.podcast.podcastId === podcast.podcastId) ||
20
- (state.media && state.media.mediaId === podcast.mediaId) ||
21
- (state.live &&
22
- state.live.conferenceId === podcast.conferenceId)
23
- ) {
24
- //Do nothing
25
- return;
26
- }
27
- state.status = 'LOADING';
28
- state.podcast = undefined;
29
- state.media = undefined;
30
- state.live = undefined;
31
- state.radio = undefined;
32
- state.elapsed = 0;
33
- if (
34
- podcast.conferenceId &&
35
- (!podcast.podcastId || podcast.processingStatus !== 'READY')
36
- ) {
37
- state.live = podcast;
38
- } else if (podcast.podcastId) {
39
- state.podcast = podcast;
40
- } else if (podcast.mediaId) {
41
- state.media = podcast;
42
- }else if(podcast.canalId){
43
- state.radio = {...podcast,...{isInit: false}};
44
- }
45
- },
46
-
47
- radioMetadata(state, metadata){
48
- if(!state.radio){return;}
49
- state.radio.metadata = metadata;
50
- },
51
-
52
- pause(state, pause) {
53
- if (pause) {
54
- state.status = 'PAUSED';
55
- } else {
56
- state.status = 'PLAYING';
57
- }
58
- },
59
-
60
- elapsed(state, elapsed) {
61
- state.elapsed = elapsed;
62
- },
63
-
64
- totalTime(state, total) {
65
- state.total = total;
66
- },
67
-
68
- volume(state, volume) {
69
- state.volume = volume;
70
- },
71
-
72
- seekTime(state, seekTime) {
73
- state.seekTime = seekTime;
74
- },
75
-
76
- transcript(state, transcript) {
77
- state.transcript = transcript;
78
- },
79
- };
80
-
81
- const PlayerModule: Module<Player, StoreState> = {
82
- namespaced: true,
83
- state: getDefaultPlayerState(),
84
- mutations: mutations,
85
- };
86
-
87
- export default PlayerModule;
@@ -1,43 +0,0 @@
1
-
2
- export interface ApiState {
3
- apiUrl: undefined,
4
- commentUrl: undefined,
5
- frontendUrl: undefined,
6
- ftpUrl: undefined,
7
- hlsUrl: undefined,
8
- imageUrl: undefined,
9
- keycloakUrl: undefined,
10
- mediaUrl: undefined,
11
- miniplayerUrl:undefined,
12
- processorUrl: undefined,
13
- radioUrl: undefined,
14
- recoUrl:undefined,
15
- rssUrl: undefined,
16
- rtmpUrl: undefined,
17
- speechToTextUrl: undefined,
18
- studioUrl: undefined,
19
- videoMakerUrl: undefined,
20
- storageUrl: undefined,
21
- }
22
- export function getDefaultApiState(): ApiState {
23
- return {
24
- apiUrl: undefined,
25
- commentUrl:undefined,
26
- frontendUrl: undefined,
27
- ftpUrl: undefined,
28
- hlsUrl: undefined,
29
- imageUrl: undefined,
30
- keycloakUrl: undefined,
31
- mediaUrl: undefined,
32
- miniplayerUrl:undefined,
33
- processorUrl: undefined,
34
- radioUrl: undefined,
35
- recoUrl:undefined,
36
- rssUrl: undefined,
37
- rtmpUrl: undefined,
38
- speechToTextUrl: undefined,
39
- studioUrl: undefined,
40
- videoMakerUrl: undefined,
41
- storageUrl: undefined,
42
- };
43
- }
@@ -1,81 +0,0 @@
1
- import { Category } from '../class/general/category';
2
- import { CommentPodcast } from '../class/general/comment';
3
- import { Rubriquage } from '../class/rubrique/rubriquage';
4
- import { RubriquageFilter } from '../class/rubrique/rubriquageFilter';
5
- import { Rubrique } from '../class/rubrique/rubrique';
6
- import { ApiState } from './typeApiStore';
7
- import { AuthState } from './typeAuthStore';
8
- import { getDefaultPlayerState } from './typePlayerStore';
9
- import { Player } from '../class/general/player';
10
-
11
- export interface Filter{
12
- organisationId: string | undefined;
13
- imgUrl: string | undefined;
14
- name: string | undefined;
15
- rubriquageArray: Array<Rubriquage>;
16
- rubriqueFilter: Array<RubriquageFilter>;
17
- rubriqueDisplay: Array<Rubrique>;
18
- typeMedia: string | undefined;
19
- sortOrder: string | undefined;
20
- sortField: string | undefined;
21
- live: boolean|undefined;
22
- iab: Category |undefined;
23
- }
24
-
25
- export interface StoreState {
26
- general: {
27
- metaTitle: string;
28
- education: boolean;
29
- logoUrl: string;
30
- };
31
- categories: Array<Category>;
32
- categoriesOrga: Array<Category>;
33
- filter: Filter;
34
- liveUpdate: {
35
- isBeforeLive: boolean;
36
- };
37
- comments: {
38
- knownIdentity: string | null;
39
- actualPodcastId: number;
40
- loadedComments: Array<CommentPodcast>;
41
- totalCount: number;
42
- };
43
- player: Player;
44
- auth?: AuthState;
45
- api?: ApiState;
46
- }
47
-
48
- export function AppStoreData(): StoreState {
49
- return {
50
- general: {
51
- metaTitle: 'Octopus by Saooti',
52
- education: false,
53
- logoUrl: '/img/logo_octopus_final.svg',
54
- },
55
- categories: [],
56
- categoriesOrga: [],
57
- filter: {
58
- organisationId: undefined,
59
- imgUrl: undefined,
60
- name:undefined,
61
- rubriquageArray: [],
62
- rubriqueFilter: [],
63
- rubriqueDisplay: [],
64
- typeMedia: undefined,
65
- sortOrder: undefined,
66
- sortField: undefined,
67
- live: false,
68
- iab: undefined,
69
- },
70
- liveUpdate: {
71
- isBeforeLive: true,
72
- },
73
- comments: {
74
- knownIdentity: null,
75
- actualPodcastId: 0,
76
- loadedComments: [],
77
- totalCount: 0,
78
- },
79
- player: getDefaultPlayerState(),
80
- };
81
- }
@@ -1,44 +0,0 @@
1
- import { Organisation } from "../class/general/organisation";
2
- import { Profile } from "../class/user/profile";
3
-
4
- export interface AuthState {
5
- name: string;
6
- organisationId: string | undefined;
7
- organisationName: string | undefined;
8
- role: Array<string>;
9
- oAuthParam: {
10
- accessToken: string | undefined;
11
- refreshToken: string | undefined;
12
- expiration: Date | undefined;
13
- };
14
- profile: Profile;
15
- organisation: Organisation;
16
- }
17
- export function getDefaultAuthState(): AuthState {
18
- return {
19
- name: '',
20
- organisationId: undefined,
21
- organisationName: undefined,
22
- role: [''],
23
- oAuthParam: {
24
- accessToken: undefined,
25
- refreshToken: undefined,
26
- expiration: undefined,
27
- },
28
- profile: {
29
- userId: '',
30
- },
31
- organisation: {
32
- id: '',
33
- name: '',
34
- imageUrl: '',
35
- description: undefined,
36
- monetisable: undefined,
37
- location: undefined,
38
- comments: undefined,
39
- attributes: {
40
- RSS_CONTACT: undefined,
41
- },
42
- },
43
- };
44
- }
@@ -1,15 +0,0 @@
1
- import { Player } from '../class/general/player';
2
-
3
- export function getDefaultPlayerState(): Player {
4
- return {
5
- status: 'STOPPED', //STOPPED, LOADING, PLAYING, PAUSED
6
- podcast: undefined,
7
- volume: 1, //From 0 to 1
8
- elapsed: 0, //From 0 to 1
9
- total: 0,
10
- media: undefined,
11
- live: undefined,
12
- radio: undefined,
13
- seekTime:0,
14
- };
15
- }