/************************* Change History *****************************
01/18/2007 - Paulo Kuong
- File Created
************************************************************************/
?>
require_once __DIR__ . '/../../../vendor/autoload.php';
require_once (__DIR__ . '/../../bootstrap_features.php');
require_once('constants.php');
$wrapperObj = getPDOQueryWrapper();
?>
executeQuery($sql, $dataParams);
if ($rel_art_result === false) {
show_pdo_error($sql, $wrapperObj->getLastStatement());
}
//******************fetch Participant Identifier's data and map with track artists******************
$artistUriClass = '';
if ($isOaParticipantIdentifierEnabled && is_array($rel_art_result)) {
$piResult = fetchParticipantIdentifier($wrapperObj, $vendorResult);
foreach ($rel_art_result as $key => $value) {
foreach ($piResult as $row) {
$storeArtistId = $row['orchard_artist_name_md5'] == md5($value['name']) ? $row['store_artist_id']: null;
if (!is_null($storeArtistId) && $row['store_id'] == APPLE_STORE_ID) {
$rel_art_result[$key]['apple_artist_id'] = $storeArtistId;
} elseif (!is_null($storeArtistId) && $row['store_id'] == SPOTIFY_STORE_ID) {
$rel_art_result[$key]['spotify_artist_id'] = $storeArtistId;
}
}
}
$artistUriClass = 'artist_uri';
} else if ($isUpdateSpotifyAppleIdsWithGraphqlEnabled) {
$trackParticipantIdentifierData = $graphqlGatewayServiceClient->getParticipantIdsByTrackId((int)$track_id);
if (!empty($trackParticipantIdentifierData) && is_array($rel_art_result)) {
foreach ($rel_art_result as $key => $value) {
$normalized_track_artist_name = mb_strtolower(preg_replace('/\s+/u', '', $value['name']), 'UTF-8');
foreach ($trackParticipantIdentifierData as $participantIdentifier) {
$normalized_participant_name = mb_strtolower(preg_replace('/\s+/u', '', $participantIdentifier['participant']['name']), 'UTF-8');
if ($normalized_track_artist_name == $normalized_participant_name) {
$rel_art_result[$key]['apple_artist_id'] = isset($participantIdentifier['participant']['appleMusicId']) ? $participantIdentifier['participant']['appleMusicId'] : null;
$rel_art_result[$key]['spotify_artist_id'] = isset($participantIdentifier['participant']['spotifyId']) ? $participantIdentifier['participant']['spotifyId'] : null;
$rel_art_result[$key]['spotify_artist_key'] = isset($participantIdentifier['participant']['spotifyArtistKey']) ? $participantIdentifier['participant']['spotifyArtistKey'] : null;
$rel_art_result[$key]['participant_id'] = $participantIdentifier['participant']['id'];
}
}
}
}
$artistUriClass = 'artist_uri';
}
//*************************************************************************************************
?>
| Track Artist(s) Name |
Track Artist(s) Role |
Spotify Artist URI
|
Apple Artist ID
|
|
$rci = 0;
if ($isOAFeatureToPrimaryEnabled && !array_search("feature_to_primary", $release_track_artist_roles)) {
array_splice($release_track_artist_roles, 9, 0, "feature_to_primary" );
}
foreach ($rel_art_result as $rel_art_row) {
$row_class = (++$rci & 1) ? '' : 'alt'; ?>
}
$row_class = (++$rci & 1) ? '' : 'alt'; ?>
/*
*/ ?>