Skip to content
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
begin;

alter table tracks add column if not exists is_custom_musical_key boolean default false;

commit;
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ def test_valid_parse_metadata(app):
"bpm": None,
"is_custom_bpm": False,
"musical_key": None,
"is_custom_musical_key": False,
"audio_analysis_error_count": 0,
},
"QmUpdatePlaylist1": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,7 @@ export interface TrackRow {
bpm?: number | null
is_custom_bpm?: boolean | null
musical_key?: string | null
is_custom_musical_key?: boolean | null
audio_analysis_error_count?: number
}
export interface TrendingParamRow {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1006,6 +1006,7 @@ export type Tracks = {
bpm: number | null;
is_custom_bpm: boolean | null;
musical_key: string | null;
is_custom_musical_key: boolean | null;
audio_analysis_error_count: number;
};

Expand Down
1 change: 1 addition & 0 deletions packages/discovery-provider/src/api/v1/models/tracks.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@
"bpm": fields.Float,
"is_custom_bpm": fields.Boolean,
"musical_key": fields.String,
"is_custom_musical_key": fields.Boolean,
"audio_analysis_error_count": fields.Integer,
# DDEX fields
"ddex_release_ids": fields.Raw(allow_null=True),
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 @@ -102,6 +102,7 @@ class Track(Base, RepresentableMixin):
bpm = Column(Float)
is_custom_bpm = Column(Boolean, server_default=text("false"))
musical_key = Column(String)
is_custom_musical_key = Column(Boolean, server_default=text("false"))
audio_analysis_error_count = Column(
Integer, nullable=False, server_default=text("0")
)
Expand Down
4 changes: 4 additions & 0 deletions packages/discovery-provider/src/schemas/track_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,10 @@
],
"default": null
},
"is_custom_musical_key": {
"type": ["boolean"],
"default": false
},
"audio_analysis_error_count": {
"type": [
"integer"
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 @@ -136,6 +136,7 @@ class TrackMetadata(TypedDict):
bpm: Optional[float]
is_custom_bpm: Optional[bool]
musical_key: Optional[str]
is_custom_musical_key: Optional[bool]
audio_analysis_error_count: Optional[int]


Expand Down Expand Up @@ -192,6 +193,7 @@ class TrackMetadata(TypedDict):
"bpm": None,
"is_custom_bpm": False,
"musical_key": None,
"is_custom_musical_key": False,
"audio_analysis_error_count": 0,
}

Expand Down
2 changes: 2 additions & 0 deletions packages/libs/src/api/Track.ts
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,7 @@ export class Track extends Base {
bpm,
is_custom_bpm,
musical_key,
is_custom_musical_key,
audio_analysis_error_count,
field_visibility,
...other
Expand Down Expand Up @@ -715,6 +716,7 @@ export class Track extends Base {
bpm,
is_custom_bpm,
musical_key,
is_custom_musical_key,
audio_analysis_error_count,
field_visibility
}
Expand Down
8 changes: 8 additions & 0 deletions packages/libs/src/sdk/api/generated/full/models/TrackFull.ts
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,12 @@ export interface TrackFull {
* @memberof TrackFull
*/
musicalKey?: string;
/**
*
* @type {boolean}
* @memberof TrackFull
*/
isCustomMusicalKey?: boolean;
/**
*
* @type {number}
Expand Down Expand Up @@ -610,6 +616,7 @@ export function TrackFullFromJSONTyped(json: any, ignoreDiscriminator: boolean):
'bpm': !exists(json, 'bpm') ? undefined : json['bpm'],
'isCustomBpm': !exists(json, 'is_custom_bpm') ? undefined : json['is_custom_bpm'],
'musicalKey': !exists(json, 'musical_key') ? undefined : json['musical_key'],
'isCustomMusicalKey': !exists(json, 'is_custom_musical_key') ? undefined : json['is_custom_musical_key'],
'audioAnalysisErrorCount': !exists(json, 'audio_analysis_error_count') ? undefined : json['audio_analysis_error_count'],
'ddexReleaseIds': !exists(json, 'ddex_release_ids') ? undefined : json['ddex_release_ids'],
'artists': !exists(json, 'artists') ? undefined : json['artists'],
Expand Down Expand Up @@ -691,6 +698,7 @@ export function TrackFullToJSON(value?: TrackFull | null): any {
'bpm': value.bpm,
'is_custom_bpm': value.isCustomBpm,
'musical_key': value.musicalKey,
'is_custom_musical_key': value.isCustomMusicalKey,
'audio_analysis_error_count': value.audioAnalysisErrorCount,
'ddex_release_ids': value.ddexReleaseIds,
'artists': value.artists,
Expand Down
1 change: 1 addition & 0 deletions packages/libs/src/sdk/api/tracks/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ export const createUploadTrackMetadataSchema = () =>
bpm: z.optional(z.number().nullable()),
isCustomBpm: z.optional(z.boolean()),
musicalKey: z.optional(z.string().nullable()),
isCustomMusicalKey: z.optional(z.boolean()),
audioAnalysisErrorCount: z.optional(z.number())
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,6 +369,10 @@
],
"default": null
},
"is_custom_musical_key": {
"type": ["boolean"],
"default": false
},
"audio_analysis_error_count": {
"type": [
"integer"
Expand Down
1 change: 1 addition & 0 deletions packages/libs/src/utils/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ export type TrackMetadata = {
bpm?: Nullable<number>
is_custom_bpm?: boolean
musical_key?: Nullable<string>
is_custom_musical_key?: boolean
audio_analysis_error_count?: number
field_visibility?: FieldVisibility
}
Expand Down