mirror of
https://github.com/AntennaPod/AntennaPod.git
synced 2025-10-29 11:49:33 +00:00
Compare commits
3 Commits
3a94f1f430
...
944e0690ba
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
944e0690ba | ||
|
|
b0f52e01f7 | ||
|
|
5eccb2e64e |
2
.github/workflows/close-if-no-reply.yml
vendored
2
.github/workflows/close-if-no-reply.yml
vendored
@ -20,7 +20,7 @@ jobs:
|
||||
stale-pr-label: 'Needs: Reply still'
|
||||
stale-issue-message: "This issue will be closed when we don't get a reply within 7 days."
|
||||
stale-pr-message: "This PR will be closed when we don't get a reply within 7 days."
|
||||
labels-to-remove-when-stale: 'Needs: Reply'
|
||||
labels-to-remove-when-unstale: 'Needs: Reply,Needs: Reply still'
|
||||
close-issue-label: "Close reason: No reply"
|
||||
close-pr-label: "Close reason: No reply"
|
||||
close-issue-message: "This issue was closed because we didn't get a reply for 14 days."
|
||||
|
||||
@ -34,6 +34,8 @@ public class FeedUpdateManagerImpl extends FeedUpdateManager {
|
||||
public static final String EXTRA_EVEN_ON_MOBILE = "even_on_mobile";
|
||||
public static final String EXTRA_MANUAL = "manual";
|
||||
private static final String TAG = "AutoUpdateManager";
|
||||
private static long lastManualRefreshTime = 0;
|
||||
private static final long REFRESH_COOLDOWN_MS = 20_000;
|
||||
|
||||
/**
|
||||
* Start / restart periodic auto feed refresh
|
||||
@ -64,6 +66,7 @@ public class FeedUpdateManagerImpl extends FeedUpdateManager {
|
||||
}
|
||||
|
||||
public void runOnce(Context context, Feed feed, boolean nextPage) {
|
||||
lastManualRefreshTime = System.currentTimeMillis();
|
||||
OneTimeWorkRequest.Builder workRequest = new OneTimeWorkRequest.Builder(FeedUpdateWorker.class)
|
||||
.setInitialDelay(0L, TimeUnit.MILLISECONDS)
|
||||
.setExpedited(OutOfQuotaPolicy.RUN_AS_NON_EXPEDITED_WORK_REQUEST)
|
||||
@ -89,6 +92,11 @@ public class FeedUpdateManagerImpl extends FeedUpdateManager {
|
||||
}
|
||||
|
||||
public void runOnceOrAsk(@NonNull Context context, @Nullable Feed feed) {
|
||||
if (System.currentTimeMillis() - lastManualRefreshTime < REFRESH_COOLDOWN_MS) {
|
||||
EventBus.getDefault().post(new MessageEvent(context.getString(R.string.please_wait_before_refreshing)));
|
||||
EventBus.getDefault().postSticky(new FeedUpdateRunningEvent(false));
|
||||
return;
|
||||
}
|
||||
Log.d(TAG, "Run auto update immediately in background.");
|
||||
if (feed != null && feed.isLocalFeed()) {
|
||||
runOnce(context, feed);
|
||||
|
||||
@ -211,6 +211,7 @@
|
||||
<string name="multi_select_started_talkback">Multi select actions shown at the bottom</string>
|
||||
<string name="filtered_label">Filtered</string>
|
||||
<string name="refresh_failed_msg">Last refresh failed. Tap to view details.</string>
|
||||
<string name="please_wait_before_refreshing">Please wait some time before refreshing podcasts again.</string>
|
||||
<string name="open_podcast">Open podcast</string>
|
||||
<string name="please_wait_for_data">Please wait until the data is loaded</string>
|
||||
<string name="updates_disabled_label">Updates disabled</string>
|
||||
|
||||
@ -101,6 +101,7 @@
|
||||
<item>60</item>
|
||||
<item>120</item>
|
||||
<item>300</item>
|
||||
<item>600</item>
|
||||
</string-array>
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user