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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -271,7 +271,7 @@ export function useConversation() {
]}); ]});
return { encrypted: { type: 'audio', label: asset.label, parts: `ac${sources.length-1}` } }; return { encrypted: { type: 'audio', label: asset.label, parts: `ac${sources.length-1}` } };
} else { } 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}` } { type: TransformType.Copy, appId: `ac${sources.length}` }
]}); ]});
return { audio: { label: asset.label, full: `ac${sources.length-1}` } }; return { audio: { label: asset.label, full: `ac${sources.length-1}` } };

View File

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

View File

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

View File

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

View File

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