@saooti/octopus-sdk 41.9.5 → 41.9.6
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/CHANGELOG.md +10 -0
- package/package.json +1 -1
- package/src/api/classicApi.ts +7 -2
- package/src/api/transcriptionApi.ts +16 -1
- package/src/components/display/rubriques/RubriqueChooser.vue +1 -1
- package/src/components/form/ClassicCheckbox.vue +2 -1
- package/src/components/pages/PlaylistsPage.vue +1 -0
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
package/src/api/classicApi.ts
CHANGED
|
@@ -84,7 +84,7 @@ export default {
|
|
|
84
84
|
return response?.data;
|
|
85
85
|
},
|
|
86
86
|
|
|
87
|
-
async putData<Type>(params: RequestParameters): Promise<Type> {
|
|
87
|
+
async putData<Type>(params: RequestParameters & { raw?: boolean }): Promise<Type> {
|
|
88
88
|
let paramsString = "";
|
|
89
89
|
if(params.parameters){
|
|
90
90
|
const parameters = fetchHelper.getUriSearchParams(params.parameters).toString();
|
|
@@ -106,13 +106,18 @@ export default {
|
|
|
106
106
|
dataToSend.append(key, value);
|
|
107
107
|
}
|
|
108
108
|
}
|
|
109
|
+
} else if (params.raw === true && params.dataToSend) {
|
|
110
|
+
typeHeader = { "Content-Type": 'text/plain; charset=utf-8' };
|
|
111
|
+
dataToSend = params.dataToSend;
|
|
109
112
|
}else if(null!=params.dataToSend || undefined!=params.dataToSend){
|
|
110
113
|
typeHeader = { "Content-Type": 'application/json; charset=utf-8' };
|
|
111
|
-
dataToSend = JSON.stringify(params.dataToSend);
|
|
114
|
+
dataToSend = params.dataToSend;//JSON.stringify(params.dataToSend);
|
|
112
115
|
}
|
|
116
|
+
|
|
113
117
|
if(params.noContentType){
|
|
114
118
|
typeHeader = {};
|
|
115
119
|
}
|
|
120
|
+
|
|
116
121
|
const response = await axios.put(url,dataToSend,{headers:{...params.headers, ...typeHeader, ...authHeaders} });
|
|
117
122
|
return response.data;
|
|
118
123
|
},
|
|
@@ -162,6 +162,20 @@ async function updateTranscription(podcastId: number, transcript: string): Promi
|
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
164
|
|
|
165
|
+
/**
|
|
166
|
+
* Update the translation of a podcast
|
|
167
|
+
* @param podcastId ID of the podcast
|
|
168
|
+
* @param transcript The new translation
|
|
169
|
+
*/
|
|
170
|
+
async function updateTranslation(podcastId: number, language: string, translation: string): Promise<void> {
|
|
171
|
+
await classicApi.putData({
|
|
172
|
+
api: ModuleApi.SPEECHTOTEXT,
|
|
173
|
+
path: `transcription/${podcastId}/languages/${language}/srt`,
|
|
174
|
+
dataToSend: translation,
|
|
175
|
+
raw: true
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
|
|
165
179
|
export const transcriptionApi = {
|
|
166
180
|
changeTranscriptionVisibility,
|
|
167
181
|
getTranslations,
|
|
@@ -169,5 +183,6 @@ export const transcriptionApi = {
|
|
|
169
183
|
getRawTranscription,
|
|
170
184
|
generateTranscription,
|
|
171
185
|
regenerateTranscription,
|
|
172
|
-
updateTranscription
|
|
186
|
+
updateTranscription,
|
|
187
|
+
updateTranslation
|
|
173
188
|
};
|
|
@@ -29,7 +29,7 @@ import { useI18n } from "vue-i18n";
|
|
|
29
29
|
//Props
|
|
30
30
|
const props = defineProps({
|
|
31
31
|
defaultanswer: { default: "", type: String },
|
|
32
|
-
width: { default:
|
|
32
|
+
width: { default: undefined, type: String },
|
|
33
33
|
/**
|
|
34
34
|
* Active la sélection multiple
|
|
35
35
|
*/
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
<label
|
|
32
32
|
class="c-hand"
|
|
33
33
|
:class="[classLabel, displayLabel ? '' : 'd-none', isDisabled ? 'disabled' : '']"
|
|
34
|
+
:for="isSwitch ? undefined : computedIdCheckbox"
|
|
34
35
|
@click="clickSlider"
|
|
35
36
|
>
|
|
36
37
|
{{ label }}
|
|
@@ -73,7 +74,7 @@ function emitClickAction(): void {
|
|
|
73
74
|
emit("clickAction");
|
|
74
75
|
}
|
|
75
76
|
function clickSlider() {
|
|
76
|
-
if (!props.isDisabled) {
|
|
77
|
+
if (!props.isDisabled && props.isSwitch) {
|
|
77
78
|
emit("update:textInit", !props.textInit);
|
|
78
79
|
emitClickAction();
|
|
79
80
|
}
|