Skip to content

Commit

Permalink
refactor: Optimize global network module[376530]
Browse files Browse the repository at this point in the history
  • Loading branch information
Greedysky committed Oct 16, 2024
1 parent 59f41e4 commit c0a2aa3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,23 @@ static void parseSongPropertyA(TTK::MusicSongInformation *info, const QString &k
if(ok)
{
QVariantMap value = data.toMap();
if(value["code"].toInt() == 0 && value.contains("data"))
if(value["code"].toInt() == 0)
{
TTK::MusicSongProperty prop;
prop.m_bitrate = bitrate;
prop.m_format = bitrate > TTK_BN_320 ? FLAC_FILE_SUFFIX : MP3_FILE_SUFFIX;
prop.m_size = TTK_DEFAULT_STR;

prop.m_url = value["data"].toString();
if(prop.isEmpty())
{
prop.m_url = value["url"].toString();
}

if(prop.isEmpty())
{
return;
}

value = value["extra"].toMap();
if(value.isEmpty())
Expand Down
2 changes: 1 addition & 1 deletion TTKModule/TTKCore/musicUtilsKits/musicnumberutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ int TTK::Number::bitrateToNormal(int bitrate)
}
else if(bitrate > TTK_BN_320)
{
return TTK_BN_500;
return TTK_BN_1000;
}
else
{
Expand Down

0 comments on commit c0a2aa3

Please sign in to comment.