From 48624cc34aa6c57bfb809cca873e3ec0eb68380a Mon Sep 17 00:00:00 2001 From: Docile-Alligator <25734209+Docile-Alligator@users.noreply.github.com> Date: Tue, 9 Jan 2024 23:21:16 -0500 Subject: Remove Gfycat. --- .../FetchGfycatOrRedgifsVideoLinks.java | 135 -------------- .../infinityforreddit/FetchRedgifsVideoLinks.java | 76 ++++++++ .../infinityforreddit/NetworkModule.java | 9 - .../activities/LinkResolverActivity.java | 13 +- .../activities/LoginActivity.java | 1 + .../infinityforreddit/activities/MainActivity.java | 5 + .../activities/SubscribedThingListingActivity.java | 7 +- .../activities/ViewVideoActivity.java | 131 ++++---------- .../adapters/HistoryPostRecyclerViewAdapter.java | 197 +++++++++----------- .../adapters/PostDetailRecyclerViewAdapter.java | 83 ++++----- .../adapters/PostRecyclerViewAdapter.java | 200 +++++++++------------ .../infinityforreddit/apis/GfycatAPI.java | 10 -- .../infinityforreddit/apis/RedditAPI.java | 4 - .../asynctasks/SwitchAccount.java | 1 + .../fragments/HistoryPostFragment.java | 5 +- .../infinityforreddit/fragments/PostFragment.java | 17 +- .../fragments/ViewPostDetailFragment.java | 7 +- .../infinityforreddit/post/FetchRemovedPost.java | 2 +- .../infinityforreddit/post/ParsePost.java | 66 ++----- .../infinityforreddit/post/Post.java | 39 ++-- .../settings/AdvancedPreferenceFragment.java | 4 + .../infinityforreddit/utils/APIUtils.java | 1 - .../utils/SharedPreferencesUtils.java | 2 +- .../res/layout/item_post_card_2_video_autoplay.xml | 2 +- ...ost_card_2_video_autoplay_legacy_controller.xml | 2 +- .../item_post_card_3_video_type_autoplay.xml | 2 +- ...ard_3_video_type_autoplay_legacy_controller.xml | 2 +- .../res/layout/item_post_detail_video_autoplay.xml | 2 +- ...ost_detail_video_autoplay_legacy_controller.xml | 2 +- .../res/layout/item_post_video_type_autoplay.xml | 2 +- ..._post_video_type_autoplay_legacy_controller.xml | 2 +- app/src/main/res/values-cs/strings.xml | 2 - app/src/main/res/values-de/strings.xml | 2 - app/src/main/res/values-el/strings.xml | 4 +- app/src/main/res/values-es/strings.xml | 2 - app/src/main/res/values-fr/strings.xml | 2 - app/src/main/res/values-hi/strings.xml | 2 - app/src/main/res/values-hr/strings.xml | 2 - app/src/main/res/values-hu/strings.xml | 2 - app/src/main/res/values-it/strings.xml | 2 - app/src/main/res/values-ja/strings.xml | 2 - app/src/main/res/values-ko/strings.xml | 1 - app/src/main/res/values-nl/strings.xml | 2 - app/src/main/res/values-pl/strings.xml | 2 - app/src/main/res/values-pt-rBR/strings.xml | 2 - app/src/main/res/values-pt/strings.xml | 2 - app/src/main/res/values-ro/strings.xml | 2 - app/src/main/res/values-ru/strings.xml | 2 - app/src/main/res/values-tr-rTR/strings.xml | 2 - app/src/main/res/values-uk/strings.xml | 2 - app/src/main/res/values-vi/strings.xml | 2 - app/src/main/res/values-zh-rCN/strings.xml | 2 - app/src/main/res/values/strings.xml | 2 - app/src/main/res/xml/video_preferences.xml | 5 - 54 files changed, 380 insertions(+), 701 deletions(-) delete mode 100644 app/src/main/java/ml/docilealligator/infinityforreddit/FetchGfycatOrRedgifsVideoLinks.java create mode 100644 app/src/main/java/ml/docilealligator/infinityforreddit/FetchRedgifsVideoLinks.java delete mode 100644 app/src/main/java/ml/docilealligator/infinityforreddit/apis/GfycatAPI.java diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/FetchGfycatOrRedgifsVideoLinks.java b/app/src/main/java/ml/docilealligator/infinityforreddit/FetchGfycatOrRedgifsVideoLinks.java deleted file mode 100644 index 1f55fb7f..00000000 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/FetchGfycatOrRedgifsVideoLinks.java +++ /dev/null @@ -1,135 +0,0 @@ -package ml.docilealligator.infinityforreddit; - -import android.content.Context; -import android.content.SharedPreferences; -import android.os.Handler; - -import org.json.JSONException; -import org.json.JSONObject; - -import java.io.IOException; -import java.util.concurrent.Executor; - -import ml.docilealligator.infinityforreddit.apis.GfycatAPI; -import ml.docilealligator.infinityforreddit.apis.RedgifsAPI; -import ml.docilealligator.infinityforreddit.utils.APIUtils; -import ml.docilealligator.infinityforreddit.utils.JSONUtils; -import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; -import retrofit2.Call; -import retrofit2.Response; -import retrofit2.Retrofit; - -public class FetchGfycatOrRedgifsVideoLinks { - - public interface FetchGfycatOrRedgifsVideoLinksListener { - void success(String webm, String mp4); - void failed(int errorCode); - } - - public static void fetchGfycatVideoLinks(Executor executor, Handler handler, Retrofit gfycatRetrofit, - String gfycatId, - FetchGfycatOrRedgifsVideoLinksListener fetchGfycatOrRedgifsVideoLinksListener) { - executor.execute(() -> { - try { - Response response = gfycatRetrofit.create(GfycatAPI.class).getGfycatData(gfycatId).execute(); - if (response.isSuccessful()) { - parseGfycatVideoLinks(handler, response.body(), fetchGfycatOrRedgifsVideoLinksListener); - } else { - handler.post(() -> fetchGfycatOrRedgifsVideoLinksListener.failed(response.code())); - } - } catch (IOException e) { - e.printStackTrace(); - handler.post(() -> fetchGfycatOrRedgifsVideoLinksListener.failed(-1)); - } - }); - } - - public static void fetchRedgifsVideoLinks(Context context, Executor executor, Handler handler, Retrofit redgifsRetrofit, - SharedPreferences currentAccountSharedPreferences, - String gfycatId, - FetchGfycatOrRedgifsVideoLinksListener fetchGfycatOrRedgifsVideoLinksListener) { - executor.execute(() -> { - try { - Response response = redgifsRetrofit.create(RedgifsAPI.class).getRedgifsData(APIUtils.getRedgifsOAuthHeader(currentAccountSharedPreferences.getString(SharedPreferencesUtils.REDGIFS_ACCESS_TOKEN, "")), - gfycatId, APIUtils.USER_AGENT).execute(); - if (response.isSuccessful()) { - parseRedgifsVideoLinks(handler, response.body(), fetchGfycatOrRedgifsVideoLinksListener); - } else { - handler.post(() -> fetchGfycatOrRedgifsVideoLinksListener.failed(response.code())); - } - } catch (IOException e) { - e.printStackTrace(); - handler.post(() -> fetchGfycatOrRedgifsVideoLinksListener.failed(-1)); - } - }); - } - - public static void fetchGfycatOrRedgifsVideoLinksInRecyclerViewAdapter(Executor executor, Handler handler, - Call gfycatCall, - boolean isGfycatVideo, - boolean automaticallyTryRedgifs, - FetchGfycatOrRedgifsVideoLinksListener fetchGfycatOrRedgifsVideoLinksListener) { - executor.execute(() -> { - try { - Response response = gfycatCall.execute(); - if (response.isSuccessful()) { - if (isGfycatVideo) { - parseGfycatVideoLinks(handler, response.body(), fetchGfycatOrRedgifsVideoLinksListener); - } else { - parseRedgifsVideoLinks(handler, response.body(), fetchGfycatOrRedgifsVideoLinksListener); - } - } else { - if (response.code() == 404 && isGfycatVideo && automaticallyTryRedgifs) { - fetchGfycatOrRedgifsVideoLinksInRecyclerViewAdapter(executor, handler, gfycatCall.clone(), - false, false, fetchGfycatOrRedgifsVideoLinksListener); - } else { - handler.post(() -> fetchGfycatOrRedgifsVideoLinksListener.failed(response.code())); - } - } - } catch (IOException e) { - e.printStackTrace(); - handler.post(() -> fetchGfycatOrRedgifsVideoLinksListener.failed(-1)); - } - }); - } - - private static void parseGfycatVideoLinks(Handler handler, String response, - FetchGfycatOrRedgifsVideoLinksListener fetchGfycatOrRedgifsVideoLinksListener) { - try { - JSONObject jsonObject = new JSONObject(response); - String mp4 = jsonObject.getJSONObject(JSONUtils.GFY_ITEM_KEY).has(JSONUtils.MP4_URL_KEY) ? - jsonObject.getJSONObject(JSONUtils.GFY_ITEM_KEY).getString(JSONUtils.MP4_URL_KEY) - : jsonObject.getJSONObject(JSONUtils.GFY_ITEM_KEY) - .getJSONObject(JSONUtils.CONTENT_URLS_KEY) - .getJSONObject(JSONUtils.MP4_KEY) - .getString(JSONUtils.URL_KEY); - String webm; - if (jsonObject.getJSONObject(JSONUtils.GFY_ITEM_KEY).has(JSONUtils.WEBM_URL_KEY)) { - webm = jsonObject.getJSONObject(JSONUtils.GFY_ITEM_KEY).getString(JSONUtils.WEBM_URL_KEY); - } else if (jsonObject.getJSONObject(JSONUtils.GFY_ITEM_KEY).getJSONObject(JSONUtils.CONTENT_URLS_KEY).has(JSONUtils.WEBM_KEY)) { - webm = jsonObject.getJSONObject(JSONUtils.GFY_ITEM_KEY) - .getJSONObject(JSONUtils.CONTENT_URLS_KEY) - .getJSONObject(JSONUtils.WEBM_KEY) - .getString(JSONUtils.URL_KEY); - } else { - webm = mp4; - } - handler.post(() -> fetchGfycatOrRedgifsVideoLinksListener.success(webm, mp4)); - } catch (JSONException e) { - e.printStackTrace(); - handler.post(() -> fetchGfycatOrRedgifsVideoLinksListener.failed(-1)); - } - } - - private static void parseRedgifsVideoLinks(Handler handler, String response, - FetchGfycatOrRedgifsVideoLinksListener fetchGfycatOrRedgifsVideoLinksListener) { - try { - String mp4 = new JSONObject(response).getJSONObject(JSONUtils.GIF_KEY).getJSONObject(JSONUtils.URLS_KEY) - .getString(JSONUtils.HD_KEY); - handler.post(() -> fetchGfycatOrRedgifsVideoLinksListener.success(mp4, mp4)); - } catch (JSONException e) { - e.printStackTrace(); - handler.post(() -> fetchGfycatOrRedgifsVideoLinksListener.failed(-1)); - } - } -} diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/FetchRedgifsVideoLinks.java b/app/src/main/java/ml/docilealligator/infinityforreddit/FetchRedgifsVideoLinks.java new file mode 100644 index 00000000..8435f3ea --- /dev/null +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/FetchRedgifsVideoLinks.java @@ -0,0 +1,76 @@ +package ml.docilealligator.infinityforreddit; + +import android.content.SharedPreferences; +import android.os.Handler; + +import org.json.JSONException; +import org.json.JSONObject; + +import java.io.IOException; +import java.util.concurrent.Executor; + +import ml.docilealligator.infinityforreddit.apis.RedgifsAPI; +import ml.docilealligator.infinityforreddit.utils.APIUtils; +import ml.docilealligator.infinityforreddit.utils.JSONUtils; +import ml.docilealligator.infinityforreddit.utils.SharedPreferencesUtils; +import retrofit2.Call; +import retrofit2.Response; +import retrofit2.Retrofit; + +public class FetchRedgifsVideoLinks { + + public interface FetchRedgifsVideoLinksListener { + void success(String webm, String mp4); + void failed(int errorCode); + } + + public static void fetchRedgifsVideoLinks(Executor executor, Handler handler, Retrofit redgifsRetrofit, + SharedPreferences currentAccountSharedPreferences, + String redgifsId, + FetchRedgifsVideoLinksListener fetchRedgifsVideoLinksListener) { + executor.execute(() -> { + try { + Response response = redgifsRetrofit.create(RedgifsAPI.class).getRedgifsData(APIUtils.getRedgifsOAuthHeader(currentAccountSharedPreferences.getString(SharedPreferencesUtils.REDGIFS_ACCESS_TOKEN, "")), + redgifsId, APIUtils.USER_AGENT).execute(); + if (response.isSuccessful()) { + parseRedgifsVideoLinks(handler, response.body(), fetchRedgifsVideoLinksListener); + } else { + handler.post(() -> fetchRedgifsVideoLinksListener.failed(response.code())); + } + } catch (IOException e) { + e.printStackTrace(); + handler.post(() -> fetchRedgifsVideoLinksListener.failed(-1)); + } + }); + } + + public static void fetchRedgifsVideoLinksInRecyclerViewAdapter(Executor executor, Handler handler, + Call redgifsCall, + FetchRedgifsVideoLinksListener fetchRedgifsVideoLinksListener) { + executor.execute(() -> { + try { + Response response = redgifsCall.execute(); + if (response.isSuccessful()) { + parseRedgifsVideoLinks(handler, response.body(), fetchRedgifsVideoLinksListener); + } else { + handler.post(() -> fetchRedgifsVideoLinksListener.failed(response.code())); + } + } catch (IOException e) { + e.printStackTrace(); + handler.post(() -> fetchRedgifsVideoLinksListener.failed(-1)); + } + }); + } + + private static void parseRedgifsVideoLinks(Handler handler, String response, + FetchRedgifsVideoLinksListener fetchRedgifsVideoLinksListener) { + try { + String mp4 = new JSONObject(response).getJSONObject(JSONUtils.GIF_KEY).getJSONObject(JSONUtils.URLS_KEY) + .getString(JSONUtils.HD_KEY); + handler.post(() -> fetchRedgifsVideoLinksListener.success(mp4, mp4)); + } catch (JSONException e) { + e.printStackTrace(); + handler.post(() -> fetchRedgifsVideoLinksListener.failed(-1)); + } + } +} diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/NetworkModule.java b/app/src/main/java/ml/docilealligator/infinityforreddit/NetworkModule.java index 5aff6fc1..ffd4dcb6 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/NetworkModule.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/NetworkModule.java @@ -147,15 +147,6 @@ abstract class NetworkModule { .build(); } - @Provides - @Named("gfycat") - @Singleton - static Retrofit provideGfycatRetrofit(@Named("base") Retrofit retrofit) { - return retrofit.newBuilder() - .baseUrl(APIUtils.GFYCAT_API_BASE_URI) - .build(); - } - @Provides @Named("RedgifsAccessTokenAuthenticator") static Interceptor redgifsAccessTokenAuthenticator(@Named("current_account") SharedPreferences currentAccountSharedPreferences) { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LinkResolverActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LinkResolverActivity.java index 7b535685..e5346178 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LinkResolverActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LinkResolverActivity.java @@ -44,7 +44,6 @@ public class LinkResolverActivity extends AppCompatActivity { private static final String MULTIREDDIT_PATTERN = "/user/[\\w-]+/m/\\w+/?"; private static final String MULTIREDDIT_PATTERN_2 = "/[rR]/(\\w+\\+?)+/?"; private static final String REDD_IT_POST_PATTERN = "/\\w+/?"; - private static final String GFYCAT_PATTERN = "(/i?fr)?/[\\w-]+$"; private static final String REDGIFS_PATTERN = "/watch/[\\w-]+$"; private static final String IMGUR_GALLERY_PATTERN = "/gallery/\\w+/?"; private static final String IMGUR_ALBUM_PATTERN = "/(album|a)/\\w+/?"; @@ -258,20 +257,10 @@ public class LinkResolverActivity extends AppCompatActivity { if (path.startsWith("/CL0/")) { handleUri(Uri.parse(path.substring("/CL0/".length()))); } - } else if (authority.contains("gfycat.com")) { - if (path.matches(GFYCAT_PATTERN)) { - Intent intent = new Intent(this, ViewVideoActivity.class); - intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, path.substring(path.lastIndexOf("/") + 1)); - intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_GFYCAT); - intent.putExtra(ViewVideoActivity.EXTRA_IS_NSFW, getIntent().getBooleanExtra(EXTRA_IS_NSFW, false)); - startActivity(intent); - } else { - deepLinkError(uri); - } } else if (authority.contains("redgifs.com")) { if (path.matches(REDGIFS_PATTERN)) { Intent intent = new Intent(this, ViewVideoActivity.class); - intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, path.substring(path.lastIndexOf("/") + 1)); + intent.putExtra(ViewVideoActivity.EXTRA_REDGIFS_ID, path.substring(path.lastIndexOf("/") + 1)); intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_REDGIFS); intent.putExtra(ViewVideoActivity.EXTRA_IS_NSFW, true); startActivity(intent); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LoginActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LoginActivity.java index 11a11fa7..fb39c4e2 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LoginActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/LoginActivity.java @@ -203,6 +203,7 @@ public class LoginActivity extends BaseActivity { mCurrentAccountSharedPreferences.edit().putString(SharedPreferencesUtils.ACCESS_TOKEN, accessToken) .putString(SharedPreferencesUtils.ACCOUNT_NAME, name) .putString(SharedPreferencesUtils.ACCOUNT_IMAGE_URL, profileImageUrl).apply(); + mCurrentAccountSharedPreferences.edit().remove(SharedPreferencesUtils.SUBSCRIBED_THINGS_SYNC_TIME).apply(); ParseAndInsertNewAccount.parseAndInsertNewAccount(mExecutor, new Handler(), name, accessToken, refreshToken, profileImageUrl, bannerImageUrl, karma, authCode, mRedditDataRoomDatabase.accountDao(), () -> { diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java index 0748fb33..270694b4 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/MainActivity.java @@ -1003,6 +1003,10 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb } private void loadSubscriptions() { + if (System.currentTimeMillis() - mCurrentAccountSharedPreferences.getLong(SharedPreferencesUtils.SUBSCRIBED_THINGS_SYNC_TIME, 0L) < 24 * 60 * 60 * 1000) { + return; + } + if (!mAccountName.equals(Account.ANONYMOUS_ACCOUNT) && !mFetchSubscriptionsSuccess) { FetchSubscribedThing.fetchSubscribedThing(mOauthRetrofit, mAccessToken, mAccountName, null, new ArrayList<>(), new ArrayList<>(), @@ -1012,6 +1016,7 @@ public class MainActivity extends BaseActivity implements SortTypeSelectionCallb public void onFetchSubscribedThingSuccess(ArrayList subscribedSubredditData, ArrayList subscribedUserData, ArrayList subredditData) { + mCurrentAccountSharedPreferences.edit().putLong(SharedPreferencesUtils.SUBSCRIBED_THINGS_SYNC_TIME, System.currentTimeMillis()).apply(); InsertSubscribedThings.insertSubscribedThings( mExecutor, new Handler(), diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubscribedThingListingActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubscribedThingListingActivity.java index def20919..d3eca700 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubscribedThingListingActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/SubscribedThingListingActivity.java @@ -107,9 +107,6 @@ public class SubscribedThingListingActivity extends BaseActivity implements Acti @Named("current_account") SharedPreferences mCurrentAccountSharedPreferences; @Inject - @Named("internal") - SharedPreferences mInternalSharedPreferences; - @Inject CustomThemeWrapper mCustomThemeWrapper; @Inject Executor mExecutor; @@ -318,7 +315,7 @@ public class SubscribedThingListingActivity extends BaseActivity implements Acti } public void loadSubscriptions(boolean forceLoad) { - if (!forceLoad && System.currentTimeMillis() - mInternalSharedPreferences.getLong(SharedPreferencesUtils.SUBSCRIBED_THINGS_SYNC_TIME, 0L) < 24 * 60 * 60 * 1000) { + if (!forceLoad && System.currentTimeMillis() - mCurrentAccountSharedPreferences.getLong(SharedPreferencesUtils.SUBSCRIBED_THINGS_SYNC_TIME, 0L) < 24 * 60 * 60 * 1000) { return; } @@ -331,7 +328,7 @@ public class SubscribedThingListingActivity extends BaseActivity implements Acti public void onFetchSubscribedThingSuccess(ArrayList subscribedSubredditData, ArrayList subscribedUserData, ArrayList subredditData) { - mInternalSharedPreferences.edit().putLong(SharedPreferencesUtils.SUBSCRIBED_THINGS_SYNC_TIME, System.currentTimeMillis()).apply(); + mCurrentAccountSharedPreferences.edit().putLong(SharedPreferencesUtils.SUBSCRIBED_THINGS_SYNC_TIME, System.currentTimeMillis()).apply(); InsertSubscribedThings.insertSubscribedThings( mExecutor, new Handler(), diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewVideoActivity.java b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewVideoActivity.java index 69fd01e4..38ca2f2f 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewVideoActivity.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/activities/ViewVideoActivity.java @@ -68,7 +68,6 @@ import com.google.android.exoplayer2.util.MimeTypes; import com.google.android.exoplayer2.video.VideoSize; import com.google.android.material.bottomappbar.BottomAppBar; import com.google.android.material.button.MaterialButton; -import com.google.android.material.snackbar.Snackbar; import com.google.common.collect.ImmutableList; import com.otaliastudios.zoom.ZoomEngine; import com.otaliastudios.zoom.ZoomSurfaceView; @@ -88,7 +87,7 @@ import app.futured.hauler.LockableNestedScrollView; import butterknife.BindView; import butterknife.ButterKnife; import ml.docilealligator.infinityforreddit.CustomFontReceiver; -import ml.docilealligator.infinityforreddit.FetchGfycatOrRedgifsVideoLinks; +import ml.docilealligator.infinityforreddit.FetchRedgifsVideoLinks; import ml.docilealligator.infinityforreddit.FetchStreamableVideo; import ml.docilealligator.infinityforreddit.Infinity; import ml.docilealligator.infinityforreddit.R; @@ -131,7 +130,7 @@ public class ViewVideoActivity extends AppCompatActivity implements CustomFontRe public static final String EXTRA_POST = "EP"; public static final String EXTRA_PROGRESS_SECONDS = "EPS"; public static final String EXTRA_VIDEO_TYPE = "EVT"; - public static final String EXTRA_GFYCAT_ID = "EGI"; + public static final String EXTRA_REDGIFS_ID = "EGI"; public static final String EXTRA_V_REDD_IT_URL = "EVRIU"; public static final String EXTRA_STREAMABLE_SHORT_CODE = "ESSC"; public static final String EXTRA_IS_NSFW = "EIN"; @@ -140,7 +139,6 @@ public class ViewVideoActivity extends AppCompatActivity implements CustomFontRe public static final int VIDEO_TYPE_V_REDD_IT = 4; public static final int VIDEO_TYPE_DIRECT = 3; public static final int VIDEO_TYPE_REDGIFS = 2; - public static final int VIDEO_TYPE_GFYCAT = 1; private static final int VIDEO_TYPE_NORMAL = 0; private static final int PERMISSION_REQUEST_WRITE_EXTERNAL_STORAGE = 0; @@ -202,10 +200,6 @@ public class ViewVideoActivity extends AppCompatActivity implements CustomFontRe @Named("application_only_oauth") Retrofit applicationOnlyOauthRetrofit; - @Inject - @Named("gfycat") - Retrofit gfycatRetrofit; - @Inject @Named("redgifs") Retrofit redgifsRetrofit; @@ -546,29 +540,21 @@ public class ViewVideoActivity extends AppCompatActivity implements CustomFontRe } } else if (videoType == VIDEO_TYPE_V_REDD_IT) { loadVReddItVideo(savedInstanceState); - } else if (videoType == VIDEO_TYPE_GFYCAT || videoType == VIDEO_TYPE_REDGIFS) { + } else if (videoType == VIDEO_TYPE_REDGIFS) { if (savedInstanceState != null) { videoDownloadUrl = savedInstanceState.getString(VIDEO_DOWNLOAD_URL_STATE); } else { videoDownloadUrl = intent.getStringExtra(EXTRA_VIDEO_DOWNLOAD_URL); } - String gfycatId = intent.getStringExtra(EXTRA_GFYCAT_ID); - if (gfycatId != null && gfycatId.contains("-")) { - gfycatId = gfycatId.substring(0, gfycatId.indexOf('-')); - } - if (videoType == VIDEO_TYPE_GFYCAT) { - videoFileName = "Gfycat-" + gfycatId + ".mp4"; - } else { - videoFileName = "Redgifs-" + gfycatId + ".mp4"; + String redgifsId = intent.getStringExtra(EXTRA_REDGIFS_ID); + if (redgifsId != null && redgifsId.contains("-")) { + redgifsId = redgifsId.substring(0, redgifsId.indexOf('-')); } + videoFileName = "Redgifs-" + redgifsId + ".mp4"; if (mVideoUri == null) { - if (videoType == VIDEO_TYPE_GFYCAT) { - loadGfycatOrRedgifsVideo(gfycatRetrofit, gfycatId, true, savedInstanceState, true); - } else { - loadGfycatOrRedgifsVideo(redgifsRetrofit, gfycatId, false, savedInstanceState, false); - } + loadRedgifsVideo(redgifsId, savedInstanceState); } else { dataSourceFactory = new CacheDataSource.Factory().setCache(mSimpleCache) .setUpstreamDataSourceFactory(new DefaultHttpDataSource.Factory().setAllowCrossProtocolRedirects(true).setUserAgent(APIUtils.USER_AGENT)); @@ -723,61 +709,28 @@ public class ViewVideoActivity extends AppCompatActivity implements CustomFontRe return C.TRACK_TYPE_UNKNOWN; } - private void loadGfycatOrRedgifsVideo(Retrofit retrofit, String gfycatId, boolean isGfycatVideo, - Bundle savedInstanceState, boolean needErrorHandling) { + private void loadRedgifsVideo(String redgifsId, Bundle savedInstanceState) { progressBar.setVisibility(View.VISIBLE); - if (isGfycatVideo) { - FetchGfycatOrRedgifsVideoLinks.fetchGfycatVideoLinks(mExecutor, new Handler(), retrofit, gfycatId, - new FetchGfycatOrRedgifsVideoLinks.FetchGfycatOrRedgifsVideoLinksListener() { - @Override - public void success(String webm, String mp4) { - progressBar.setVisibility(View.GONE); - mVideoUri = Uri.parse(webm); - videoDownloadUrl = mp4; - dataSourceFactory = new CacheDataSource.Factory().setCache(mSimpleCache) - .setUpstreamDataSourceFactory(new DefaultHttpDataSource.Factory().setAllowCrossProtocolRedirects(true).setUserAgent(APIUtils.USER_AGENT)); - preparePlayer(savedInstanceState); - player.prepare(); - player.setMediaSource(new ProgressiveMediaSource.Factory(dataSourceFactory).createMediaSource(MediaItem.fromUri(mVideoUri))); - } - - @Override - public void failed(int errorCode) { - if (errorCode == 404 && needErrorHandling) { - if (mSharedPreferences.getBoolean(SharedPreferencesUtils.AUTOMATICALLY_TRY_REDGIFS, true)) { - loadGfycatOrRedgifsVideo(redgifsRetrofit, gfycatId, false, savedInstanceState, false); - } else { - Snackbar.make(coordinatorLayout, R.string.load_video_in_redgifs, Snackbar.LENGTH_INDEFINITE).setAction(R.string.yes, - view -> loadGfycatOrRedgifsVideo(redgifsRetrofit, gfycatId, false, savedInstanceState, false)).show(); - } - } else { - progressBar.setVisibility(View.GONE); - Toast.makeText(ViewVideoActivity.this, R.string.fetch_gfycat_video_failed, Toast.LENGTH_SHORT).show(); - } - } - }); - } else { - FetchGfycatOrRedgifsVideoLinks.fetchRedgifsVideoLinks(this, mExecutor, new Handler(), redgifsRetrofit, - mCurrentAccountSharedPreferences, gfycatId, new FetchGfycatOrRedgifsVideoLinks.FetchGfycatOrRedgifsVideoLinksListener() { - @Override - public void success(String webm, String mp4) { - progressBar.setVisibility(View.GONE); - mVideoUri = Uri.parse(webm); - videoDownloadUrl = mp4; - dataSourceFactory = new CacheDataSource.Factory().setCache(mSimpleCache) - .setUpstreamDataSourceFactory(new DefaultHttpDataSource.Factory().setAllowCrossProtocolRedirects(true).setUserAgent(APIUtils.USER_AGENT)); - preparePlayer(savedInstanceState); - player.prepare(); - player.setMediaSource(new ProgressiveMediaSource.Factory(dataSourceFactory).createMediaSource(MediaItem.fromUri(mVideoUri))); - } + FetchRedgifsVideoLinks.fetchRedgifsVideoLinks(mExecutor, new Handler(), redgifsRetrofit, + mCurrentAccountSharedPreferences, redgifsId, new FetchRedgifsVideoLinks.FetchRedgifsVideoLinksListener() { + @Override + public void success(String webm, String mp4) { + progressBar.setVisibility(View.GONE); + mVideoUri = Uri.parse(webm); + videoDownloadUrl = mp4; + dataSourceFactory = new CacheDataSource.Factory().setCache(mSimpleCache) + .setUpstreamDataSourceFactory(new DefaultHttpDataSource.Factory().setAllowCrossProtocolRedirects(true).setUserAgent(APIUtils.USER_AGENT)); + preparePlayer(savedInstanceState); + player.prepare(); + player.setMediaSource(new ProgressiveMediaSource.Factory(dataSourceFactory).createMediaSource(MediaItem.fromUri(mVideoUri))); + } - @Override - public void failed(int errorCode) { - progressBar.setVisibility(View.GONE); - Toast.makeText(ViewVideoActivity.this, R.string.fetch_redgifs_video_failed, Toast.LENGTH_SHORT).show(); - } - }); - } + @Override + public void failed(int errorCode) { + progressBar.setVisibility(View.GONE); + Toast.makeText(ViewVideoActivity.this, R.string.fetch_redgifs_video_failed, Toast.LENGTH_SHORT).show(); + } + }); } private void loadVReddItVideo(Bundle savedInstanceState) { @@ -795,30 +748,14 @@ public class ViewVideoActivity extends AppCompatActivity implements CustomFontRe new FetchPost.FetchPostListener() { @Override public void fetchPostSuccess(Post post) { - if (post.isGfycat()) { - videoType = VIDEO_TYPE_GFYCAT; - String gfycatId = post.getGfycatId(); - if (gfycatId != null && gfycatId.contains("-")) { - gfycatId = gfycatId.substring(0, gfycatId.indexOf('-')); - } - if (videoType == VIDEO_TYPE_GFYCAT) { - videoFileName = "Gfycat-" + gfycatId + ".mp4"; - } else { - videoFileName = "Redgifs-" + gfycatId + ".mp4"; - } - loadGfycatOrRedgifsVideo(gfycatRetrofit, gfycatId, true, savedInstanceState, true); - } else if (post.isRedgifs()) { + if (post.isRedgifs()) { videoType = VIDEO_TYPE_REDGIFS; - String gfycatId = post.getGfycatId(); - if (gfycatId != null && gfycatId.contains("-")) { - gfycatId = gfycatId.substring(0, gfycatId.indexOf('-')); - } - if (videoType == VIDEO_TYPE_GFYCAT) { - videoFileName = "Gfycat-" + gfycatId + ".mp4"; - } else { - videoFileName = "Redgifs-" + gfycatId + ".mp4"; + String redgifsId = post.getRedgifsId(); + if (redgifsId != null && redgifsId.contains("-")) { + redgifsId = redgifsId.substring(0, redgifsId.indexOf('-')); } - loadGfycatOrRedgifsVideo(redgifsRetrofit, gfycatId, false, savedInstanceState, false); + videoFileName = "Redgifs-" + redgifsId + ".mp4"; + loadRedgifsVideo(redgifsId, savedInstanceState); } else if (post.isStreamable()) { videoType = VIDEO_TYPE_STREAMABLE; String shortCode = post.getStreamableShortCode(); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/HistoryPostRecyclerViewAdapter.java b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/HistoryPostRecyclerViewAdapter.java index b5b9d1e5..da1078b2 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/HistoryPostRecyclerViewAdapter.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/adapters/HistoryPostRecyclerViewAdapter.java @@ -65,7 +65,7 @@ import butterknife.BindView; import butterknife.ButterKnife; import jp.wasabeef.glide.transformations.BlurTransformation; import jp.wasabeef.glide.transformations.RoundedCornersTransformation; -import ml.docilealligator.infinityforreddit.FetchGfycatOrRedgifsVideoLinks; +import ml.docilealligator.infinityforreddit.FetchRedgifsVideoLinks; import ml.docilealligator.infinityforreddit.FetchStreamableVideo; import ml.docilealligator.infinityforreddit.R; import ml.docilealligator.infinityforreddit.SaveMemoryCenterInisdeDownsampleStrategy; @@ -82,7 +82,6 @@ import ml.docilealligator.infinityforreddit.activities.ViewRedditGalleryActivity import ml.docilealligator.infinityforreddit.activities.ViewSubredditDetailActivity; import ml.docilealligator.infinityforreddit.activities.ViewUserDetailActivity; import ml.docilealligator.infinityforreddit.activities.ViewVideoActivity; -import ml.docilealligator.infinityforreddit.apis.GfycatAPI; import ml.docilealligator.infinityforreddit.apis.RedgifsAPI; import ml.docilealligator.infinityforreddit.apis.StreamableAPI; import ml.docilealligator.infinityforreddit.bottomsheetfragments.ShareLinkBottomSheetFragment; @@ -161,7 +160,6 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter mStreamableApiProvider; private String mAccessToken; @@ -220,7 +218,6 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter streambleApiProvider, + Retrofit redgifsRetrofit, Provider streambleApiProvider, CustomThemeWrapper customThemeWrapper, Locale locale, @Nullable String accessToken, @NonNull String accountName, int postType, int postLayout, boolean displaySubredditName, SharedPreferences sharedPreferences, SharedPreferences currentAccountSharedPreferences, @@ -256,7 +253,6 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter fetchGfycatOrStreamableVideoCall; + public Call fetchRedgifsOrStreamableVideoCall; private boolean isManuallyPaused; PostBaseVideoAutoplayViewHolder(View rootView, @@ -3152,7 +3144,7 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter fetchGfycatOrStreamableVideoCall; + public Call fetchRedgifsOrStreamableVideoCall; private boolean isManuallyPaused; PostCard2BaseVideoAutoplayViewHolder(View itemView, @@ -4789,7 +4774,7 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter fetchGfycatOrStreamableVideoCall; + public Call fetchRedgifsOrStreamableVideoCall; private boolean isManuallyPaused; PostMaterial3CardBaseVideoAutoplayViewHolder(View rootView, @@ -5779,7 +5757,7 @@ public class HistoryPostRecyclerViewAdapter extends PagingDataAdapter mStreamableApiProvider; private final RedditDataRoomDatabase mRedditDataRoomDatabase; @@ -170,7 +168,6 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter streamableApiProvider, RedditDataRoomDatabase redditDataRoomDatabase, RequestManager glide, boolean separatePostAndComments, @Nullable String accessToken, @@ -240,7 +237,6 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter fetchGfycatOrStreamableVideoCall; + public Call fetchRedgifsOrStreamableVideoCall; AspectRatioFrameLayout aspectRatioFrameLayout; PlayerView playerView; GifImageView previewImageView; - ImageView mErrorLoadingGfycatImageView; + ImageView mErrorLoadingRedgifsImageView; ImageView muteButton; ImageView fullscreenButton; ImageView pauseButton; @@ -1639,7 +1635,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter mStreamableApiProvider; private String mAccessToken; @@ -230,7 +228,6 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter streamableApiProvider, + Retrofit redgifsRetrofit, Provider streamableApiProvider, CustomThemeWrapper customThemeWrapper, Locale locale, @Nullable String accessToken, @NonNull String accountName, int postType, int postLayout, boolean displaySubredditName, SharedPreferences sharedPreferences, SharedPreferences currentAccountSharedPreferences, @@ -270,7 +267,6 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter fetchGfycatOrStreamableVideoCall; + public Call fetchRedgifsOrStreamableVideoCall; private boolean isManuallyPaused; PostBaseVideoAutoplayViewHolder(View rootView, @@ -3311,7 +3306,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter fetchGfycatOrStreamableVideoCall; + public Call fetchRedgifsOrStreamableVideoCall; private boolean isManuallyPaused; PostCard2BaseVideoAutoplayViewHolder(View itemView, @@ -5016,7 +5004,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter fetchGfycatOrStreamableVideoCall; + public Call fetchRedgifsOrStreamableVideoCall; private boolean isManuallyPaused; PostMaterial3CardBaseVideoAutoplayViewHolder(View rootView, @@ -6039,7 +6020,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter getGfycatData(@Path("gfyid") String gfyId); -} diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/apis/RedditAPI.java b/app/src/main/java/ml/docilealligator/infinityforreddit/apis/RedditAPI.java index 44ba63b6..32948ff7 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/apis/RedditAPI.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/apis/RedditAPI.java @@ -237,10 +237,6 @@ public interface RedditAPI { @GET("/api/trending_searches_v1.json?withAds=0&raw_json=1&gilding_detail=1") Call getTrendingSearchesOauth(@HeaderMap Map headers); - default Call getWiki(@Path("subredditName") String subredditName) { - return getWikiPage(subredditName, "index"); - } - @GET("/r/{subredditName}/wiki/{wikiPage}.json?raw_json=1") Call getWikiPage(@Path("subredditName") String subredditName, @Path("wikiPage") String wikiPage); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/asynctasks/SwitchAccount.java b/app/src/main/java/ml/docilealligator/infinityforreddit/asynctasks/SwitchAccount.java index f5443973..bb49824b 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/asynctasks/SwitchAccount.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/asynctasks/SwitchAccount.java @@ -22,6 +22,7 @@ public class SwitchAccount { .putString(SharedPreferencesUtils.ACCESS_TOKEN, account.getAccessToken()) .putString(SharedPreferencesUtils.ACCOUNT_NAME, account.getAccountName()) .putString(SharedPreferencesUtils.ACCOUNT_IMAGE_URL, account.getProfileImageUrl()).apply(); + currentAccountSharedPreferences.edit().remove(SharedPreferencesUtils.SUBSCRIBED_THINGS_SYNC_TIME).apply(); handler.post(() -> switchAccountListener.switched(account)); }); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/HistoryPostFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/HistoryPostFragment.java index 752fe396..988c9b8f 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/HistoryPostFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/HistoryPostFragment.java @@ -163,9 +163,6 @@ public class HistoryPostFragment extends Fragment implements FragmentCommunicato @Named("application_only_oauth") Retrofit mApplicationOnlyRetrofit; @Inject - @Named("gfycat") - Retrofit mGfycatRetrofit; - @Inject @Named("redgifs") Retrofit mRedgifsRetrofit; @Inject @@ -378,7 +375,7 @@ public class HistoryPostFragment extends Fragment implements FragmentCommunicato if (historyType == HISTORY_TYPE_READ_POSTS) { postLayout = mPostLayoutSharedPreferences.getInt(SharedPreferencesUtils.HISTORY_POST_LAYOUT_READ_POST, defaultPostLayout); - mAdapter = new HistoryPostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mGfycatRetrofit, + mAdapter = new HistoryPostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mRedgifsRetrofit, mStreamableApiProvider, mCustomThemeWrapper, locale, accessToken, accountName, postType, postLayout, true, mSharedPreferences, mCurrentAccountSharedPreferences, mNsfwAndSpoilerSharedPreferences, diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/PostFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/PostFragment.java index e49ff234..e1949175 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/PostFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/PostFragment.java @@ -185,9 +185,6 @@ public class PostFragment extends Fragment implements FragmentCommunicator { @Named("application_only_oauth") Retrofit mApplicationOnlyRetrofit; @Inject - @Named("gfycat") - Retrofit mGfycatRetrofit; - @Inject @Named("redgifs") Retrofit mRedgifsRetrofit; @Inject @@ -462,7 +459,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator { sortType = new SortType(SortType.Type.valueOf(sort), SortType.Time.valueOf(sortTime)); postLayout = mPostLayoutSharedPreferences.getInt(SharedPreferencesUtils.POST_LAYOUT_SEARCH_POST, defaultPostLayout); - mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mGfycatRetrofit, + mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mRedgifsRetrofit, mStreamableApiProvider, mCustomThemeWrapper, locale, accessToken, accountName, postType, postLayout, true, mSharedPreferences, mCurrentAccountSharedPreferences, mNsfwAndSpoilerSharedPreferences, mPostHistorySharedPreferences, @@ -539,7 +536,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator { sortType = new SortType(SortType.Type.valueOf(sort)); } - mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mGfycatRetrofit, + mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mRedgifsRetrofit, mStreamableApiProvider, mCustomThemeWrapper, locale, accessToken, accountName, postType, postLayout, displaySubredditName, mSharedPreferences, mCurrentAccountSharedPreferences, mNsfwAndSpoilerSharedPreferences, mPostHistorySharedPreferences, @@ -610,7 +607,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator { sortType = new SortType(SortType.Type.valueOf(sort)); } - mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mGfycatRetrofit, + mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mRedgifsRetrofit, mStreamableApiProvider, mCustomThemeWrapper, locale, accessToken, accountName, postType, postLayout, true, mSharedPreferences, mCurrentAccountSharedPreferences, mNsfwAndSpoilerSharedPreferences, mPostHistorySharedPreferences, @@ -675,7 +672,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator { } postLayout = mPostLayoutSharedPreferences.getInt(SharedPreferencesUtils.POST_LAYOUT_USER_POST_BASE + username, defaultPostLayout); - mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mGfycatRetrofit, + mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mRedgifsRetrofit, mStreamableApiProvider, mCustomThemeWrapper, locale, accessToken, accountName, postType, postLayout, true, mSharedPreferences, mCurrentAccountSharedPreferences, mNsfwAndSpoilerSharedPreferences, mPostHistorySharedPreferences, @@ -736,7 +733,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator { postLayout = mPostLayoutSharedPreferences.getInt(SharedPreferencesUtils.POST_LAYOUT_FRONT_PAGE_POST, defaultPostLayout); - mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mGfycatRetrofit, + mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mRedgifsRetrofit, mStreamableApiProvider, mCustomThemeWrapper, locale, accessToken, accountName, postType, postLayout, true, mSharedPreferences, mCurrentAccountSharedPreferences, mNsfwAndSpoilerSharedPreferences, mPostHistorySharedPreferences, @@ -796,7 +793,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator { postLayout = mPostLayoutSharedPreferences.getInt(SharedPreferencesUtils.POST_LAYOUT_MULTI_REDDIT_POST_BASE + multiRedditPath, defaultPostLayout); - mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mGfycatRetrofit, + mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mRedgifsRetrofit, mStreamableApiProvider, mCustomThemeWrapper, locale, accessToken, accountName, postType, postLayout, true, mSharedPreferences, mCurrentAccountSharedPreferences, mNsfwAndSpoilerSharedPreferences, mPostHistorySharedPreferences, @@ -853,7 +850,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator { } postLayout = mPostLayoutSharedPreferences.getInt(SharedPreferencesUtils.POST_LAYOUT_FRONT_PAGE_POST, defaultPostLayout); - mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mGfycatRetrofit, + mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mOauthRetrofit, mRedgifsRetrofit, mStreamableApiProvider, mCustomThemeWrapper, locale, accessToken, accountName, postType, postLayout, true, mSharedPreferences, mCurrentAccountSharedPreferences, mNsfwAndSpoilerSharedPreferences, mPostHistorySharedPreferences, diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java index eb68bbc1..249364f0 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/fragments/ViewPostDetailFragment.java @@ -160,9 +160,6 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic @Named("application_only_oauth") Retrofit mApplicationOnlyRetrofit; @Inject - @Named("gfycat") - Retrofit mGfycatRetrofit; - @Inject @Named("redgifs") Retrofit mRedgifsRetrofit; @Inject @@ -601,7 +598,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic mPostAdapter = new PostDetailRecyclerViewAdapter(activity, this, mExecutor, mCustomThemeWrapper, mOauthRetrofit, mApplicationOnlyRetrofit, - mGfycatRetrofit, mRedgifsRetrofit, mStreamableApiProvider, mRedditDataRoomDatabase, mGlide, + mRedgifsRetrofit, mStreamableApiProvider, mRedditDataRoomDatabase, mGlide, mSeparatePostAndComments, mAccessToken, mAccountName, mPost, mLocale, mSharedPreferences, mCurrentAccountSharedPreferences, mNsfwAndSpoilerSharedPreferences, mPostDetailsSharedPreferences, mExoCreator, post -> EventBus.getDefault().post(new PostUpdateEventToPostList(mPost, postListPosition))); @@ -1293,7 +1290,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic mPostAdapter = new PostDetailRecyclerViewAdapter(activity, ViewPostDetailFragment.this, mExecutor, mCustomThemeWrapper, - mOauthRetrofit, mApplicationOnlyRetrofit, mGfycatRetrofit, mRedgifsRetrofit, + mOauthRetrofit, mApplicationOnlyRetrofit, mRedgifsRetrofit, mStreamableApiProvider, mRedditDataRoomDatabase, mGlide, mSeparatePostAndComments, mAccessToken, mAccountName, mPost, mLocale, mSharedPreferences, mCurrentAccountSharedPreferences, mNsfwAndSpoilerSharedPreferences, diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/post/FetchRemovedPost.java b/app/src/main/java/ml/docilealligator/infinityforreddit/post/FetchRemovedPost.java index 719e412d..5d815e83 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/post/FetchRemovedPost.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/post/FetchRemovedPost.java @@ -77,7 +77,7 @@ public class FetchRemovedPost { try { Uri uri = Uri.parse(url); String authority = uri.getAuthority(); - if (authority != null && (authority.contains("gfycat.com") || authority.contains("redgifs.com"))) { + if (authority != null && authority.contains("redgifs.com")) { post.setPostType(Post.LINK_TYPE); post.setUrl(url); } diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/post/ParsePost.java b/app/src/main/java/ml/docilealligator/infinityforreddit/post/ParsePost.java index f7a4a03e..9389c87e 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/post/ParsePost.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/post/ParsePost.java @@ -312,18 +312,12 @@ public class ParsePost { String authority = uri.getAuthority(); if (authority != null) { - if (authority.contains("gfycat.com")) { - String gfycatId = url.substring(url.lastIndexOf("/") + 1).toLowerCase(); - post.setPostType(Post.VIDEO_TYPE); - post.setIsGfycat(true); - post.setVideoUrl(url); - post.setGfycatId(gfycatId); - } else if (authority.contains("redgifs.com")) { - String gfycatId = url.substring(url.lastIndexOf("/") + 1).toLowerCase(); + if (authority.contains("redgifs.com")) { + String redgifsId = url.substring(url.lastIndexOf("/") + 1).toLowerCase(); post.setPostType(Post.VIDEO_TYPE); post.setIsRedgifs(true); post.setVideoUrl(url); - post.setGfycatId(gfycatId); + post.setRedgifsId(redgifsId); } else if (authority.equals("streamable.com")) { String shortCode = url.substring(url.lastIndexOf("/") + 1); post.setPostType(Post.VIDEO_TYPE); @@ -500,18 +494,12 @@ public class ParsePost { String authority = uri.getAuthority(); if (authority != null) { - if (authority.contains("gfycat.com")) { - String gfycatId = url.substring(url.lastIndexOf("/") + 1).toLowerCase(); - post.setPostType(Post.VIDEO_TYPE); - post.setIsGfycat(true); - post.setVideoUrl(url); - post.setGfycatId(gfycatId); - } else if (authority.contains("redgifs.com")) { - String gfycatId = url.substring(url.lastIndexOf("/") + 1).toLowerCase(); + if (authority.contains("redgifs.com")) { + String redgifsId = url.substring(url.lastIndexOf("/") + 1).toLowerCase(); post.setPostType(Post.VIDEO_TYPE); post.setIsRedgifs(true); post.setVideoUrl(url); - post.setGfycatId(gfycatId); + post.setRedgifsId(redgifsId); } else if (authority.equals("streamable.com")) { String shortCode = url.substring(url.lastIndexOf("/") + 1); post.setPostType(Post.VIDEO_TYPE); @@ -573,18 +561,12 @@ public class ParsePost { String authority = uri.getAuthority(); if (authority != null) { - if (authority.contains("gfycat.com")) { - String gfycatId = url.substring(url.lastIndexOf("/") + 1).toLowerCase(); - post.setPostType(Post.VIDEO_TYPE); - post.setIsGfycat(true); - post.setVideoUrl(url); - post.setGfycatId(gfycatId); - } else if (authority.contains("redgifs.com")) { - String gfycatId = url.substring(url.lastIndexOf("/") + 1).toLowerCase(); + if (authority.contains("redgifs.com")) { + String redgifsId = url.substring(url.lastIndexOf("/") + 1).toLowerCase(); post.setPostType(Post.VIDEO_TYPE); post.setIsRedgifs(true); post.setVideoUrl(url); - post.setGfycatId(gfycatId); + post.setRedgifsId(redgifsId); } else if (authority.equals("streamable.com")) { String shortCode = url.substring(url.lastIndexOf("/") + 1); post.setPostType(Post.VIDEO_TYPE); @@ -601,22 +583,14 @@ public class ParsePost { try { String authority = uri.getAuthority(); if (authority != null) { - if (authority.contains("gfycat.com")) { - post.setIsGfycat(true); - post.setVideoUrl(url); - String gfycatId = url.substring(url.lastIndexOf("/") + 1); - if (gfycatId.contains("-")) { - gfycatId = gfycatId.substring(0, gfycatId.indexOf('-')); - } - post.setGfycatId(gfycatId.toLowerCase()); - } else if (authority.contains("redgifs.com")) { - String gfycatId = url.substring(url.lastIndexOf("/") + 1); - if (gfycatId.contains("-")) { - gfycatId = gfycatId.substring(0, gfycatId.indexOf('-')); + if (authority.contains("redgifs.com")) { + String redgifsId = url.substring(url.lastIndexOf("/") + 1); + if (redgifsId.contains("-")) { + redgifsId = redgifsId.substring(0, redgifsId.indexOf('-')); } post.setIsRedgifs(true); post.setVideoUrl(url); - post.setGfycatId(gfycatId.toLowerCase()); + post.setRedgifsId(redgifsId.toLowerCase()); } else if (authority.equals("streamable.com")) { String shortCode = url.substring(url.lastIndexOf("/") + 1); post.setPostType(Post.VIDEO_TYPE); @@ -684,18 +658,12 @@ public class ParsePost { String authority = uri.getAuthority(); if (authority != null) { - if (authority.contains("gfycat.com")) { - String gfycatId = url.substring(url.lastIndexOf("/") + 1).toLowerCase(); - post.setPostType(Post.VIDEO_TYPE); - post.setIsGfycat(true); - post.setVideoUrl(url); - post.setGfycatId(gfycatId); - } else if (authority.contains("redgifs.com")) { - String gfycatId = url.substring(url.lastIndexOf("/") + 1).toLowerCase(); + if (authority.contains("redgifs.com")) { + String redgifsId = url.substring(url.lastIndexOf("/") + 1).toLowerCase(); post.setPostType(Post.VIDEO_TYPE); post.setIsRedgifs(true); post.setVideoUrl(url); - post.setGfycatId(gfycatId); + post.setRedgifsId(redgifsId); } else if (authority.equals("streamable.com")) { String shortCode = url.substring(url.lastIndexOf("/") + 1); post.setPostType(Post.VIDEO_TYPE); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/post/Post.java b/app/src/main/java/ml/docilealligator/infinityforreddit/post/Post.java index 5985de46..f03a666c 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/post/Post.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/post/Post.java @@ -43,13 +43,12 @@ public class Post implements Parcelable { private String url; private String videoUrl; private String videoDownloadUrl; - private String gfycatId; + private String redgifsId; private String streamableShortCode; private boolean isImgur; - private boolean isGfycat; private boolean isRedgifs; private boolean isStreamable; - private boolean loadGfyOrStreamableVideoSuccess; + private boolean loadRedgifsOrStreamableVideoSuccess; private final String permalink; private String flair; private final long postTimeMillis; @@ -167,13 +166,12 @@ public class Post implements Parcelable { url = in.readString(); videoUrl = in.readString(); videoDownloadUrl = in.readString(); - gfycatId = in.readString(); + redgifsId = in.readString(); streamableShortCode = in.readString(); isImgur = in.readByte() != 0; - isGfycat = in.readByte() != 0; isRedgifs = in.readByte() != 0; isStreamable = in.readByte() != 0; - loadGfyOrStreamableVideoSuccess = in.readByte() != 0; + loadRedgifsOrStreamableVideoSuccess = in.readByte() != 0; permalink = in.readString(); flair = in.readString(); postTimeMillis = in.readLong(); @@ -328,12 +326,12 @@ public class Post implements Parcelable { this.videoDownloadUrl = videoDownloadUrl; } - public String getGfycatId() { - return gfycatId; + public String getRedgifsId() { + return redgifsId; } - public void setGfycatId(String gfycatId) { - this.gfycatId = gfycatId; + public void setRedgifsId(String redgifsId) { + this.redgifsId = redgifsId; } public String getStreamableShortCode() { @@ -352,14 +350,6 @@ public class Post implements Parcelable { return isImgur; } - public boolean isGfycat() { - return isGfycat; - } - - public void setIsGfycat(boolean isGfycat) { - this.isGfycat = isGfycat; - } - public boolean isRedgifs() { return isRedgifs; } @@ -376,12 +366,12 @@ public class Post implements Parcelable { this.isStreamable = isStreamable; } - public boolean isLoadGfycatOrStreamableVideoSuccess() { - return loadGfyOrStreamableVideoSuccess; + public boolean isLoadRedgifsOrStreamableVideoSuccess() { + return loadRedgifsOrStreamableVideoSuccess; } - public void setLoadGfyOrStreamableVideoSuccess(boolean loadGfyOrStreamableVideoSuccess) { - this.loadGfyOrStreamableVideoSuccess = loadGfyOrStreamableVideoSuccess; + public void setLoadRedgifsOrStreamableVideoSuccess(boolean loadRedgifsOrStreamableVideoSuccess) { + this.loadRedgifsOrStreamableVideoSuccess = loadRedgifsOrStreamableVideoSuccess; } public String getPermalink() { @@ -496,13 +486,12 @@ public class Post implements Parcelable { dest.writeString(url); dest.writeString(videoUrl); dest.writeString(videoDownloadUrl); - dest.writeString(gfycatId); + dest.writeString(redgifsId); dest.writeString(streamableShortCode); dest.writeByte((byte) (isImgur ? 1 : 0)); - dest.writeByte((byte) (isGfycat ? 1 : 0)); dest.writeByte((byte) (isRedgifs ? 1 : 0)); dest.writeByte((byte) (isStreamable ? 1 : 0)); - dest.writeByte((byte) (loadGfyOrStreamableVideoSuccess ? 1 : 0)); + dest.writeByte((byte) (loadRedgifsOrStreamableVideoSuccess ? 1 : 0)); dest.writeString(permalink); dest.writeString(flair); dest.writeLong(postTimeMillis); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/AdvancedPreferenceFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/AdvancedPreferenceFragment.java index 9f9534fb..25a3bd82 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/AdvancedPreferenceFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/AdvancedPreferenceFragment.java @@ -227,6 +227,10 @@ public class AdvancedPreferenceFragment extends CustomFontPreferenceFragmentComp editor.remove(SharedPreferencesUtils.BLUR_SPOILER_KEY_LEGACY); editor.remove(SharedPreferencesUtils.CONFIRM_TO_EXIT_LEGACY); editor.remove(SharedPreferencesUtils.OPEN_LINK_IN_APP_LEGACY); + editor.remove(SharedPreferencesUtils.AUTOMATICALLY_TRY_REDGIFS_LEGACY); + editor.remove(SharedPreferencesUtils.DO_NOT_SHOW_REDDIT_API_INFO_AGAIN_LEGACY); + editor.remove(SharedPreferencesUtils.HIDE_THE_NUMBER_OF_AWARDS_LEGACY); + editor.remove(SharedPreferencesUtils.HIDE_COMMENT_AWARDS_LEGACY); SharedPreferences.Editor sortTypeEditor = mSortTypeSharedPreferences.edit(); sortTypeEditor.remove(SharedPreferencesUtils.SORT_TYPE_ALL_POST_LEGACY); diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/APIUtils.java b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/APIUtils.java index 10104f5a..5953285f 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/APIUtils.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/APIUtils.java @@ -18,7 +18,6 @@ public class APIUtils { public static final String API_BASE_URI = "https://www.reddit.com"; public static final String API_UPLOAD_MEDIA_URI = "https://reddit-uploaded-media.s3-accelerate.amazonaws.com"; public static final String API_UPLOAD_VIDEO_URI = "https://reddit-uploaded-video.s3-accelerate.amazonaws.com"; - public static final String GFYCAT_API_BASE_URI = "https://api.gfycat.com/v1/gfycats/"; public static final String REDGIFS_API_BASE_URI = "https://api.redgifs.com"; public static final String IMGUR_API_BASE_URI = "https://api.imgur.com/3/"; public static final String PUSHSHIFT_API_BASE_URI = "https://api.pushshift.io/"; diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java index 863a49a6..15564ce7 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/utils/SharedPreferencesUtils.java @@ -106,7 +106,6 @@ public class SharedPreferencesUtils { public static final String VIDEO_AUTOPLAY_VALUE_NEVER = "0"; public static final String MUTE_AUTOPLAYING_VIDEOS = "mute_autoplaying_videos"; public static final String AUTOPLAY_NSFW_VIDEOS = "autoplay_nsfw_videos"; - public static final String AUTOMATICALLY_TRY_REDGIFS = "automatically_try_redgifs"; public static final String LOCK_JUMP_TO_NEXT_TOP_LEVEL_COMMENT_BUTTON = "lock_jump_to_next_top_level_comment_button"; public static final String SWAP_TAP_AND_LONG_COMMENTS = "swap_tap_and_long_in_comments"; public static final String SWIPE_UP_TO_HIDE_JUMP_TO_NEXT_TOP_LEVEL_COMMENT_BUTTON = "swipe_up_to_hide_jump_to_next_top_level_comments_button"; @@ -392,6 +391,7 @@ public class SharedPreferencesUtils { public static final String BLUR_SPOILER_KEY_LEGACY = "blur_spoiler"; public static final String CONFIRM_TO_EXIT_LEGACY = "confirm_to_exit"; public static final String OPEN_LINK_IN_APP_LEGACY = "open_link_in_app"; + public static final String AUTOMATICALLY_TRY_REDGIFS_LEGACY = "automatically_try_redgifs"; public static final String DO_NOT_SHOW_REDDIT_API_INFO_AGAIN_LEGACY = "do_not_show_reddit_api_info_again"; public static final String HIDE_THE_NUMBER_OF_AWARDS_LEGACY = "hide_the_number_of_awards"; diff --git a/app/src/main/res/layout/item_post_card_2_video_autoplay.xml b/app/src/main/res/layout/item_post_card_2_video_autoplay.xml index 618d2bff..11a829a4 100644 --- a/app/src/main/res/layout/item_post_card_2_video_autoplay.xml +++ b/app/src/main/res/layout/item_post_card_2_video_autoplay.xml @@ -42,7 +42,7 @@ android:visibility="gone" /> "Použít tlačítka hlasitosti pro navigaci v příspěvcích" "Ztlumit videa" "Ztlumit NSFW videa" - "Automatický pokus o přístup k Redgifs, pokud jsou videa na Gfycat odstraněna." "Ignorovat navigační lištu v přehrávači videí" "Zabránit ovládání videa mít dodatečný okraj" "Potvrdit pro odchod" @@ -757,7 +756,6 @@ Chodí popředu." "Oznámení" "Zprávy" "Zpráva" - "Získávání Gfycat videa selhalo" "Získávání Redgifs videa selhalo" "Získávání informací o videu. Čekejte prosím." "Nelze načíst obrázky" diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 71953729..6892bb5f 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -343,7 +343,6 @@ Tippen für Neuversuch." "NSFW-Videos stummschalten" - "Automatisch versuchen, Redgifs abzurufen, falls Videos auf Gfycat entfernt wurden." "Navigationsleiste im Video-Player ignorieren" "Kein extra Rand beim Video-Controller" "Verlassen bestätigen" @@ -773,7 +772,6 @@ Sie ist nicht krank oder so, aber sie könnte sich definitiv bessern." "Benachrichtigungen" "Nachrichten" "Nachricht" - "Abruf des Gfycat-Videos fehlgeschlagen" "Abruf des Redgifs-Videos fehlgeschlagen" "Lade Video-Info. Bitte warten." "Kann Bilder nicht laden" diff --git a/app/src/main/res/values-el/strings.xml b/app/src/main/res/values-el/strings.xml index d8dc0daf..54aefad0 100644 --- a/app/src/main/res/values-el/strings.xml +++ b/app/src/main/res/values-el/strings.xml @@ -304,7 +304,6 @@ "Περιήγηση στις αναρτήσεις με τα κουμπιά έντασης" "Σίγαση βίντεο" "Σίγαση NSFW βίντεο" - "Αύτοματη προσπάθεια προσπέλασης στο Redgifs αν τα Βίντεο στο Gfycat έχουν αφαιρεθεί." "Αγνόηση Μπάρας Πλοήγησης κατά την Αναπαραγωγή Βίντεο" "Αποτρέπει τα Χειριστήρια του Βίντεο να έχουν έξτρα περιθώριο" "Επιβεβαίωση για Έξοδο" @@ -703,7 +702,6 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd "Ειδοποιήσεις" "Μηνύματα" "Μήνυμα" - "Η ανάκτηση του βίντεο Gfycat απέτυχε" "Η ανάκτηση του βίντεο Redgifs απέτυχε" "Ανάκτηση πληροφοριών βίντεο. Παρακαλώ περιμένετε." "Αδυναμία φόρτωσης εικόνων" @@ -1103,7 +1101,7 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd "Επικοινωνία με Συντονιστές" "Αποθήκευση NSFW Πολυμέσων σε Άλλη Τοποθεσία" "Τοποθεσία Λήψης NSFW" - "Η ανάκτηση του βίντεο Gfycat απέτυχε" + "Η ανάκτηση του βίντεο Streamable απέτυχε" "Υποβολή Αλλαγής Άβαταρ" diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index 5c31bc19..a6dc7fd4 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -358,7 +358,6 @@ Premio means prize, so it's better suited the first word instead of the second o "Usar las teclas de volumen para navegar publicaciones" "Silenciar vídeos" "Silenciar vídeos NSFW" - "Intentar acceder automáticamente a Redgifs si se eliminan los videos en Gfycat" "Ignorar la barra de navegación en el reproductor de vídeo" "Bloquear al controlador de vídeo para que no tenga margen extra" "Confirmar para salir" @@ -798,7 +797,6 @@ No está enferma ni nada, pero definitivamente podría mejorar." "Notificaciones" "Mensajes" "Mensaje" - "No fue posible obtener el vídeo de Gfycat" "No fue posible obtener el vídeo de Redgifs" "Obteniendo información del vídeo. Por favor espera." "No fue posible cargar las imágenes" diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index d49b466e..01bb0391 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -388,7 +388,6 @@ peut ne pas fonctionner sur Android 11" "Couper le son des vidéos NSFW" - "Essayez d'accéder automatiquement aux Redgifs si les Vidéos sur Gfycat sont supprimées." "Ignorer la barre de navigation dans le lecteur vidéo" "Empêcher le Contrôleur Vidéo de créer une Marge Supplémentaire" "Confirmer pour quitter" @@ -844,7 +843,6 @@ Basé sur le thème sombre Indigo" "Notifications" "Messages" "Message" - "Échec de la récupération de la vidéo Gfycat" "Échec de la récupération de la vidéo Redgifs" "Récupération des informations vidéo. Veuillez patienter. " "Impossible de charger les images" diff --git a/app/src/main/res/values-hi/strings.xml b/app/src/main/res/values-hi/strings.xml index f06553b3..3a6313a1 100644 --- a/app/src/main/res/values-hi/strings.xml +++ b/app/src/main/res/values-hi/strings.xml @@ -384,7 +384,6 @@ Behavior --> "मौन NSFW वीडियोज" - "स्वतः ही Redgifs खोलने का प्रयास यदि Gfycat पर वीडियोज हटा दी गयी हों " "वीडियो प्लेयर में नेवीगेशन बार का छिपना" "वीडियो कंट्रोलर द्वारा अतिरिक्त हाशिया लेने पर रोक " "एप छोड़ने की पुष्टि " @@ -824,7 +823,6 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd "अधिसूचनाएं " "संदेश " "संदेश " - "Gfycat वीडियो प्राप्ति सफल " "Redgifs वीडियो प्राप्ति असफल " "वीडियो इनफो प्राप्त हो रहा है। कृपया प्रतीक्षा करें। " "चित्र लोड नहीं हो सका " diff --git a/app/src/main/res/values-hr/strings.xml b/app/src/main/res/values-hr/strings.xml index 322cc477..acf0c68f 100644 --- a/app/src/main/res/values-hr/strings.xml +++ b/app/src/main/res/values-hr/strings.xml @@ -356,7 +356,6 @@ "Isključi ton na NSFW videozapisima" - "Automatski pokušaj pristupiti Redgifs ako su videozapisi na Gfycatu uklonjeni." "Ignoriraj navigacijsku traku u video playeru" "Onemogući dodatnu marginu na video kontroleru" "Potvrdi izlaz" @@ -791,7 +790,6 @@ Baziraj na Indigo Amoled temi" "Obavijesti" "Poruke" "Poruka" - "Dohvaćanje Gfycat videozapisa nije uspjelo" "Dohvaćanje Redgifs videozapisa nije uspjelo" "Dohvaćanje informacija o videozapisu. Molim pričekajte." "Nije moguće učitati slike" diff --git a/app/src/main/res/values-hu/strings.xml b/app/src/main/res/values-hu/strings.xml index 3c13336a..11b01b33 100644 --- a/app/src/main/res/values-hu/strings.xml +++ b/app/src/main/res/values-hu/strings.xml @@ -307,7 +307,6 @@ "Hangerőgombok használata a bejegyzések közti navigációra" "Videók némítása" "NSFW videók némítása" - "A Redgifek automatikusa elérése, ha a videók el lettek távolítva a Gfycatről." "Navigációs sáv mellőzése a videólejátszóban" "A videóvezérlő extra margójának megakadályozása" "Kilépés megerősítése" @@ -730,7 +729,6 @@ Az alap az indigó amoled téma" "Értesítések" "Üzenetek" "Üzenet" - "Gfycat videó megszerzése nem sikerült" "Redgifs videó megszerzése nem sikerült" "Videó infó megszerzése. Kérlek várj." "Nem lehet betölteni a képeket" diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 3dc16098..550f7843 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -311,7 +311,6 @@ Tocca per riprovare." "Usa i Tasti del Volume per Navigare i Post" "Muta i video" "Metti in muto i video NSFW" - "Prova automaticamente ad accedere a Redgifs se i video su Gfycat vengono rimossi." "Ignora la Barra di Navigazione nel Lettore Video" "Impedisci ai controlli video di avere margine aggiuntivo" "Conferma per uscire" @@ -707,7 +706,6 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd "Notifiche" "Messaggi" "Messaggio" - "Impossibile recuperare il video da Gfycat" "Impossibile recuperare il video da Redgifs" "Recupero delle informazioni sul video. Attendere prego." "Impossibile caricare immagini" diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml index 3e409923..7f63c702 100644 --- a/app/src/main/res/values-ja/strings.xml +++ b/app/src/main/res/values-ja/strings.xml @@ -383,7 +383,6 @@ "NSFWの動画をミュート再生" - "Gfycatの動画が削除されていた場合、自動的にRedgifsでリトライ" "動画プレーヤーでナビゲーションバーを無視" "動画コントローラーが余分な余白を使用することを防止します" "アプリの終了確認を表示" @@ -836,7 +835,6 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd "通知" "メッセージ" "メッセージ" - "Gfycat動画を取得できませんでした" "Redgifs動画を取得できませんでした" "動画の情報を取得中です。少々お待ちください。" "画像をロードできませんでした" diff --git a/app/src/main/res/values-ko/strings.xml b/app/src/main/res/values-ko/strings.xml index e41575ef..784f132c 100644 --- a/app/src/main/res/values-ko/strings.xml +++ b/app/src/main/res/values-ko/strings.xml @@ -334,7 +334,6 @@ "볼륨 키로 포스트 스크롤하기" "둥영상 음소거" "NSFW 둥영상 음소거" - "Gfycat 비디오가 제거되었을 시 자동으로 Redgifs 접근 시도하기" "영상에서 내비게이션 바 무시" "나갈 때 확인" "댓글" diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 4d9b3405..e855da6a 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -340,7 +340,6 @@ Druk om opnieuw te proberen." "NSFW-video's dempen" - "Automatisch trachten Redgifs te openen als video's zijn verwijderd van Gfycat" "Navigatiebalk verbergen in videospeler" "Voorkom dat de navigatiebalk extra opvulling heeft" "Afsluiten bevestigen" @@ -765,7 +764,6 @@ Ze is niet ziek of zo, maar ze kan zeker beter worden." "Notificaties" "Berichten" "Bericht" - "Ophalen van Gfycat video is mislukt" "Ophalen van Redgifs video is mislukt" "Ophalen van videoinfo. Even geduld aub." "Kan afbeeldingen niet laden" diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 82a8d2f5..b8d074aa 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -332,7 +332,6 @@ Naciśnij, aby spróbować ponownie." "Wycisz filmy NSFW" - "Automatycznie próbuj uzyskać filmy z Redgifs, gdy są usunięte z Gfycat." "Ignoruj pasek nawigacji w odtwarzaczu wideo" "Zapobiegaj posiadaniu dodatkowego marginesu przez kontroler wideo" "Potwierdź aby wyjść" @@ -757,7 +756,6 @@ Nie jest chora ani nic, ale na pewno może stać się lepsza." "Powiadomienia" "Wiadomości" "Wiadomość" - "Nie udało się pobrać filmu z Gfycat" "Nie udało się pobrać filmu z Redgifs" "Pobieranie informacji o filmie. Proszę czekać." "Nie można załadować obrazów" diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 187b8f28..f96cb25b 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -333,7 +333,6 @@ Toque para tentar de novo." "Usar as teclas de volume para navegar em posagens" "Silenciar Vídeos" "Silenciar Vídeos NSFW" - "Tentar acessar automaticamente o Redgifs se os vídeos do Gfycat forem excluídos." "Ignorar barra de navegação no reprodutor de vídeos" "Evitar que o Controle de Vídeo Tenha Margens Largas" "Confirmar para Sair" @@ -743,7 +742,6 @@ Ela não está doente ou algo assim, mas definitivamente poderia melhorar.""Notificações" "Mensagens" "Mensagem" - "Erro ao buscar vídeos do Gfycat" "Erro ao buscar vídeos do Redgifs" "Obtendo informações do vídeo. Por favor, espere." "Não pode carregar as imagens" diff --git a/app/src/main/res/values-pt/strings.xml b/app/src/main/res/values-pt/strings.xml index acc1e76b..52ca9422 100644 --- a/app/src/main/res/values-pt/strings.xml +++ b/app/src/main/res/values-pt/strings.xml @@ -349,7 +349,6 @@ Toque para tentar novamente." "Vídeos 18+ Sem Som" - "Tentar aceder ao Redgifs automaticamente caso os vídeos no Gfycat tenham sido removidos." "Ignorar Barra de Navegação no Reprodutor de Vídeo" "Impedir que o Controlador de Vídeo Tenha Margem Extra" "Confirmar para Sair" @@ -754,7 +753,6 @@ Ela não está doente nem nada, mas certamente poderá melhorar." "Notificações" "Mensagens" "Mensagem" - "Falha ao obter vídeo do Gfycat" "Falha ao obter vídeo do Redgifs" "A obter informações do vídeo. Aguarde." "Impossível carregar imagens" diff --git a/app/src/main/res/values-ro/strings.xml b/app/src/main/res/values-ro/strings.xml index 6b137ad3..baf6b796 100644 --- a/app/src/main/res/values-ro/strings.xml +++ b/app/src/main/res/values-ro/strings.xml @@ -335,7 +335,6 @@ Apăsați pentru reîncărcare." "Utilizați tastele de volum pentru a naviga postările" "Oprire sunet videoclipuri" "Oprire sunet videoclipuri NSFW" - "Încercați să accesați Redgifs dacă videourile de pe Gfycat sunt șterse." "Ignorați bara de navigare în player-ul video" "Împiedicați player-ul video din a avea margine suplimentară" "Confirmare ieșire" @@ -749,7 +748,6 @@ Nu e bolnavă sau ceva de genul, dar cu siguranță ar putea să se facă bine." "Notificări" "Mesaje" "Mesaj" - "Obținerea videoclipului Gfycat a eșuat" "Obținerea videoclipului Redgifs a eșuat" "Se obțin informații despre video. Te rugăm să aștepți." "Nu s-au putut încărca imaginile" diff --git a/app/src/main/res/values-ru/strings.xml b/app/src/main/res/values-ru/strings.xml index 2a28699d..5b90a82b 100644 --- a/app/src/main/res/values-ru/strings.xml +++ b/app/src/main/res/values-ru/strings.xml @@ -348,7 +348,6 @@ "NSFW-видео без звука" - "Автопопытка доступа к Redgifs, если видео на Gfycat удалены." "Не использовать панель навигации в видеопроигрывателе" "Предотвращает случайные нажатия" "Подтверждать выход" @@ -765,7 +764,6 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd "Уведомления" "Сообщения" "Сообщение" - "Невозможно получить видео Gfycat" "Невозможно получить видео Redgifs" "Получение информации о видео. Пожалуйста, подождите." "Невозможно загрузить изображения" diff --git a/app/src/main/res/values-tr-rTR/strings.xml b/app/src/main/res/values-tr-rTR/strings.xml index 8236305b..088f20ab 100644 --- a/app/src/main/res/values-tr-rTR/strings.xml +++ b/app/src/main/res/values-tr-rTR/strings.xml @@ -338,7 +338,6 @@ Tekrar denemek için tıklayın." "NSFW Videolarını Sessize Al" - "Gfycat'teki Videolar Kaldırılmışsa Otomatik Olarak Redgif'lere Erişmeyi Dene." "Video Oynatıcısındaki Navigasyon Çubuğunu Yoksay" "Video Denetleyicisinde Fazladan Kenar Olmasını Önle" "Çıkışı Doğrula" @@ -757,7 +756,6 @@ Amoled Tema Şablonu Oluştur" "Bildirimler" "Mesajlar" "Mesaj" - "Gfycat video'su alınamadı" "Redgifs video'su alınamadı" "Video bilgisi alınıyor. Lütfen bekleyin." "Görüntüler yüklenemedi" diff --git a/app/src/main/res/values-uk/strings.xml b/app/src/main/res/values-uk/strings.xml index f7943ae3..9b8ee409 100644 --- a/app/src/main/res/values-uk/strings.xml +++ b/app/src/main/res/values-uk/strings.xml @@ -337,7 +337,6 @@ "Пересуватися дописами клавішами гучності" "Глушити відео" "Глушити відео НБДР" - "Автоматично пробувати отримати доступ до Redgifs, якщо відео на Gfycat видалено." "Ігнорувати панель пересування у відео-програвачі" "Не дозволяти відеоконтролеру мати додаткове поле" "Підтверджувати вихід" @@ -753,7 +752,6 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd "Сповіщення" "Повідомлення" "Повідомлення" - "Не вдалося отримати відеозапис Gfycat" "Не вдалося отримати відеозапис Redgifs" "Отримання відомостей про відео. Зачекайте." "Не можливо завантажити зображення" diff --git a/app/src/main/res/values-vi/strings.xml b/app/src/main/res/values-vi/strings.xml index 6abc758b..3236a559 100644 --- a/app/src/main/res/values-vi/strings.xml +++ b/app/src/main/res/values-vi/strings.xml @@ -350,7 +350,6 @@ Nhấn để thử lại." "Tắt tiếng video NSFW" - "Tự động thử truy cập Redgifs nếu Video trên Gfycat bị xóa." "Bỏ qua thanh điều hướng trong trình phát video" "Ngăn trình điều khiển video có thêm lề" "Xác nhận để thoát" @@ -766,7 +765,6 @@ Cô ta không ốm hay gì cả, nhưng cô ấy chắc chắn có thể khá h "Thông báo" "Tin nhắn" "Tin nhắn" - "Lấy video Gfycat thất bại" "Lấy video Redgifs thất bại" "Đang lấy thông tin video. Vui lòng đợi." "Không thể tải hình ảnh" diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 36b2fc7d..a1243303 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -341,7 +341,6 @@ "静音 NSFW 视频" - "如果 Gfycat 上的视频已被删除,则自动尝试访问 Redgifs。" "视频播放器中忽略导航栏" @@ -774,7 +773,6 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd "通知" "消息" "消息" - "获取 Gfycat 视频失败" "获取 Redgifs 视频失败" "正在获取视频信息。请稍候。" "无法加载图像" diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 5767b9aa..542929a3 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -403,7 +403,6 @@ Use Volume Keys to Navigate Posts Mute Videos Mute NSFW Videos - Automatically Try Accessing Redgifs if Videos on Gfycat are Removed. Ignore Navigation Bar in Video Player Prevent the Video Controller Having Extra Margin Main Page Back Button Action @@ -1019,7 +1018,6 @@ Messages Message - Fetch Gfycat video failed Fetch Redgifs video failed Fetching video info. Please wait. Fetch Streamable video failed diff --git a/app/src/main/res/xml/video_preferences.xml b/app/src/main/res/xml/video_preferences.xml index ffc2a7f6..402497b8 100644 --- a/app/src/main/res/xml/video_preferences.xml +++ b/app/src/main/res/xml/video_preferences.xml @@ -14,11 +14,6 @@ app:icon="@drawable/ic_mute_preferences_24dp" app:title="@string/settings_mute_nsfw_video_title" /> - -