Skip to content
Open
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
5 changes: 0 additions & 5 deletions .changeset/afraid-mayflies-hunt.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/chilled-bobcats-sit.md

This file was deleted.

8 changes: 0 additions & 8 deletions .changeset/four-peas-impress.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/plenty-starfishes-walk.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/purple-experts-allow.md

This file was deleted.

14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/common/src/adapters/collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export const playlistMetadataForCreateWithSDK = (
parentalWarningType: input.parental_warning_type ?? undefined,
...('cover_art_sizes' in input
? {
coverArtCid: input.cover_art_sizes ?? '',
playlistImageSizesMultihash: input.cover_art_sizes ?? '',
isImageAutogenerated: input.is_image_autogenerated ?? false
}
: {})
Expand All @@ -211,7 +211,7 @@ export const playlistMetadataForUpdateWithSDK = (
: undefined,
playlistName: input.playlist_name ?? '',
description: input.description ?? '',
coverArtCid: input.cover_art_sizes ?? '',
playlistImageSizesMultihash: input.cover_art_sizes ?? '',
isPrivate: input.is_private ?? false
}
}
Expand Down
24 changes: 14 additions & 10 deletions packages/common/src/api/tan-query/upload/usePublishCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,13 @@ const getPublishCollectionOptions = (context: PublishCollectionContext) =>
const metadata = albumMetadataForCreateWithSDK(
params.collectionMetadata
)
metadata.playlistContents = publishedTracks.map((t) => ({
timestamp: Math.round(Date.now() / 1000),
trackId: Id.parse(t.trackId),
metadataTimestamp: Math.round(Date.now() / 1000)
}))
metadata.playlistContents = publishedTracks
.filter((t) => !!t.trackId)
.map((t) => ({
timestamp: Math.round(Date.now() / 1000),
trackId: t.trackId!,
metadataTimestamp: Math.round(Date.now() / 1000)
}))
return await sdk.albums.createAlbum({
userId: Id.parse(userId),
imageFile: coverArtFile,
Expand All @@ -117,11 +119,13 @@ const getPublishCollectionOptions = (context: PublishCollectionContext) =>
const metadata = playlistMetadataForCreateWithSDK(
params.collectionMetadata
)
metadata.playlistContents = publishedTracks.map((t) => ({
timestamp: Math.round(Date.now() / 1000),
trackId: Id.parse(t.trackId),
metadataTimestamp: Math.round(Date.now() / 1000)
}))
metadata.playlistContents = publishedTracks
.filter((t) => !!t.trackId)
.map((t) => ({
timestamp: Math.round(Date.now() / 1000),
trackId: t.trackId!,
metadataTimestamp: Math.round(Date.now() / 1000)
}))
return await sdk.playlists.createPlaylist({
userId: Id.parse(userId),
imageFile: coverArtFile,
Expand Down
10 changes: 10 additions & 0 deletions packages/common/src/store/account/sagas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,16 @@ function* fetchLocalAccountAsync() {
users: [cachedAccountUser],
queryClient
})
// Set walletAddresses so useCurrentAccount/useWalletAddresses work correctly.
// Without this, components that depend on currentUserWallet stay disabled.
const web3WalletAddress = wallet
yield* put(
setWalletAddresses({ currentUser: wallet, web3User: web3WalletAddress })
)
queryClient.setQueryData(getWalletAddressesQueryKey(), {
currentUser: wallet,
web3User: web3WalletAddress
})
queryClient.setQueryData(getAccountStatusQueryKey(), Status.SUCCESS)
yield* put(fetchAccountSucceeded(cachedAccount))
}
Expand Down
14 changes: 8 additions & 6 deletions packages/create-audius-app/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#!/usr/bin/env node
import { cyan, green, red, bold } from 'picocolors'
import Commander from 'commander'
import { Command } from 'commander'
import path from 'path'
import prompts from 'prompts'
import { createApp } from './create-app'
import type { ExampleType } from './helpers/examples'
import { validateNpmName } from './helpers/validate-pkg'
import packageJson from './package.json'
import { isFolderEmpty } from './helpers/is-folder-empty'
Expand All @@ -16,12 +17,12 @@ const handleSigTerm = () => process.exit(0)
process.on('SIGINT', handleSigTerm)
process.on('SIGTERM', handleSigTerm)

const program = new Commander.Command(packageJson.name)
const program = new Command(packageJson.name)
.version(packageJson.version)
.arguments('<project-directory>')
.arguments('[project-directory]')
.usage(`${green('<project-directory>')} [options]`)
.action((name) => {
projectPath = name
projectPath = name ?? ''
})
.option(
'-e, --example [name]',
Expand Down Expand Up @@ -89,7 +90,8 @@ async function run() {
process.exit(1)
}

if (program.example === true) {
const exampleOption = program.opts().example
if (exampleOption === true) {
console.error(
'Please provide an example name, otherwise remove the example option.'
)
Expand All @@ -107,7 +109,7 @@ async function run() {
process.exit(1)
}

const example = program.example.trim()
const example = (typeof exampleOption === 'string' ? exampleOption : 'react-hono').trim() as ExampleType

await createApp({
appPath: resolvedProjectPath,
Expand Down
4 changes: 2 additions & 2 deletions packages/create-audius-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@
],
"devDependencies": {
"@playwright/test": "1.42.1",
"@types/cross-spawn": "^6.0.6",
"@types/cross-spawn": "6.0.6",
"@types/glob": "7.1.1",
"@types/prompts": "2.4.2",
"@types/tar": "6.1.11",
"@types/validate-npm-package-name": "4.0.2",
"commander": "2.20.0",
"commander": "9.2.0",
"execa": "2.0.3",
"fast-glob": "3.3.1",
"glob": "7.1.6",
Expand Down
1 change: 1 addition & 0 deletions packages/discovery-provider/src/models/tracks/track.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class Track(Base, RepresentableMixin):
slot = Column(Integer)
is_available = Column(Boolean, nullable=False, server_default=text("true"))
allowed_api_keys = Column(ARRAY(String))
access_authorities = Column(ARRAY(String))
is_stream_gated = Column(Boolean, nullable=False, server_default=text("false"))
stream_conditions = Column(JSONB(True))
is_download_gated = Column(Boolean, nullable=False, server_default=text("false"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,16 @@ def populate_track_record_metadata(track_record: Track, track_metadata, handle,
api_key.lower()
for api_key in track_metadata["allowed_api_keys"]
]
elif key == "access_authorities":
if key in track_metadata:
if track_metadata[key] is None:
track_record.access_authorities = None
elif isinstance(track_metadata[key], list):
track_record.access_authorities = [
str(addr).strip()
for addr in track_metadata["access_authorities"]
if isinstance(addr, str)
]
elif key == "stem_of":
if "stem_of" in track_metadata and is_valid_json_field(
track_metadata, "stem_of"
Expand Down
8 changes: 8 additions & 0 deletions packages/discovery-provider/src/tasks/entity_manager/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,14 @@ def parse_metadata(metadata: str, action: str, entity_type: str):
cid = data["cid"]
metadata_json = data["data"]

if entity_type == EntityType.TRACK and "access_authorities" in data:
if (
"access_authorities" not in metadata_json
or metadata_json["access_authorities"] is None
):
metadata_json = dict(metadata_json)
metadata_json["access_authorities"] = data["access_authorities"]

# Don't format metadata for UPDATEs
# This is to support partial updates
# Individual entities are responsible for updating existing records with metadata
Expand Down
2 changes: 2 additions & 0 deletions packages/discovery-provider/src/tasks/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ class TrackMetadata(TypedDict):
producer_copyright_line: Optional[Copyright]
parental_warning_type: Optional[str]
allowed_api_keys: Optional[str]
access_authorities: Optional[List[str]]
bpm: Optional[float]
is_custom_bpm: Optional[bool]
musical_key: Optional[str]
Expand Down Expand Up @@ -203,6 +204,7 @@ class TrackMetadata(TypedDict):
"producer_copyright_line": None,
"parental_warning_type": None,
"allowed_api_keys": None,
"access_authorities": None,
"bpm": None,
"is_custom_bpm": False,
"musical_key": None,
Expand Down
12 changes: 12 additions & 0 deletions packages/libs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# @audius/sdk

## 6.0.21

### Patch Changes

- Updated dependencies [71bb31b]
- Updated dependencies [71bb31b]
- Updated dependencies [a7a9e17]
- Updated dependencies [d864806]
- Updated dependencies [8f12bb7]
- Updated dependencies [6cb4b6f]
- @audius/sdk@14.0.0

## 6.0.20

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/libs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@audius/sdk-legacy",
"version": "6.0.20",
"version": "6.0.21",
"audius": {
"releaseSHA": "f1d70a2a0643c5c84d8ab053f70c1e0a2ec3ad49"
},
Expand Down Expand Up @@ -44,7 +44,7 @@
"dependencies": {
"@audius/fixed-decimal": "0.2.1",
"@audius/hedgehog": "3.0.0-alpha.1",
"@audius/sdk": "13.1.0",
"@audius/sdk": "14.0.0",
"@audius/spl": "2.1.0",
"@babel/core": "^7.23.7",
"@babel/plugin-proposal-class-static-block": "7.21.0",
Expand Down
Loading