Skip to content

Commit

Permalink
[C-2378] Add upload v2 feature flag (#3099)
Browse files Browse the repository at this point in the history
  • Loading branch information
sliptype committed Mar 24, 2023
1 parent 962a6df commit 453910f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
17 changes: 11 additions & 6 deletions packages/common/src/services/audius-backend/AudiusBackend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1233,12 +1233,17 @@ export const audiusBackend = ({
metadata: TrackMetadata,
onProgress: (loaded: number, total: number) => void
) {
return await audiusLibs.Track.uploadTrack(
trackFile,
coverArtFile,
metadata,
onProgress
)
const storageV2Enabled = await getFeatureEnabled(FeatureFlags.STORAGE_V2)
if (storageV2Enabled) {
// do storage v2 upload
} else {
return await audiusLibs.Track.uploadTrack(
trackFile,
coverArtFile,
metadata,
onProgress
)
}
}

// Used to upload multiple tracks as part of an album/playlist
Expand Down
6 changes: 4 additions & 2 deletions packages/common/src/services/remote-config/feature-flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ export enum FeatureFlags {
LAZY_USERBANK_CREATION_ENABLED = 'lazy_userbank_creation_enabled',
DISCOVERY_NOTIFICATIONS = 'discovery_notifications',
REPOST_OF_REPOST_NOTIFICATIONS = 'repost_of_repost_notifications',
SAVE_OF_REPOST_NOTIFICATIONS = 'save_of_repost_notifications'
SAVE_OF_REPOST_NOTIFICATIONS = 'save_of_repost_notifications',
STORAGE_V2 = 'storage_v2'
}

type FlagDefaults = Record<FeatureFlags, boolean>
Expand Down Expand Up @@ -104,5 +105,6 @@ export const flagDefaults: FlagDefaults = {
[FeatureFlags.LAZY_USERBANK_CREATION_ENABLED]: false,
[FeatureFlags.DISCOVERY_NOTIFICATIONS]: false,
[FeatureFlags.REPOST_OF_REPOST_NOTIFICATIONS]: false,
[FeatureFlags.SAVE_OF_REPOST_NOTIFICATIONS]: false
[FeatureFlags.SAVE_OF_REPOST_NOTIFICATIONS]: false,
[FeatureFlags.STORAGE_V2]: false
}

0 comments on commit 453910f

Please sign in to comment.