Skip to content
This repository was archived by the owner on Oct 4, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion packages/common/src/services/audius-backend/AudiusBackend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1236,7 +1236,16 @@ export const audiusBackend = ({
) {
const storageV2Enabled = await getFeatureEnabled(FeatureFlags.STORAGE_V2)
if (storageV2Enabled) {
// do storage v2 upload
try {
Comment thread
theoilie marked this conversation as resolved.
return await audiusLibs.Track.uploadTrackV2(
trackFile,
coverArtFile,
metadata,
onProgress
)
} catch (e: any) {
return { error: e }
}
} else {
return await audiusLibs.Track.uploadTrack(
trackFile,
Expand All @@ -1255,6 +1264,7 @@ export const audiusBackend = ({
metadata: TrackMetadata,
onProgress: (loaded: number, total: number) => void
) {
// TODO: Call storage v2 upload if USE_STORAGE_V2_FEATURE_FLAG is true
return audiusLibs.Track.uploadTrackContentToCreatorNode(
trackFile,
coverArtFile,
Expand Down
3 changes: 3 additions & 0 deletions packages/web/src/components/data-entry/FormTile.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import UnlistedTrackModal from 'components/unlisted-track-modal/UnlistedTrackMod
import PreviewButton from 'components/upload/PreviewButton'
import UploadArtwork from 'components/upload/UploadArtwork'
import { useFlag } from 'hooks/useRemoteConfig'
import { getFeatureEnabled } from 'services/remote-config/featureFlagHelpers'
import { resizeImage } from 'utils/imageProcessingUtil'
import { moodMap } from 'utils/moods'

Expand Down Expand Up @@ -763,6 +764,8 @@ class FormTile extends Component {
try {
let file = selectedFiles[0]
file = await this.props.transformArtworkFunction(file)
const storageV2Enabled = getFeatureEnabled(FeatureFlags.STORAGE_V2)
if (storageV2Enabled) file.name = selectedFiles[0].name
const url = URL.createObjectURL(file)
this.props.onChangeField('artwork', { url, file, source }, false)
this.setState({ imageProcessingError: false })
Expand Down