Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dedupe tracks in album and fix broken import #7599

Merged
merged 1 commit into from
Feb 15, 2024
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
9 changes: 7 additions & 2 deletions packages/ddex/ingester/parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ func (p *Parser) processDelivery(changeStream *mongo.ChangeStream) {
}
p.logger.Info("Parsed delivery", "createTrackRelease", fmt.Sprintf("%+v", createTrackRelease), "createAlbumRelease", fmt.Sprintf("%+v", createAlbumRelease))

// If there's an album release, the tracks we parsed out are actually part of the album release
if len(createAlbumRelease) > 0 {
createTrackRelease = []common.CreateTrackRelease{}
}

// TODO: We can loop through each release and validate if its URLs exist in the delivery.
// However, the DDEX spec actually says that a delivery can leave out the assets and just have the metadata (assuming they'll do another delivery with the assets closer to release date).

Expand All @@ -101,7 +106,7 @@ func (p *Parser) processDelivery(changeStream *mongo.ChangeStream) {
"upload_etag": delivery.UploadETag,
"delivery_id": delivery.ID,
"create_track_release": track,
"publish_date": track.Metadata.ReleaseDate, // TODO: Use time instead of string so it can be queried properly
"publish_date": track.Metadata.ReleaseDate,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removing this TODO because i completed it here

"created_at": time.Now(),
}
result, err := p.pendingReleasesColl.InsertOne(p.ctx, pendingRelease)
Expand All @@ -116,7 +121,7 @@ func (p *Parser) processDelivery(changeStream *mongo.ChangeStream) {
"upload_etag": delivery.UploadETag,
"delivery_id": delivery.ID,
"create_album_release": album,
"publish_date": album.Metadata.ReleaseDate, // TODO: Use time instead of string so it can be queried properly
"publish_date": album.Metadata.ReleaseDate,
"created_at": time.Now(),
}
result, err := p.pendingReleasesColl.InsertOne(p.ctx, pendingRelease)
Expand Down
3 changes: 1 addition & 2 deletions packages/ddex/publisher/src/services/publisherService.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/* eslint-disable @typescript-eslint/no-unused-vars */
import aws from 'aws-sdk'
import mongoose from 'mongoose'
import Deliveries from '../models/deliveries'
import PendingReleases from '../models/pendingReleases'
Expand All @@ -19,6 +17,7 @@ import type {
} from '@audius/sdk/dist/sdk/index.d.ts'
import createS3 from './s3Service'

// eslint-disable-next-line @typescript-eslint/no-unused-vars
const getUserId = async (audiusSdk: AudiusSdkType, artistName: string) => {
// TODO: We previously did it like this, but the results are too random and don't return the user with an exact match as users[0].
// In the future, we could check all OAuthed usernames for an exact match and cross-reference SDK's search results to find a rough match if no exact match was found
Expand Down