The goal here is to convert all player intents to use a single enum
with extra data for each case. The queue ones are pretty easy, they
don’t carry any extra data. We fall through for everything else for
now.
We can do this, because:
1. if `playQueue` is not null, we return early
2. if `playQueue` is null and we need to enqueue:
- the only “proper” case that could be triggered is
the `RESUME_PLAYBACK` case, which is never `true` for the queuing
intents, see the comment in `NavigationHelper.enqueueOnPlayer`
- the generic `else` case is degenerate, because it would crash on
`playQueue` being `null`.
This makes some sense, because there is no way to trigger the
enqueueing logic via the UI currently if there is no video playing
yet, in which case `playQueue` is not `null`.
So we need to transform this whole if desaster into a big switch.
Okay, so this is the … only? branch in this if-chain that will
conditionally fire if `playQueue` *is* `null`, sometimes.
This is why the unconditional `initPlayback` in `else` is not passed a
`null` in many cases … because `RESUME_PLAYBACK` is `true` and
`playQueue` is `null`.
It’s gonna be hard to figure out which parts of that are intentional,
I say.
- ErrorInfo.getMessage() now returns an ErrorMessage instance that can be formatted into a string using a context (this allows the construction of an ErrorInfo to remain independent of a Context)
- now the service ID is used in ErrorInfo.getMessage() to customize some messages based on the currently selected service
- player HTTP invalid statuses are now included in the message
- building a custom error message for AccountTerminatedException was moved from ErrorPanelHelper to ErrorInfo
Currently translated at 100.0% (748 of 748 strings)
Translated using Weblate (Arabic)
Currently translated at 100.0% (86 of 86 strings)
Translated using Weblate (Russian)
Currently translated at 100.0% (86 of 86 strings)
Translated using Weblate (Arabic)
Currently translated at 100.0% (748 of 748 strings)
Translated using Weblate (Arabic)
Currently translated at 100.0% (748 of 748 strings)
Translated using Weblate (Russian)
Currently translated at 100.0% (748 of 748 strings)
Translated using Weblate (Turkish)
Currently translated at 100.0% (748 of 748 strings)
Translated using Weblate (Indonesian)
Currently translated at 100.0% (748 of 748 strings)
Translated using Weblate (French)
Currently translated at 100.0% (748 of 748 strings)
Translated using Weblate (Icelandic)
Currently translated at 99.4% (745 of 749 strings)
Translated using Weblate (Estonian)
Currently translated at 18.6% (16 of 86 strings)
Translated using Weblate (Slovak)
Currently translated at 100.0% (86 of 86 strings)
Translated using Weblate (Portuguese (Portugal))
Currently translated at 99.5% (746 of 749 strings)
Translated using Weblate (Belarusian)
Currently translated at 99.7% (747 of 749 strings)
Translated using Weblate (Estonian)
Currently translated at 100.0% (749 of 749 strings)
Translated using Weblate (Bulgarian)
Currently translated at 100.0% (749 of 749 strings)
Translated using Weblate (Hebrew)
Currently translated at 99.7% (747 of 749 strings)
Translated using Weblate (Chinese (Traditional Han script))
Currently translated at 100.0% (749 of 749 strings)
Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 100.0% (749 of 749 strings)
Translated using Weblate (Portuguese (Brazil))
Currently translated at 100.0% (749 of 749 strings)
Translated using Weblate (Polish)
Currently translated at 100.0% (749 of 749 strings)
Translated using Weblate (Ukrainian)
Currently translated at 100.0% (749 of 749 strings)
Translated using Weblate (Czech)
Currently translated at 100.0% (749 of 749 strings)
Translated using Weblate (Slovak)
Currently translated at 99.7% (747 of 749 strings)
Translated using Weblate (Greek)
Currently translated at 100.0% (749 of 749 strings)
Translated using Weblate (Portuguese)
Currently translated at 99.5% (746 of 749 strings)
Translated using Weblate (Italian)
Currently translated at 100.0% (749 of 749 strings)
Translated using Weblate (Hungarian)
Currently translated at 100.0% (749 of 749 strings)
Translated using Weblate (German)
Currently translated at 100.0% (749 of 749 strings)
Translated using Weblate (German)
Currently translated at 100.0% (749 of 749 strings)
Translated using Weblate (Tamazight (Central Atlas))
Currently translated at 19.2% (144 of 749 strings)
Translated using Weblate (Macedonian)
Currently translated at 79.3% (594 of 749 strings)
Translated using Weblate (Slovenian)
Currently translated at 54.6% (409 of 749 strings)
Translated using Weblate (Tigrinya)
Currently translated at 12.7% (95 of 747 strings)
Translated using Weblate (Tigrinya)
Currently translated at 3.4% (3 of 86 strings)
Translated using Weblate (Icelandic)
Currently translated at 99.4% (743 of 747 strings)
Translated using Weblate (Chinese (Simplified Han script))
Currently translated at 90.6% (78 of 86 strings)
Translated using Weblate (Slovak)
Currently translated at 100.0% (86 of 86 strings)
Translated using Weblate (French)
Currently translated at 100.0% (86 of 86 strings)
Translated using Weblate (Italian)
Currently translated at 100.0% (86 of 86 strings)
Translated using Weblate (Italian)
Currently translated at 100.0% (86 of 86 strings)
Translated using Weblate (Polish)
Currently translated at 58.1% (50 of 86 strings)
Translated using Weblate (Hindi)
Currently translated at 100.0% (86 of 86 strings)
Translated using Weblate (Hungarian)
Currently translated at 100.0% (86 of 86 strings)
Translated using Weblate (Punjabi)
Currently translated at 100.0% (86 of 86 strings)
Translated using Weblate (Czech)
Currently translated at 100.0% (86 of 86 strings)
Translated using Weblate (Ukrainian)
Currently translated at 100.0% (86 of 86 strings)
Translated using Weblate (German)
Currently translated at 100.0% (86 of 86 strings)
Translated using Weblate (Belarusian)
Currently translated at 100.0% (747 of 747 strings)
Translated using Weblate (Punjabi)
Currently translated at 100.0% (747 of 747 strings)
Translated using Weblate (Hindi)
Currently translated at 100.0% (747 of 747 strings)
Translated using Weblate (Czech)
Currently translated at 100.0% (747 of 747 strings)
Translated using Weblate (Slovak)
Currently translated at 100.0% (747 of 747 strings)
Translated using Weblate (Slovak)
Currently translated at 100.0% (747 of 747 strings)
Translated using Weblate (German)
Currently translated at 100.0% (747 of 747 strings)
Co-authored-by: 439JBYL80IGQTF25UXNR0X1BG <439JBYL80IGQTF25UXNR0X1BG@users.noreply.hosted.weblate.org>
Co-authored-by: Agnieszka C <aga_04@o2.pl>
Co-authored-by: Drugi Sapog <dindrugi@users.noreply.hosted.weblate.org>
Co-authored-by: Dual Natan <dvapatinatan@gmail.com>
Co-authored-by: Emin Tufan Çetin <etcetin@gmail.com>
Co-authored-by: Fjuro <fjuro@alius.cz>
Co-authored-by: Ghost of Sparta <makesocialfoss32@keemail.me>
Co-authored-by: Hakim Oubouali <hakim.oubouali.skr@gmail.com>
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Igor Rückert <igorruckert@yahoo.com.br>
Co-authored-by: Igor Sorocean <sorocean.igor@gmail.com>
Co-authored-by: Jeff Huang <s8321414@gmail.com>
Co-authored-by: Marian Hanzel <marulinko@gmail.com>
Co-authored-by: Matej U <mateju@src.gnome.org>
Co-authored-by: Michael Moroni <michaelmoroni@disroot.org>
Co-authored-by: Mickaël Binos <mickaelbinos@outlook.com>
Co-authored-by: Milan <mobrcian@hotmail.com>
Co-authored-by: NTFSynergy <ntfsynergy@gmail.com>
Co-authored-by: Priit Jõerüüt <jrthwlate@users.noreply.hosted.weblate.org>
Co-authored-by: Random <random-r@users.noreply.hosted.weblate.org>
Co-authored-by: Rex_sa <rex.sa@pm.me>
Co-authored-by: Stypox <stypox@pm.me>
Co-authored-by: Sveinn í Felli <sv1@fellsnet.is>
Co-authored-by: Trunars <trunars@abv.bg>
Co-authored-by: Vasilis K <skyhirules@gmail.com>
Co-authored-by: VfBFan <drop0815@posteo.de>
Co-authored-by: Yaron Shahrabani <sh.yaron@gmail.com>
Co-authored-by: Yassin Amir <y6b5@proton.me>
Co-authored-by: erti <erti@users.noreply.hosted.weblate.org>
Co-authored-by: ikanakova <ikanakova@users.noreply.hosted.weblate.org>
Co-authored-by: nautilusx <translate@disroot.org>
Co-authored-by: ssantos <ssantos@web.de>
Co-authored-by: whistlingwoods <72640314+whistlingwoods@users.noreply.github.com>
Co-authored-by: zmni <zmni@outlook.com>
Co-authored-by: Максим Горпиніч <gorpinicmaksim5@gmail.com>
Co-authored-by: 大王叫我来巡山 <hamburger2048@users.noreply.hosted.weblate.org>
Co-authored-by: 赖诚俊 <cosmic.universe.glitch@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/ar/
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/cs/
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/de/
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/et/
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/fr/
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/hi/
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/hu/
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/it/
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/pa/
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/pl/
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/ru/
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/sk/
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/ti/
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/uk/
Translate-URL: https://hosted.weblate.org/projects/newpipe/metadata/zh_Hans/
Translation: NewPipe/Metadata
formatters() is called again by the player before the user has a chance to click on the language in the language chooser.
So the correct solution would probably be to attach to https://developer.android.com/reference/android/content/Intent#ACTION_LOCALE_CHANGED, but let's keep it simple. I added `PlayerHelper.resetFormat();` in `ContentSettingsFragment.onDestroy()` and it works. It will mean the player formatters will be reset every time the user exits content settings, but whatever.
and reset them when the language is changed/changing.
This way they will be re-initialized on the next call.
Also Remove a bunch of outdated/non-thread safe code (STRING_FORMATTER)