📦➔🦋 Store and retrieve files on the Atmosphere
35
fork

Configure Feed

Select the types of activity you want to include in your feed.

[#4] upload: fix failed blobs still creating an upload record

Ducky 011e132f 6811b587

+14 -12
+14 -12
atfile.sh
··· 561 561 exit_code="$1" 562 562 data="$2" 563 563 564 - if [[ $exit_code != 0 || -z "$data" || "$data" == "{}" || "$data" == *"\"error\":"* ]]; then 564 + if [[ $exit_code != 0 || -z "$data" || "$data" == "null" || "$data" == "{}" || "$data" == *"\"error\":"* ]]; then 565 565 echo 0 566 566 else 567 567 echo 1 ··· 1792 1792 [[ $_output_json == 0 ]] && echo "Uploading '$file'..." 1793 1793 blob="$(com.atproto.sync.uploadBlob "$file")" 1794 1794 success=$(atfile.util.is_xrpc_success $? "$blob") 1795 - 1796 - file_record="$(blue.zio.atfile.upload "$blob" "$_now" "$file_hash" "$file_hash_type" "$file_date" "$file_name" "$file_size" "$file_type" "$file_meta_record" "$file_finger_record")" 1797 - 1798 - if [[ -n "$key" ]]; then 1799 - atfile.say.debug "Updating record...\n↳ NSID: $_nsid_upload\n↳ Repo: $_username\n↳ Key: $key" 1800 - record="$(com.atproto.repo.putRecord "$_username" "$_nsid_upload" "$key" "$file_record")" 1801 - success=$(atfile.util.is_xrpc_success $? "$record") 1802 - else 1803 - atfile.say.debug "Creating record...\n↳ NSID: $_nsid_upload\n↳ Repo: $_username" 1804 - record="$(com.atproto.repo.createRecord "$_username" "$_nsid_upload" "$file_record")" 1805 - success=$(atfile.util.is_xrpc_success $? "$record") 1795 + 1796 + if [[ $success == 1 ]]; then 1797 + file_record="$(blue.zio.atfile.upload "$blob" "$_now" "$file_hash" "$file_hash_type" "$file_date" "$file_name" "$file_size" "$file_type" "$file_meta_record" "$file_finger_record")" 1798 + 1799 + if [[ -n "$key" ]]; then 1800 + atfile.say.debug "Updating record...\n↳ NSID: $_nsid_upload\n↳ Repo: $_username\n↳ Key: $key" 1801 + record="$(com.atproto.repo.putRecord "$_username" "$_nsid_upload" "$key" "$file_record")" 1802 + success=$(atfile.util.is_xrpc_success $? "$record") 1803 + else 1804 + atfile.say.debug "Creating record...\n↳ NSID: $_nsid_upload\n↳ Repo: $_username" 1805 + record="$(com.atproto.repo.createRecord "$_username" "$_nsid_upload" "$file_record")" 1806 + success=$(atfile.util.is_xrpc_success $? "$record") 1807 + fi 1806 1808 fi 1807 1809 fi 1808 1810