Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not remove items generating errors form queue #3704

Merged
merged 1 commit into from
Jun 15, 2020

Conversation

Stypox
Copy link
Member

@Stypox Stypox commented May 31, 2020

What is it?

  • Bug fix (user facing)
  • Feature (user facing)
  • Code base improvement (dev facing)
  • Meta improvement to the project (dev facing)

Description of the changes in your PR

When an item in the play queue failed to load, only some kind of errors were previously considered as "skippable" (i.e. go to the next stream without removing the current one). But other errors were not (e.g. network errors), so it was annoying in case of a temporary internet instability, because many streams would be removed from a possibly carefully handcrafted queue. This PR keeps the old behaviour when a stream cannot be played, except that every item is considered as "skippable". So if an erroring stream is encountered, the queue index is incremented without removing the old item. If the end of the queue is reached, the index never resets to 0 (even in repeating mode), to prevent "Could not play this stream" loops in case every stream fails.

Fixes the following issue(s)

Testing apk

@barudaret @gillhash @daufinsyd
app-debug.zip

Agreement

@opusforlife2
Copy link
Collaborator

Yes! Finally! Praise be to our lord and saviour Stypox!

@wb9688
Copy link
Contributor

wb9688 commented May 31, 2020

Why did that code even exist in the first place?

@Stypox
Copy link
Member Author

Stypox commented May 31, 2020

@wb9688 I have no idea 🤷‍♂

@androidSwDev099
Copy link

androidSwDev099 commented Jun 4, 2020

@Stypox,
can't import or export settings into this debug version, but downloading audio files works. Is there a reason for this?

Trying to export settings causes a ui error crash.

The crash information when I try to export settings as part of debugging why I couldn't import settings:

Exception

  • User Action: ui error
  • Request:
  • Content Language: en_US
  • Service: none
  • Version: 0.19.3 (the debug apk in zip of first post)
  • OS: Linux Android 10 - 29
Crash log

java.io.FileNotFoundException: /storage/emulated/0/NewPipeData-20200604_110514.zip: open failed: EACCES (Permission denied)
	at libcore.io.IoBridge.open(IoBridge.java:496)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:235)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:125)
	at org.schabi.newpipe.settings.ContentSettingsFragment.exportDatabase(ContentSettingsFragment.java:199)
	at org.schabi.newpipe.settings.ContentSettingsFragment.onActivityResult(ContentSettingsFragment.java:181)
	at androidx.fragment.app.FragmentActivity.onActivityResult(FragmentActivity.java:170)
	at android.app.Activity.dispatchActivityResult(Activity.java:8145)
	at android.app.ActivityThread.deliverResults(ActivityThread.java:4983)
	at android.app.ActivityThread.handleSendResult(ActivityThread.java:5031)
	at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)
	at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2063)
	at android.os.Handler.dispatchMessage(Handler.java:107)
	at android.os.Looper.loop(Looper.java:214)
	at android.app.ActivityThread.main(ActivityThread.java:7615)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:964)
Caused by: android.system.ErrnoException: open failed: EACCES (Permission denied)
	at libcore.io.Linux.open(Native Method)
	at libcore.io.ForwardingOs.open(ForwardingOs.java:167)
	at libcore.io.BlockGuardOs.open(BlockGuardOs.java:252)
	at libcore.io.ForwardingOs.open(ForwardingOs.java:167)
	at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:7532)
	at libcore.io.IoBridge.open(IoBridge.java:482)
	... 18 more


@androidSwDev099
Copy link

androidSwDev099 commented Jun 4, 2020

@Stypox ,
Settings import/export with the debug version works fine one my Android 6 device. I'm using 0.19.5 on both devices (Android 10 and Android 6) with no issues.

@Stypox
Copy link
Member Author

Stypox commented Jun 4, 2020

I don't remember for sure, but probably the apk I built was not on 0.19.5 but on the buggy 0.19.4. Also, that problem is completely unrelated from the changes made here

@androidSwDev099
Copy link

@Stypox,
Debug app information has 19.3, so it seems to imply that the debug version was built with 19.3? Guess I'll wait for another release. The bug has been causing me some misery with dropping videos in a 3000+ video list - cannot wait to be using a version with the fix :)

@opusforlife2
Copy link
Collaborator

Is there a way (using Github Actions or something) that when a new version is released, the debug apks in various open PRs are automatically updated?

@wb9688 wb9688 merged commit 5cfd8bb into TeamNewPipe:dev Jun 15, 2020
This was referenced Jul 8, 2020
@Stypox Stypox deleted the keep-failed-streams branch August 4, 2022 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants