mirror of
https://github.com/AntennaPod/AntennaPod.git
synced 2025-10-29 19:59:22 +00:00
Tweak error messages when interacting with text only episode (#7984)
This commit is contained in:
parent
bc16763c5e
commit
428d1901b4
@ -5,9 +5,11 @@ import android.content.Context;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import de.danoeh.antennapod.R;
|
||||
import de.danoeh.antennapod.event.MessageEvent;
|
||||
import de.danoeh.antennapod.storage.database.DBWriter;
|
||||
import de.danoeh.antennapod.model.feed.FeedItem;
|
||||
import de.danoeh.antennapod.model.feed.FeedItemFilter;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
public class AddToQueueSwipeAction implements SwipeAction {
|
||||
|
||||
@ -33,15 +35,20 @@ public class AddToQueueSwipeAction implements SwipeAction {
|
||||
|
||||
@Override
|
||||
public void performAction(FeedItem item, Fragment fragment, FeedItemFilter filter) {
|
||||
if (!item.isTagged(FeedItem.TAG_QUEUE)) {
|
||||
DBWriter.addQueueItem(fragment.requireContext(), item);
|
||||
} else {
|
||||
if (item.isTagged(FeedItem.TAG_QUEUE)) {
|
||||
new RemoveFromQueueSwipeAction().performAction(item, fragment, filter);
|
||||
} else if (item.getMedia() == null) {
|
||||
EventBus.getDefault().post(new MessageEvent(fragment.getString(R.string.no_media_label)));
|
||||
} else {
|
||||
DBWriter.addQueueItem(fragment.requireContext(), item);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean willRemove(FeedItemFilter filter, FeedItem item) {
|
||||
return filter.showQueued || filter.showNew;
|
||||
if (item.getMedia() == null) {
|
||||
return false;
|
||||
}
|
||||
return filter.showNotQueued || filter.showNew;
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,8 +4,10 @@ import android.content.Context;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import de.danoeh.antennapod.R;
|
||||
import de.danoeh.antennapod.actionbutton.DownloadActionButton;
|
||||
import de.danoeh.antennapod.event.MessageEvent;
|
||||
import de.danoeh.antennapod.model.feed.FeedItem;
|
||||
import de.danoeh.antennapod.model.feed.FeedItemFilter;
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
public class StartDownloadSwipeAction implements SwipeAction {
|
||||
|
||||
@ -31,9 +33,12 @@ public class StartDownloadSwipeAction implements SwipeAction {
|
||||
|
||||
@Override
|
||||
public void performAction(FeedItem item, Fragment fragment, FeedItemFilter filter) {
|
||||
if (!item.isDownloaded() && !item.getFeed().isLocalFeed()) {
|
||||
new DownloadActionButton(item)
|
||||
.onClick(fragment.requireContext());
|
||||
if (item.getMedia() == null) {
|
||||
EventBus.getDefault().post(new MessageEvent(fragment.getString(R.string.no_media_label)));
|
||||
} else if (item.getFeed().isLocalFeed() || item.isDownloaded()) {
|
||||
EventBus.getDefault().post(new MessageEvent(fragment.getString(R.string.already_downloaded)));
|
||||
} else {
|
||||
new DownloadActionButton(item).onClick(fragment.requireContext());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -345,6 +345,7 @@
|
||||
<string name="confirm_mobile_streaming_notification_message">Streaming over mobile data connection is disabled in the settings. Tap to stream anyway.</string>
|
||||
<string name="confirm_mobile_streaming_button_always">Always</string>
|
||||
<string name="confirm_mobile_streaming_button_once">Once</string>
|
||||
<string name="already_downloaded">Episode is already downloaded</string>
|
||||
|
||||
<!-- Mediaplayer messages -->
|
||||
<string name="playback_error_generic">The media file could not be played.\n\n- Try deleting and re-downloading the episode.\n- Check your network connection, and make sure no VPN or login page is blocking access.\n- Try long-pressing and sharing the \"Media address\" to your web browser to see if it can be played there. If not, contact the podcast creators.</string>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user