handle ContentNotSupportedException in BaseStateFragment

thus not supported soundcloud streams (e.g. hls streams) don't crash
anyore
pull/3300/head
bopol 2020-03-30 12:38:42 +02:00
rodzic 36b2bea25f
commit cc7a25d9ce
5 zmienionych plików z 8 dodań i 1 usunięć

Wyświetl plik

@ -136,7 +136,7 @@ dependencies {
exclude module: 'support-annotations'
})
implementation 'com.github.TeamNewPipe:NewPipeExtractor:69e0624e3'
implementation 'com.github.B0pol:NewPipeExtractor:cf24e2935cbb46117ab7bd2705d5e86f68f649e1'
testImplementation 'junit:junit:4.12'
testImplementation 'org.mockito:mockito-core:2.23.0'

Wyświetl plik

@ -20,6 +20,7 @@ import org.schabi.newpipe.MainActivity;
import org.schabi.newpipe.R;
import org.schabi.newpipe.ReCaptchaActivity;
import org.schabi.newpipe.extractor.exceptions.ContentNotAvailableException;
import org.schabi.newpipe.extractor.exceptions.ContentNotSupportedException;
import org.schabi.newpipe.extractor.exceptions.ReCaptchaException;
import org.schabi.newpipe.report.ErrorActivity;
import org.schabi.newpipe.report.UserAction;
@ -216,6 +217,9 @@ public abstract class BaseStateFragment<I> extends BaseFragment implements ViewC
} else if (exception instanceof IOException) {
showError(getString(R.string.network_error), true);
return true;
} else if (exception instanceof ContentNotSupportedException) {
showError(getString(R.string.content_not_supported), false);
return true;
}
return false;

Wyświetl plik

@ -586,4 +586,5 @@
<string name="mute">Mutigi</string>
<string name="unmute">Malmutigi</string>
<string name="help">Helpo</string>
<string name="content_not_supported">Tio enhavo ne estas ankoraŭ subtenata per NewPipe.\n\nĜi espereble estos en sekvanta versio.</string>
</resources>

Wyświetl plik

@ -598,4 +598,5 @@
\n
\n Donc le choix vous revient : Préferez-vous la vitesse ou des informations précises \?</string>
<string name="help">Aide</string>
<string name="content_not_supported">Ce contenu n\'est pas encore supporté par NewPipe.\n\nIl le sera peut-être dans une version future.</string>
</resources>

Wyświetl plik

@ -637,4 +637,5 @@
<string name="feed_use_dedicated_fetch_method_enable_button">Enable fast mode</string>
<string name="feed_use_dedicated_fetch_method_disable_button">Disable fast mode</string>
<string name="feed_use_dedicated_fetch_method_help_text">Do you think feed loading is too slow? If so, try enabling fast loading (you can change it in settings or by pressing the button below).\n\nNewPipe offers two feed loading strategies:\n• Fetching the whole subscription channel, which is slow but complete.\n• Using a dedicated service endpoint, which is fast but usually not complete.\n\nThe difference between the two is that the fast one usually lacks some information, like the item\'s duration or type (can\'t distinguish between live videos and normal ones) and it may return less items.\n\nYouTube is an example of a service that offers this fast method with its RSS feed.\n\nSo the choice boils down to what you prefer: speed or precise information.</string>
<string name="content_not_supported">This content is not yet supported by NewPipe.\n\nIt will hopefully be supported in a future version.</string>
</resources>