Add custom API key support and retry logic for Last.fm import
- Add API key field to Last.fm settings UI with helpful info text - Store and load custom API key from settings - Use custom API key in lastfmimport if provided, fall back to default - Implement exponential backoff retry logic (up to 5 retries) - Retry on HTTP 500/503 errors with increasing delays (5s, 10s, 20s, 40s, 80s) - Add retry count tracking to request structures Co-authored-by: jonaski <10343810+jonaski@users.noreply.github.com>
This commit is contained in:
@@ -234,6 +234,43 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="layout_lastfm_api_key">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_lastfm_api_key">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>80</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>API key:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="lineedit_lastfm_api_key">
|
||||
<property name="placeholderText">
|
||||
<string>Optional - your own Last.fm API key</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_lastfm_api_key_info">
|
||||
<property name="text">
|
||||
<string><html><head/><body><p><span style=" font-size:8pt;">Using your own API key can help avoid rate limiting for large libraries. Get one at </span><a href="https://www.last.fm/api/account/create"><span style=" font-size:8pt; text-decoration: underline; color:#0000ff;">https://www.last.fm/api/account/create</span></a></p></body></html></string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="LoginStateWidget" name="widget_lastfm_login_state" native="true"/>
|
||||
</item>
|
||||
@@ -394,6 +431,7 @@
|
||||
<tabstop>checkbox_source_somafm</tabstop>
|
||||
<tabstop>checkbox_source_radioparadise</tabstop>
|
||||
<tabstop>checkbox_lastfm_enable</tabstop>
|
||||
<tabstop>lineedit_lastfm_api_key</tabstop>
|
||||
<tabstop>button_lastfm_login</tabstop>
|
||||
<tabstop>checkbox_listenbrainz_enable</tabstop>
|
||||
<tabstop>lineedit_listenbrainz_user_token</tabstop>
|
||||
|
||||
Reference in New Issue
Block a user