fixing upload of unsealed binary

This commit is contained in:
balzack 2025-01-20 09:22:37 -08:00
parent 16a72fbec7
commit 55d89107c7
11 changed files with 32 additions and 5 deletions

View File

@ -71,6 +71,7 @@ export const styles = StyleSheet.create({
minWidth: 0,
textOverflow: 'ellipsis',
flexShrink: 1,
height: 32,
},
close: {
display: 'flex',
@ -83,6 +84,8 @@ export const styles = StyleSheet.create({
},
closeIcon: {
flexShrink: 0,
borderRadius: 8,
opacity: 0.7,
},
progress: {
position: 'absolute',

View File

@ -101,7 +101,7 @@ export function AudioAsset({ topicId, asset, loaded, show }: { topicId: string,
{ state.dataUrl && (
<Video source={{ uri: state.dataUrl }} style={styles.player} paused={false} ref={videoRef}
onPlaybackRateChange={playbackRateChange} onEnd={end} onError={actions.failed}
controls={false} resizeMode="contain" />
audioOnly={true} controls={false} resizeMode="contain" />
)}
{ status === 'playing' && (
<Surface elevation={2} style={styles.control}>

View File

@ -40,6 +40,8 @@ export const styles = StyleSheet.create({
flexGrow: 1,
},
closeIcon: {
borderRadius: 8,
opacity: 0.7,
},
progress: {
position: 'absolute',

View File

@ -57,6 +57,8 @@ export const styles = StyleSheet.create({
right: 0,
},
closeIcon: {
borderRadius: 8,
opacity: 0.7,
},
progress: {
position: 'absolute',

View File

@ -4,6 +4,7 @@
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
.thumb {
width: auto;
@ -15,6 +16,10 @@
padding-right: 2px;
position: absolute;
font-size: 12px;
text-overflow: ellipsis;
min-width: 0;
width: 100%;
overflow: hidden;
}
.close {

View File

@ -18,6 +18,9 @@
text-align: center;
overflow: hidden;
text-overflow: ellipsis;
height: 100%;
font-size: 12px;
white-space: nowrap;
}
.extension {

View File

@ -271,7 +271,7 @@ export function useConversation() {
]});
return { encrypted: { type: 'audio', label: asset.label, parts: `ac${sources.length-1}` } };
} else {
sources.push({ type: AssetType.Video, source: asset.file, transforms: [
sources.push({ type: AssetType.Audio, source: asset.file, transforms: [
{ type: TransformType.Copy, appId: `ac${sources.length}` }
]});
return { audio: { label: asset.label, full: `ac${sources.length-1}` } };

View File

@ -11,6 +11,8 @@
width: 100%;
text-align: center;
font-size: 14px;
overflow: hidden;
text-overflow: ellipsis;
}
.play {
@ -46,6 +48,10 @@
.label {
position: absolute;
top: 0px;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
padding: 8px;
}
.close {

View File

@ -14,6 +14,9 @@
width: 100%;
text-align: center;
font-size: 12px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.extension {
@ -21,6 +24,7 @@
text-align: center;
font-size: 12px;
font-weight: bold;
overflow: hidden;
}
}
@ -63,6 +67,9 @@
width: 100%;
text-align: center;
font-size: 16px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.extension {

View File

@ -21,7 +21,6 @@ export function BinaryAsset({ topicId, asset }: { topicId: string, asset: MediaA
}
const download = () => {
console.log("DOWNLOAD");
const link = document.createElement("a");
link.download = `${label}.${extension.toLowerCase()}`
link.href = state.dataUrl;

View File

@ -499,7 +499,7 @@ export class FocusModule implements Focus {
transforms.push('acopy;audio');
transformMap.set('acopy;audio', transform.appId);
} else if (transform.type === TransformType.Copy && asset.type === AssetType.Binary) {
const assetId = await this.mirrorFile(asset.source, topicId, assetProgress);
const { assetId } = await this.mirrorFile(asset.source, topicId, assetProgress);
uploadCount += 1;
const assetItem = {
assetId: `${assetItems.length}`,
@ -566,7 +566,7 @@ export class FocusModule implements Focus {
return { encrypted: { type, thumb: getAsset(thumb), parts: getAsset(parts) } };
} else if (type === 'audio') {
return { encrypted: { type, label, parts: getAsset(parts) } };
}else {
} else {
return { encrypted: { type, label, extension, parts: getAsset(parts) } };
}
} else if (asset.image) {