//
// MusicBrowser::musicActionFinished from 0x10060f930 to 0x10060fa0d (221 bytes)
//
// 2 xrefs:
// > sub_10060FA10 @ 0x10060fa1c
// > ??> @ 0x100980b68
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall MusicBrowser::musicActionFinished(MusicBrowser *a1, GJMusicAction a2)
{
MusicDownloadManager *v2; // rax
unsigned int sizex2; // ecx
MusicDownloadManager *v4; // rax
MusicDownloadManager *v5; // rax
unsigned int v6; // ebx
MusicDownloadManager *v7; // rax
std::size_t size; // rbx
if ( a2 == DownloadOrUpdate && a1->m_gettingURL )
{
a1->m_autoUpdating = 1;
v2 = MusicDownloadManager::sharedState();
sizex2 = v2->m_customContentURL.m_data.m_short.sizex2;
if ( (sizex2 & 1) != 0 )
{
if ( v2->m_customContentURL.m_data.m_long.size )
goto LABEL_5;
}
else if ( sizex2 >> 1 )
{
LABEL_5:
a1->m_gettingURL = 0;
v4 = MusicDownloadManager::sharedState();
MusicDownloadManager::tryUpdateMusicLibrary(v4);
return;
}
a1->m_gettingURL = 1;
v7 = MusicDownloadManager::sharedState();
goto LABEL_15;
}
if ( MusicDownloadManager::sharedState()->m_musicObjects )
{
MusicBrowser::setupMusicBrowser(a1);
return;
}
v5 = MusicDownloadManager::sharedState();
v6 = v5->m_customContentURL.m_data.m_short.sizex2;
if ( (v6 & 1) == 0 )
{
v7 = MusicDownloadManager::sharedState();
if ( !(v6 >> 1) )
goto LABEL_15;
LABEL_12:
MusicDownloadManager::downloadMusicLibrary(v7);
return;
}
size = v5->m_customContentURL.m_data.m_long.size;
v7 = MusicDownloadManager::sharedState();
if ( size )
goto LABEL_12;
LABEL_15:
MusicDownloadManager::getCustomContentURL(v7);
}