try to fix 'cannot make a new request because the previous response ... ' error (#164)

* Translations (#163)

* Translated using Weblate (Italian)

Currently translated at 100.0% (323 of 323 strings)

Translation: PeerTube/Android
Translate-URL: https://hosted.weblate.org/projects/peertube/android/it/

* Translated using Weblate (Chinese (Simplified))

Currently translated at 38.7% (125 of 323 strings)

Translation: PeerTube/Android
Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/

* Translated using Weblate (French)

Currently translated at 100.0% (323 of 323 strings)

Translation: PeerTube/Android
Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/

* Translated using Weblate (Chinese (Simplified))

Currently translated at 48.0% (155 of 323 strings)

Translation: PeerTube/Android
Translate-URL: https://hosted.weblate.org/projects/peertube/android/zh_Hans/

* Translated using Weblate (German)

Currently translated at 100.0% (323 of 323 strings)

Translation: PeerTube/Android
Translate-URL: https://hosted.weblate.org/projects/peertube/android/de/

* Translated using Weblate (French)

Currently translated at 100.0% (323 of 323 strings)

Translation: PeerTube/Android
Translate-URL: https://hosted.weblate.org/projects/peertube/android/fr/

* Translated using Weblate (Russian)

Currently translated at 99.3% (321 of 323 strings)

Translation: PeerTube/Android
Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/

* Translated using Weblate (Russian)

Currently translated at 99.3% (321 of 323 strings)

Translation: PeerTube/Android
Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/

* Translated using Weblate (Bengali)

Currently translated at 99.3% (321 of 323 strings)

Translation: PeerTube/Android
Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/

* Translated using Weblate (Spanish)

Currently translated at 42.1% (136 of 323 strings)

Translation: PeerTube/Android
Translate-URL: https://hosted.weblate.org/projects/peertube/android/es/

* Translated using Weblate (Bengali)

Currently translated at 100.0% (323 of 323 strings)

Translation: PeerTube/Android
Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/

* Translated using Weblate (Bengali)

Currently translated at 99.6% (322 of 323 strings)

Translation: PeerTube/Android
Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/

* Translated using Weblate (Persian)

Currently translated at 40.2% (130 of 323 strings)

Translation: PeerTube/Android
Translate-URL: https://hosted.weblate.org/projects/peertube/android/fa/

* Translated using Weblate (Bengali)

Currently translated at 99.6% (322 of 323 strings)

Translation: PeerTube/Android
Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/

* Translated using Weblate (Bengali)

Currently translated at 99.6% (322 of 323 strings)

Translation: PeerTube/Android
Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/

* Translated using Weblate (Bengali)

Currently translated at 99.6% (322 of 323 strings)

Translation: PeerTube/Android
Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/

* Translated using Weblate (Bengali)

Currently translated at 100.0% (323 of 323 strings)

Translation: PeerTube/Android
Translate-URL: https://hosted.weblate.org/projects/peertube/android/bn/

* Translated using Weblate (Polish)

Currently translated at 100.0% (323 of 323 strings)

Translation: PeerTube/Android
Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/

* Translated using Weblate (Polish)

Currently translated at 100.0% (323 of 323 strings)

Translation: PeerTube/Android
Translate-URL: https://hosted.weblate.org/projects/peertube/android/pl/

* Translated using Weblate (Russian)

Currently translated at 100.0% (323 of 323 strings)

Translation: PeerTube/Android
Translate-URL: https://hosted.weblate.org/projects/peertube/android/ru/

* update library and more (#160)

* download files with friendly name (not video ID)

* Update Picasso library
FIX : add extension in downloaded filename.
download files with friendly name (not video ID)

* Update Gradle
Add 0.75x and 1.25x to play speed

* Release v1.0.35

Co-authored-by: Michael Moroni <michaelmoroni@disroot.org>
Co-authored-by: mostkai <admin@pwplayer.com>
Co-authored-by: B0pol <bopol@e.email>
Co-authored-by: Jeannette L <j.lavoie@net-c.ca>
Co-authored-by: Nathan <bonnemainsnathan@gmail.com>
Co-authored-by: Mihail Iosilevitch <yosik@tutanota.com>
Co-authored-by: anonymous <noreply@weblate.org>
Co-authored-by: Oymate <dhruboadittya96@gmail.com>
Co-authored-by: Juanro49 <juanrobertogarciasanchez@gmail.com>
Co-authored-by: Mostafa Ahangarha <ahangarha@gmail.com>
Co-authored-by: Szylu <chipolade@gmail.com>
Co-authored-by: Artem <KovalevArtem.ru@gmail.com>
Co-authored-by: jmgfr <13685004+jmgfr@users.noreply.github.com>
Co-authored-by: Stefan Schueller <sschueller@nunight.com>

* try to fix 'cannot make a new request because the previous response is still open' when login.

Co-authored-by: Stefan Schüller <sschueller@techdroid.com>
Co-authored-by: Michael Moroni <michaelmoroni@disroot.org>
Co-authored-by: mostkai <admin@pwplayer.com>
Co-authored-by: B0pol <bopol@e.email>
Co-authored-by: Jeannette L <j.lavoie@net-c.ca>
Co-authored-by: Nathan <bonnemainsnathan@gmail.com>
Co-authored-by: Mihail Iosilevitch <yosik@tutanota.com>
Co-authored-by: anonymous <noreply@weblate.org>
Co-authored-by: Oymate <dhruboadittya96@gmail.com>
Co-authored-by: Juanro49 <juanrobertogarciasanchez@gmail.com>
Co-authored-by: Mostafa Ahangarha <ahangarha@gmail.com>
Co-authored-by: Szylu <chipolade@gmail.com>
Co-authored-by: Artem <KovalevArtem.ru@gmail.com>
Co-authored-by: jmgfr <13685004+jmgfr@users.noreply.github.com>
Co-authored-by: Stefan Schueller <sschueller@nunight.com>
This commit is contained in:
lishoujun 2020-06-08 03:48:53 +08:00 committed by GitHub
parent 8b3f688435
commit 8224b039bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,8 +37,7 @@ public class AuthorizationInterceptor implements Interceptor {
public Response intercept(Chain chain) throws IOException { public Response intercept(Chain chain) throws IOException {
Session session = Session.getInstance(); Session session = Session.getInstance();
Response mainResponse;
Response mainResponse = chain.proceed(chain.request());
Request mainRequest = chain.request(); Request mainRequest = chain.request();
if (session.isLoggedIn()) { if (session.isLoggedIn()) {
@ -49,7 +48,8 @@ public class AuthorizationInterceptor implements Interceptor {
// Log.v("Authorization", "Intercept: " + session.getToken()); // Log.v("Authorization", "Intercept: " + session.getToken());
// build request // build request
mainResponse = chain.proceed(builder.build()); Request req = builder.build();
mainResponse = chain.proceed(req);
// logout on auth error // logout on auth error
if (mainResponse.code() == 401 || mainResponse.code() == 403) { if (mainResponse.code() == 401 || mainResponse.code() == 403) {
@ -57,6 +57,8 @@ public class AuthorizationInterceptor implements Interceptor {
Log.v("Authorization", "Intercept: Logout forced"); Log.v("Authorization", "Intercept: Logout forced");
} }
}else{
mainResponse = chain.proceed(chain.request());
} }
return mainResponse; return mainResponse;