Update .gitea/workflows/ci.yml
This commit is contained in:
@@ -107,7 +107,9 @@ jobs:
|
|||||||
pp_country_rank="RESTRICTED"
|
pp_country_rank="RESTRICTED"
|
||||||
padded_rank="9999999"
|
padded_rank="9999999"
|
||||||
osu_profile_url="https://osu.ppy.sh/users/$osu_id"
|
osu_profile_url="https://osu.ppy.sh/users/$osu_id"
|
||||||
#avatar_url=$(echo "$users_json" | jq -r ".[$i].avatar_url")"?size=512"
|
|
||||||
|
# ensure timestamp exists before using it
|
||||||
|
timestamp=$(( $(date +%s) / 86400 * 86400 ))
|
||||||
avatar_url="https://a.ppy.sh/$osu_id?$timestamp"
|
avatar_url="https://a.ppy.sh/$osu_id?$timestamp"
|
||||||
|
|
||||||
printf "%s|<tr><td>%s</td><td>%s</td><td>%s</td><td><a href=\"%s\">Profile</a></td><td><a href=\"%s\">Skins</a></td></tr>\n" \
|
printf "%s|<tr><td>%s</td><td>%s</td><td>%s</td><td><a href=\"%s\">Profile</a></td><td><a href=\"%s\">Skins</a></td></tr>\n" \
|
||||||
@@ -122,17 +124,29 @@ jobs:
|
|||||||
|
|
||||||
pp_rank=$(echo "$user_data" | jq -r '.[0].pp_rank // "9999999"')
|
pp_rank=$(echo "$user_data" | jq -r '.[0].pp_rank // "9999999"')
|
||||||
pp_country_rank=$(echo "$user_data" | jq -r '.[0].pp_country_rank // "-"')
|
pp_country_rank=$(echo "$user_data" | jq -r '.[0].pp_country_rank // "-"')
|
||||||
|
country=$(echo "$user_data" | jq -r '.[0].country // "-"')
|
||||||
username=$(echo "$user_data" | jq -r '.[0].username // "'$owner'"')
|
username=$(echo "$user_data" | jq -r '.[0].username // "'$owner'"')
|
||||||
padded_rank=$(printf "%07d" "$pp_rank")
|
padded_rank=$(printf "%07d" "$pp_rank")
|
||||||
|
|
||||||
|
# Build CC+rank like CH28; fall back sanely if data missing
|
||||||
|
if [ "$pp_country_rank" != "-" ] && [ -n "$pp_country_rank" ] && [ "$pp_country_rank" != "null" ]; then
|
||||||
|
if [ "$country" != "-" ] && [ -n "$country" ] && [ "$country" != "null" ]; then
|
||||||
|
cc_rank="${country}${pp_country_rank}"
|
||||||
|
else
|
||||||
|
cc_rank="$pp_country_rank"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
cc_rank="-"
|
||||||
|
fi
|
||||||
|
|
||||||
printf "%s|<tr><td>%s</td><td>%s</td><td>%s</td><td><a href=\"https://osu.ppy.sh/users/%s\">Profile</a></td><td><a href=\"%s\">Skins</a></td></tr>\n" \
|
printf "%s|<tr><td>%s</td><td>%s</td><td>%s</td><td><a href=\"https://osu.ppy.sh/users/%s\">Profile</a></td><td><a href=\"%s\">Skins</a></td></tr>\n" \
|
||||||
"$padded_rank" "$username" "$pp_rank" "$pp_country_rank" "$osu_id" "$html_url" >> "$USER_ROWS_FILE"
|
"$padded_rank" "$username" "$pp_rank" "$cc_rank" "$osu_id" "$html_url" >> "$USER_ROWS_FILE"
|
||||||
|
|
||||||
timestamp=$(( $(date +%s) / 86400 * 86400 ))
|
timestamp=$(( $(date +%s) / 86400 * 86400 ))
|
||||||
printf "%s|<a href=\"%s\"><img src=\"https://a.ppy.sh/%s?%s\" width=175 height=175></a>\n" \
|
printf "%s|<a href=\"%s\"><img src=\"https://a.ppy.sh/%s?%s\" width=175 height=175></a>\n" \
|
||||||
"$padded_rank" "$html_url" "$osu_id" "$timestamp" >> "$AVATAR_ROWS_FILE"
|
"$padded_rank" "$html_url" "$osu_id" "$timestamp" >> "$AVATAR_ROWS_FILE"
|
||||||
|
|
||||||
echo " ✅ Added: $username (#$pp_rank)"
|
echo " ✅ Added: $username (#$pp_rank, $cc_rank)"
|
||||||
total_valid_entries=$((total_valid_entries + 1))
|
total_valid_entries=$((total_valid_entries + 1))
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|||||||
Reference in New Issue
Block a user