optimations and fixes

This commit is contained in:
olli 2024-10-18 23:00:15 +02:00
parent d71f344777
commit c3e0060347
2 changed files with 2 additions and 3 deletions

View File

@ -64,7 +64,7 @@ function get_marketdata_coinmarketcap {
local f_id
# get id -> If multiple take the one with the largest marketcap
f_id=$(egrep "^${f_item},[1-9]" COINMARKETCAPIDS | sort -n -t, -k4 | tail -n1 | cut -d, -f2)
f_id=$(egrep "^${f_item},[1-9]" COINMARKETCAPIDS COINMARKETCAPIDS.tmp | sort -n -t, -k4 | tail -n1 | cut -d, -f2)
[[ $f_item = EURC ]] && f_id=20641
if [ -z "$f_id" ]
then
@ -91,7 +91,6 @@ function get_marketdata_coinmarketcap {
# cleanup
rm -f "$f_targetcsvtmp" "${f_targetcsvtmp}".err ${f_targetjsontmp} "${f_targetjsontmp}".err
if [ "$f_timeframe" = "1d" ] || [ "$f_timeframe" = "7d" ]
then
# Download data from coinmarketcap

View File

@ -166,7 +166,7 @@ function webpage {
f_sold=$(egrep "$f_exchange,.+,$f_asset" ALL_TRANSACTIONS_OVERVIEW.csv | tail -n1 | cut -d, -f22)
if ! [ "$f_amount" = 0 ]
then
currency_converter $f_amount $f_asset $TRANSFER_CURRENCY || continue
currency_converter "$f_amount" "$f_asset" "$TRANSFER_CURRENCY" || continue
f_currency_amount=$f_currency_converter_result
g_calc "$f_currency_amount+($f_sold)"
#f_currency_amount=$g_calc_result