Merge pull request 'Remove Gfycat support (the service is dead), simplifying the code' (#226) from tinsukE/Eternity:remove_gfycat into master

Reviewed-on: https://codeberg.org/Bazsalanszky/Eternity/pulls/226
Reviewed-by: Bazsalanszky <bazsalanszky@noreply.codeberg.org>
This commit is contained in:
Bazsalanszky 2024-01-03 13:39:39 +00:00
commit 02bed2eb3b
49 changed files with 272 additions and 601 deletions

View File

@ -1,129 +0,0 @@
package eu.toldi.infinityforlemmy;
import android.os.Handler;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
import java.util.concurrent.Executor;
import eu.toldi.infinityforlemmy.apis.GfycatAPI;
import eu.toldi.infinityforlemmy.apis.RedgifsAPI;
import eu.toldi.infinityforlemmy.utils.JSONUtils;
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<String> 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(Executor executor, Handler handler, Retrofit redgifsRetrofit,
String gfycatId,
FetchGfycatOrRedgifsVideoLinksListener fetchGfycatOrRedgifsVideoLinksListener) {
executor.execute(() -> {
try {
Response<String> response = redgifsRetrofit.create(RedgifsAPI.class).getRedgifsData(gfycatId).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<String> gfycatCall,
boolean isGfycatVideo,
boolean automaticallyTryRedgifs,
FetchGfycatOrRedgifsVideoLinksListener fetchGfycatOrRedgifsVideoLinksListener) {
executor.execute(() -> {
try {
Response<String> 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));
}
}
}

View File

@ -0,0 +1,71 @@
package eu.toldi.infinityforlemmy;
import android.os.Handler;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
import java.util.concurrent.Executor;
import eu.toldi.infinityforlemmy.apis.RedgifsAPI;
import eu.toldi.infinityforlemmy.utils.JSONUtils;
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,
String redgifsId,
FetchRedgifsVideoLinksListener fetchRedgifsVideoLinksListener) {
executor.execute(() -> {
try {
Response<String> response = redgifsRetrofit.create(RedgifsAPI.class).getRedgifsData(redgifsId).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<String> redgifsCall,
FetchRedgifsVideoLinksListener fetchRedgifsVideoLinksListener) {
executor.execute(() -> {
try {
Response<String> 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));
}
}
}

View File

@ -143,15 +143,6 @@ abstract class NetworkModule {
.build();
}
@Provides
@Named("gfycat")
@Singleton
static Retrofit provideGfycatRetrofit(@Named("base") RetrofitHolder retrofit) {
return retrofit.getRetrofit().newBuilder()
.baseUrl(APIUtils.GFYCAT_API_BASE_URI)
.build();
}
@Provides
@Named("RedgifsAccessTokenAuthenticator")
static Interceptor redgifsAccessTokenAuthenticator(@Named("current_account") SharedPreferences currentAccountSharedPreferences) {

View File

@ -55,7 +55,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+/?";
@ -346,20 +345,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);

View File

@ -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 eu.toldi.infinityforlemmy.CustomFontReceiver;
import eu.toldi.infinityforlemmy.FetchGfycatOrRedgifsVideoLinks;
import eu.toldi.infinityforlemmy.FetchRedgifsVideoLinks;
import eu.toldi.infinityforlemmy.FetchStreamableVideo;
import eu.toldi.infinityforlemmy.Infinity;
import eu.toldi.infinityforlemmy.R;
@ -133,7 +132,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 = "ERI";
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";
@ -142,7 +141,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;
@ -204,10 +202,6 @@ public class ViewVideoActivity extends AppCompatActivity implements CustomFontRe
@Named("no_oauth")
RetrofitHolder retrofit;
@Inject
@Named("gfycat")
Retrofit gfycatRetrofit;
@Inject
@Named("redgifs")
Retrofit redgifsRetrofit;
@ -548,29 +542,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));
@ -725,61 +711,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)));
}
FetchRedgifsVideoLinks.fetchRedgifsVideoLinks(mExecutor, new Handler(), redgifsRetrofit,
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) {
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(mExecutor, new Handler(), redgifsRetrofit,
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) {
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) {
@ -797,30 +750,14 @@ public class ViewVideoActivity extends AppCompatActivity implements CustomFontRe
postEnricher, 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('-'));
String redgifsId = post.getRedgifsId();
if (redgifsId != null && redgifsId.contains("-")) {
redgifsId = redgifsId.substring(0, redgifsId.indexOf('-'));
}
if (videoType == VIDEO_TYPE_GFYCAT) {
videoFileName = "Gfycat-" + gfycatId + ".mp4";
} else {
videoFileName = "Redgifs-" + gfycatId + ".mp4";
}
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();

View File

@ -58,7 +58,7 @@ import java.util.regex.Pattern;
import javax.inject.Provider;
import eu.toldi.infinityforlemmy.FetchGfycatOrRedgifsVideoLinks;
import eu.toldi.infinityforlemmy.FetchRedgifsVideoLinks;
import eu.toldi.infinityforlemmy.FetchStreamableVideo;
import eu.toldi.infinityforlemmy.R;
import eu.toldi.infinityforlemmy.RedditDataRoomDatabase;
@ -78,7 +78,6 @@ import eu.toldi.infinityforlemmy.activities.ViewRedditGalleryActivity;
import eu.toldi.infinityforlemmy.activities.ViewSubredditDetailActivity;
import eu.toldi.infinityforlemmy.activities.ViewUserDetailActivity;
import eu.toldi.infinityforlemmy.activities.ViewVideoActivity;
import eu.toldi.infinityforlemmy.apis.GfycatAPI;
import eu.toldi.infinityforlemmy.apis.RedgifsAPI;
import eu.toldi.infinityforlemmy.apis.StreamableAPI;
import eu.toldi.infinityforlemmy.asynctasks.LoadSubredditIcon;
@ -140,7 +139,6 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
private ViewPostDetailFragment mFragment;
private Executor mExecutor;
private RetrofitHolder mRetrofit;
private Retrofit mGfycatRetrofit;
private Retrofit mRedgifsRetrofit;
private final Provider<StreamableAPI> mStreamableApiProvider;
private RedditDataRoomDatabase mRedditDataRoomDatabase;
@ -166,7 +164,6 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
private boolean mMuteAutoplayingVideos;
private double mStartAutoplayVisibleAreaOffset;
private boolean mMuteNSFWVideo;
private boolean mAutomaticallyTryRedgifs;
private boolean mDataSavingMode;
private boolean mDisableImagePreview;
private boolean mOnlyDisablePreviewInVideoAndGifPosts;
@ -227,7 +224,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
public PostDetailRecyclerViewAdapter(BaseActivity activity, ViewPostDetailFragment fragment,
Executor executor, CustomThemeWrapper customThemeWrapper,
RetrofitHolder retrofit, Retrofit gfycatRetrofit,
RetrofitHolder retrofit,
Retrofit redgifsRetrofit, Provider<StreamableAPI> streamableApiProvider,
RedditDataRoomDatabase redditDataRoomDatabase, RequestManager glide,
boolean separatePostAndComments, String accessToken,
@ -242,7 +239,6 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
mFragment = fragment;
mExecutor = executor;
mRetrofit = retrofit;
mGfycatRetrofit = gfycatRetrofit;
mRedgifsRetrofit = redgifsRetrofit;
mStreamableApiProvider = streamableApiProvider;
mRedditDataRoomDatabase = redditDataRoomDatabase;
@ -335,7 +331,6 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
sharedPreferences.getInt(SharedPreferencesUtils.START_AUTOPLAY_VISIBLE_AREA_OFFSET_LANDSCAPE, 50) / 100.0;
mMuteNSFWVideo = sharedPreferences.getBoolean(SharedPreferencesUtils.MUTE_NSFW_VIDEO, false);
mAutomaticallyTryRedgifs = sharedPreferences.getBoolean(SharedPreferencesUtils.AUTOMATICALLY_TRY_REDGIFS, true);
String dataSavingModeString = sharedPreferences.getString(SharedPreferencesUtils.DATA_SAVING_MODE, SharedPreferencesUtils.DATA_SAVING_MODE_OFF);
if (dataSavingModeString.equals(SharedPreferencesUtils.DATA_SAVING_MODE_ALWAYS)) {
@ -704,45 +699,43 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
((PostDetailBaseVideoAutoplayViewHolder) holder).setVolume((mMuteAutoplayingVideos || (mPost.isNSFW() && mMuteNSFWVideo)) ? 0f : 1f);
}
if (mPost.isGfycat() || mPost.isRedgifs() && !mPost.isLoadGfycatOrStreamableVideoSuccess()) {
((PostDetailBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall =
mPost.isGfycat() ? mGfycatRetrofit.create(GfycatAPI.class).getGfycatData(mPost.getGfycatId()) :
mRedgifsRetrofit.create(RedgifsAPI.class).getRedgifsData(mPost.getGfycatId());
FetchGfycatOrRedgifsVideoLinks.fetchGfycatOrRedgifsVideoLinksInRecyclerViewAdapter(mExecutor, new Handler(),
((PostDetailBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall,
mPost.isGfycat(), mAutomaticallyTryRedgifs,
new FetchGfycatOrRedgifsVideoLinks.FetchGfycatOrRedgifsVideoLinksListener() {
if (mPost.isRedgifs() && !mPost.isLoadVideoSuccess()) {
((PostDetailBaseVideoAutoplayViewHolder) holder).fetchStreamableVideoCall =
mRedgifsRetrofit.create(RedgifsAPI.class).getRedgifsData(mPost.getRedgifsId());
FetchRedgifsVideoLinks.fetchRedgifsVideoLinksInRecyclerViewAdapter(mExecutor, new Handler(),
((PostDetailBaseVideoAutoplayViewHolder) holder).fetchStreamableVideoCall,
new FetchRedgifsVideoLinks.FetchRedgifsVideoLinksListener() {
@Override
public void success(String webm, String mp4) {
mPost.setVideoDownloadUrl(mp4);
mPost.setVideoUrl(mp4);
mPost.setLoadGfyOrStreamableVideoSuccess(true);
mPost.setLoadVideoSuccess(true);
((PostDetailBaseVideoAutoplayViewHolder) holder).bindVideoUri(Uri.parse(mPost.getVideoUrl()));
}
@Override
public void failed(int errorCode) {
((PostDetailBaseVideoAutoplayViewHolder) holder).mErrorLoadingGfycatImageView.setVisibility(View.VISIBLE);
((PostDetailBaseVideoAutoplayViewHolder) holder).mErrorLoadingVideoImageView.setVisibility(View.VISIBLE);
}
});
} else if(mPost.isStreamable() && !mPost.isLoadGfycatOrStreamableVideoSuccess()) {
((PostDetailBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall =
} else if(mPost.isStreamable() && !mPost.isLoadVideoSuccess()) {
((PostDetailBaseVideoAutoplayViewHolder) holder).fetchStreamableVideoCall =
mStreamableApiProvider.get().getStreamableData(mPost.getStreamableShortCode());
FetchStreamableVideo.fetchStreamableVideoInRecyclerViewAdapter(mExecutor, new Handler(),
((PostDetailBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall,
((PostDetailBaseVideoAutoplayViewHolder) holder).fetchStreamableVideoCall,
new FetchStreamableVideo.FetchStreamableVideoListener() {
@Override
public void success(StreamableVideo streamableVideo) {
StreamableVideo.Media media = streamableVideo.mp4 == null ? streamableVideo.mp4Mobile : streamableVideo.mp4;
mPost.setVideoDownloadUrl(media.url);
mPost.setVideoUrl(media.url);
mPost.setLoadGfyOrStreamableVideoSuccess(true);
mPost.setLoadVideoSuccess(true);
((PostDetailBaseVideoAutoplayViewHolder) holder).bindVideoUri(Uri.parse(mPost.getVideoUrl()));
}
@Override
public void failed() {
((PostDetailBaseVideoAutoplayViewHolder) holder).mErrorLoadingGfycatImageView.setVisibility(View.VISIBLE);
((PostDetailBaseVideoAutoplayViewHolder) holder).mErrorLoadingVideoImageView.setVisibility(View.VISIBLE);
}
});
} else {
@ -1143,11 +1136,11 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
((PostDetailBaseViewHolder) holder).contentMarkdownView.setVisibility(View.GONE);
if (holder instanceof PostDetailBaseVideoAutoplayViewHolder) {
if (((PostDetailBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall != null && !((PostDetailBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall.isCanceled()) {
((PostDetailBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall.cancel();
((PostDetailBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall = null;
if (((PostDetailBaseVideoAutoplayViewHolder) holder).fetchStreamableVideoCall != null && !((PostDetailBaseVideoAutoplayViewHolder) holder).fetchStreamableVideoCall.isCanceled()) {
((PostDetailBaseVideoAutoplayViewHolder) holder).fetchStreamableVideoCall.cancel();
((PostDetailBaseVideoAutoplayViewHolder) holder).fetchStreamableVideoCall = null;
}
((PostDetailBaseVideoAutoplayViewHolder) holder).mErrorLoadingGfycatImageView.setVisibility(View.GONE);
((PostDetailBaseVideoAutoplayViewHolder) holder).mErrorLoadingVideoImageView.setVisibility(View.GONE);
((PostDetailBaseVideoAutoplayViewHolder) holder).muteButton.setVisibility(View.GONE);
if (!((PostDetailBaseVideoAutoplayViewHolder) holder).isManuallyPaused) {
((PostDetailBaseVideoAutoplayViewHolder) holder).resetVolume();
@ -1778,11 +1771,11 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
}
class PostDetailBaseVideoAutoplayViewHolder extends PostDetailBaseViewHolder implements ToroPlayer {
public Call<String> fetchGfycatOrStreamableVideoCall;
public Call<String> fetchStreamableVideoCall;
AspectRatioFrameLayout aspectRatioFrameLayout;
PlayerView playerView;
GifImageView previewImageView;
ImageView mErrorLoadingGfycatImageView;
ImageView mErrorLoadingVideoImageView;
ImageView muteButton;
ImageView fullscreenButton;
ImageView pauseButton;
@ -1815,7 +1808,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
AspectRatioFrameLayout aspectRatioFrameLayout,
PlayerView playerView,
GifImageView previewImageView,
ImageView errorLoadingGfycatImageView,
ImageView errorLoadingVideoImageView,
ImageView muteButton,
ImageView fullscreenButton,
ImageView pauseButton,
@ -1859,7 +1852,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
this.aspectRatioFrameLayout = aspectRatioFrameLayout;
this.previewImageView = previewImageView;
this.mErrorLoadingGfycatImageView = errorLoadingGfycatImageView;
this.mErrorLoadingVideoImageView = errorLoadingVideoImageView;
this.playerView = playerView;
this.muteButton = muteButton;
this.fullscreenButton = fullscreenButton;
@ -1890,17 +1883,10 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
if (mPost.isImgur()) {
intent.setData(Uri.parse(mPost.getVideoUrl()));
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_IMGUR);
} else if (mPost.isGfycat()) {
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_GFYCAT);
intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, mPost.getGfycatId());
if (mPost.isLoadGfycatOrStreamableVideoSuccess()) {
intent.setData(Uri.parse(mPost.getVideoUrl()));
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_DOWNLOAD_URL, mPost.getVideoDownloadUrl());
}
} else if (mPost.isRedgifs()) {
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_REDGIFS);
intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, mPost.getGfycatId());
if (mPost.isLoadGfycatOrStreamableVideoSuccess()) {
intent.putExtra(ViewVideoActivity.EXTRA_REDGIFS_ID, mPost.getRedgifsId());
if (mPost.isLoadVideoSuccess()) {
intent.setData(Uri.parse(mPost.getVideoUrl()));
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_DOWNLOAD_URL, mPost.getVideoDownloadUrl());
}
@ -2095,7 +2081,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
binding.aspectRatioFrameLayoutItemPostDetailVideoAutoplay,
binding.playerViewItemPostDetailVideoAutoplay,
binding.previewImageViewItemPostDetailVideoAutoplay,
binding.errorLoadingGfycatImageViewItemPostDetailVideoAutoplay,
binding.errorLoadingVideoImageViewItemPostDetailVideoAutoplay,
binding.getRoot().findViewById(R.id.mute_exo_playback_control_view),
binding.getRoot().findViewById(R.id.fullscreen_exo_playback_control_view),
binding.getRoot().findViewById(R.id.exo_pause),
@ -2133,7 +2119,7 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
binding.aspectRatioFrameLayoutItemPostDetailVideoAutoplay,
binding.playerViewItemPostDetailVideoAutoplay,
binding.previewImageViewItemPostDetailVideoAutoplay,
binding.errorLoadingGfycatImageViewItemPostDetailVideoAutoplay,
binding.errorLoadingVideoImageViewItemPostDetailVideoAutoplay,
binding.getRoot().findViewById(R.id.mute_exo_playback_control_view),
binding.getRoot().findViewById(R.id.fullscreen_exo_playback_control_view),
binding.getRoot().findViewById(R.id.exo_pause),
@ -2196,12 +2182,9 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
if (mPost.isImgur()) {
intent.setData(Uri.parse(mPost.getVideoUrl()));
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_IMGUR);
} else if (mPost.isGfycat()) {
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_GFYCAT);
intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, mPost.getGfycatId());
} else if (mPost.isRedgifs()) {
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_REDGIFS);
intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, mPost.getGfycatId());
intent.putExtra(ViewVideoActivity.EXTRA_REDGIFS_ID, mPost.getRedgifsId());
} else if (mPost.isStreamable()) {
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_STREAMABLE);
intent.putExtra(ViewVideoActivity.EXTRA_STREAMABLE_SHORT_CODE, mPost.getStreamableShortCode());
@ -2382,12 +2365,9 @@ public class PostDetailRecyclerViewAdapter extends RecyclerView.Adapter<Recycler
if (mPost != null) {
if (mPost.getPostType() == Post.VIDEO_TYPE) {
Intent intent = new Intent(mActivity, ViewVideoActivity.class);
if (mPost.isGfycat()) {
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_GFYCAT);
intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, mPost.getGfycatId());
} else if (mPost.isRedgifs()) {
if (mPost.isRedgifs()) {
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_REDGIFS);
intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, mPost.getGfycatId());
intent.putExtra(ViewVideoActivity.EXTRA_REDGIFS_ID, mPost.getRedgifsId());
} else if (mPost.isStreamable()) {
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_STREAMABLE);
intent.putExtra(ViewVideoActivity.EXTRA_STREAMABLE_SHORT_CODE, mPost.getStreamableShortCode());

View File

@ -67,7 +67,7 @@ import javax.inject.Provider;
import butterknife.BindView;
import butterknife.ButterKnife;
import eu.toldi.infinityforlemmy.FetchGfycatOrRedgifsVideoLinks;
import eu.toldi.infinityforlemmy.FetchRedgifsVideoLinks;
import eu.toldi.infinityforlemmy.FetchStreamableVideo;
import eu.toldi.infinityforlemmy.MarkPostAsReadInterface;
import eu.toldi.infinityforlemmy.R;
@ -86,7 +86,6 @@ import eu.toldi.infinityforlemmy.activities.ViewRedditGalleryActivity;
import eu.toldi.infinityforlemmy.activities.ViewSubredditDetailActivity;
import eu.toldi.infinityforlemmy.activities.ViewUserDetailActivity;
import eu.toldi.infinityforlemmy.activities.ViewVideoActivity;
import eu.toldi.infinityforlemmy.apis.GfycatAPI;
import eu.toldi.infinityforlemmy.apis.RedgifsAPI;
import eu.toldi.infinityforlemmy.apis.StreamableAPI;
import eu.toldi.infinityforlemmy.bottomsheetfragments.ShareLinkBottomSheetFragment;
@ -171,7 +170,6 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
private SharedPreferences mCurrentAccountSharedPreferences;
private Executor mExecutor;
private RetrofitHolder retrofit;
private Retrofit mGfycatRetrofit;
private Retrofit mRedgifsRetrofit;
private Provider<StreamableAPI> mStreamableApiProvider;
private String mAccessToken;
@ -236,7 +234,6 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
private boolean mShowThumbnailOnTheRightInCompactLayout;
private double mStartAutoplayVisibleAreaOffset;
private boolean mMuteNSFWVideo;
private boolean mAutomaticallyTryRedgifs;
private boolean mLongPressToHideToolbarInCompactLayout;
private boolean mCompactLayoutToolbarHiddenByDefault;
private boolean mDataSavingMode = false;
@ -269,7 +266,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
private RecyclerView.RecycledViewPool mGalleryRecycledViewPool;
public PostRecyclerViewAdapter(BaseActivity activity, PostFragment fragment, Executor executor, RetrofitHolder retrofit,
Retrofit gfycatRetrofit, Retrofit redgifsRetrofit, Provider<StreamableAPI> streamableApiProvider,
Retrofit redgifsRetrofit, Provider<StreamableAPI> streamableApiProvider,
CustomThemeWrapper customThemeWrapper, Locale locale,
String accessToken, String accountName, int postType, int postLayout, boolean displaySubredditName,
SharedPreferences sharedPreferences, SharedPreferences currentAccountSharedPreferences,
@ -284,7 +281,6 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
mCurrentAccountSharedPreferences = currentAccountSharedPreferences;
mExecutor = executor;
this.retrofit = retrofit;
mGfycatRetrofit = gfycatRetrofit;
mRedgifsRetrofit = redgifsRetrofit;
mStreamableApiProvider = streamableApiProvider;
mAccessToken = accessToken;
@ -316,7 +312,6 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
sharedPreferences.getInt(SharedPreferencesUtils.START_AUTOPLAY_VISIBLE_AREA_OFFSET_LANDSCAPE, 50) / 100.0;
mMuteNSFWVideo = sharedPreferences.getBoolean(SharedPreferencesUtils.MUTE_NSFW_VIDEO, false);
mAutomaticallyTryRedgifs = sharedPreferences.getBoolean(SharedPreferencesUtils.AUTOMATICALLY_TRY_REDGIFS, true);
mLongPressToHideToolbarInCompactLayout = sharedPreferences.getBoolean(SharedPreferencesUtils.LONG_PRESS_TO_HIDE_TOOLBAR_IN_COMPACT_LAYOUT, false);
mCompactLayoutToolbarHiddenByDefault = sharedPreferences.getBoolean(SharedPreferencesUtils.POST_COMPACT_LAYOUT_TOOLBAR_HIDDEN_BY_DEFAULT, false);
@ -881,19 +876,17 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
}
}
if ((post.isGfycat() || post.isRedgifs()) && !post.isLoadGfycatOrStreamableVideoSuccess()) {
((PostBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall =
post.isGfycat() ? mGfycatRetrofit.create(GfycatAPI.class).getGfycatData(post.getGfycatId()) :
mRedgifsRetrofit.create(RedgifsAPI.class).getRedgifsData(post.getGfycatId());
FetchGfycatOrRedgifsVideoLinks.fetchGfycatOrRedgifsVideoLinksInRecyclerViewAdapter(mExecutor, new Handler(),
((PostBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall,
post.isGfycat(), mAutomaticallyTryRedgifs,
new FetchGfycatOrRedgifsVideoLinks.FetchGfycatOrRedgifsVideoLinksListener() {
if (post.isRedgifs() && !post.isLoadVideoSuccess()) {
((PostBaseVideoAutoplayViewHolder) holder).fetchStreamableVideoCall =
mRedgifsRetrofit.create(RedgifsAPI.class).getRedgifsData(post.getRedgifsId());
FetchRedgifsVideoLinks.fetchRedgifsVideoLinksInRecyclerViewAdapter(mExecutor, new Handler(),
((PostBaseVideoAutoplayViewHolder) holder).fetchStreamableVideoCall,
new FetchRedgifsVideoLinks.FetchRedgifsVideoLinksListener() {
@Override
public void success(String webm, String mp4) {
post.setVideoDownloadUrl(mp4);
post.setVideoUrl(mp4);
post.setLoadGfyOrStreamableVideoSuccess(true);
post.setLoadVideoSuccess(true);
if (position == holder.getBindingAdapterPosition()) {
((PostBaseVideoAutoplayViewHolder) holder).bindVideoUri(Uri.parse(post.getVideoUrl()));
}
@ -902,22 +895,22 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
@Override
public void failed(int errorCode) {
if (position == holder.getBindingAdapterPosition()) {
((PostBaseVideoAutoplayViewHolder) holder).errorLoadingGfycatImageView.setVisibility(View.VISIBLE);
((PostBaseVideoAutoplayViewHolder) holder).errorLoadingVideoImageView.setVisibility(View.VISIBLE);
}
}
});
} else if (post.isStreamable() && !post.isLoadGfycatOrStreamableVideoSuccess()) {
((PostBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall =
} else if (post.isStreamable() && !post.isLoadVideoSuccess()) {
((PostBaseVideoAutoplayViewHolder) holder).fetchStreamableVideoCall =
mStreamableApiProvider.get().getStreamableData(post.getStreamableShortCode());
FetchStreamableVideo.fetchStreamableVideoInRecyclerViewAdapter(mExecutor, new Handler(),
((PostBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall,
((PostBaseVideoAutoplayViewHolder) holder).fetchStreamableVideoCall,
new FetchStreamableVideo.FetchStreamableVideoListener() {
@Override
public void success(StreamableVideo streamableVideo) {
StreamableVideo.Media media = streamableVideo.mp4 == null ? streamableVideo.mp4Mobile : streamableVideo.mp4;
post.setVideoDownloadUrl(media.url);
post.setVideoUrl(media.url);
post.setLoadGfyOrStreamableVideoSuccess(true);
post.setLoadVideoSuccess(true);
if (position == holder.getBindingAdapterPosition()) {
((PostBaseVideoAutoplayViewHolder) holder).bindVideoUri(Uri.parse(post.getVideoUrl()));
}
@ -926,7 +919,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
@Override
public void failed() {
if (position == holder.getBindingAdapterPosition()) {
((PostBaseVideoAutoplayViewHolder) holder).errorLoadingGfycatImageView.setVisibility(View.VISIBLE);
((PostBaseVideoAutoplayViewHolder) holder).errorLoadingVideoImageView.setVisibility(View.VISIBLE);
}
}
});
@ -1073,19 +1066,17 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
}
}
if ((post.isGfycat() || post.isRedgifs()) && !post.isLoadGfycatOrStreamableVideoSuccess()) {
((PostCard2BaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall =
post.isGfycat() ? mGfycatRetrofit.create(GfycatAPI.class).getGfycatData(post.getGfycatId()) :
mRedgifsRetrofit.create(RedgifsAPI.class).getRedgifsData(post.getGfycatId());
FetchGfycatOrRedgifsVideoLinks.fetchGfycatOrRedgifsVideoLinksInRecyclerViewAdapter(mExecutor, new Handler(),
((PostCard2BaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall,
post.isGfycat(), mAutomaticallyTryRedgifs,
new FetchGfycatOrRedgifsVideoLinks.FetchGfycatOrRedgifsVideoLinksListener() {
if (post.isRedgifs() && !post.isLoadVideoSuccess()) {
((PostCard2BaseVideoAutoplayViewHolder) holder).fetchStreamableVideoCall =
mRedgifsRetrofit.create(RedgifsAPI.class).getRedgifsData(post.getRedgifsId());
FetchRedgifsVideoLinks.fetchRedgifsVideoLinksInRecyclerViewAdapter(mExecutor, new Handler(),
((PostCard2BaseVideoAutoplayViewHolder) holder).fetchStreamableVideoCall,
new FetchRedgifsVideoLinks.FetchRedgifsVideoLinksListener() {
@Override
public void success(String webm, String mp4) {
post.setVideoDownloadUrl(mp4);
post.setVideoUrl(mp4);
post.setLoadGfyOrStreamableVideoSuccess(true);
post.setLoadVideoSuccess(true);
if (position == holder.getBindingAdapterPosition()) {
((PostCard2BaseVideoAutoplayViewHolder) holder).bindVideoUri(Uri.parse(post.getVideoUrl()));
}
@ -1094,22 +1085,22 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
@Override
public void failed(int errorCode) {
if (position == holder.getBindingAdapterPosition()) {
((PostCard2BaseVideoAutoplayViewHolder) holder).errorLoadingGfycatImageView.setVisibility(View.VISIBLE);
((PostCard2BaseVideoAutoplayViewHolder) holder).errorLoadingVideoImageView.setVisibility(View.VISIBLE);
}
}
});
} else if (post.isStreamable() && !post.isLoadGfycatOrStreamableVideoSuccess()) {
((PostCard2BaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall =
} else if (post.isStreamable() && !post.isLoadVideoSuccess()) {
((PostCard2BaseVideoAutoplayViewHolder) holder).fetchStreamableVideoCall =
mStreamableApiProvider.get().getStreamableData(post.getStreamableShortCode());
FetchStreamableVideo.fetchStreamableVideoInRecyclerViewAdapter(mExecutor, new Handler(),
((PostCard2BaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall,
((PostCard2BaseVideoAutoplayViewHolder) holder).fetchStreamableVideoCall,
new FetchStreamableVideo.FetchStreamableVideoListener() {
@Override
public void success(StreamableVideo streamableVideo) {
StreamableVideo.Media media = streamableVideo.mp4 == null ? streamableVideo.mp4Mobile : streamableVideo.mp4;
post.setVideoDownloadUrl(media.url);
post.setVideoUrl(media.url);
post.setLoadGfyOrStreamableVideoSuccess(true);
post.setLoadVideoSuccess(true);
if (position == holder.getBindingAdapterPosition()) {
((PostCard2BaseVideoAutoplayViewHolder) holder).bindVideoUri(Uri.parse(post.getVideoUrl()));
}
@ -1118,7 +1109,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
@Override
public void failed() {
if (position == holder.getBindingAdapterPosition()) {
((PostCard2BaseVideoAutoplayViewHolder) holder).errorLoadingGfycatImageView.setVisibility(View.VISIBLE);
((PostCard2BaseVideoAutoplayViewHolder) holder).errorLoadingVideoImageView.setVisibility(View.VISIBLE);
}
}
});
@ -1890,19 +1881,17 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
}
}
if ((post.isGfycat() || post.isRedgifs()) && !post.isLoadGfycatOrStreamableVideoSuccess()) {
((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall =
post.isGfycat() ? mGfycatRetrofit.create(GfycatAPI.class).getGfycatData(post.getGfycatId()) :
mRedgifsRetrofit.create(RedgifsAPI.class).getRedgifsData(post.getGfycatId());
FetchGfycatOrRedgifsVideoLinks.fetchGfycatOrRedgifsVideoLinksInRecyclerViewAdapter(mExecutor, new Handler(),
((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall,
post.isGfycat(), mAutomaticallyTryRedgifs,
new FetchGfycatOrRedgifsVideoLinks.FetchGfycatOrRedgifsVideoLinksListener() {
if (post.isRedgifs() && !post.isLoadVideoSuccess()) {
((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchStreamableVideoCall =
mRedgifsRetrofit.create(RedgifsAPI.class).getRedgifsData(post.getRedgifsId());
FetchRedgifsVideoLinks.fetchRedgifsVideoLinksInRecyclerViewAdapter(mExecutor, new Handler(),
((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchStreamableVideoCall,
new FetchRedgifsVideoLinks.FetchRedgifsVideoLinksListener() {
@Override
public void success(String webm, String mp4) {
post.setVideoDownloadUrl(mp4);
post.setVideoUrl(mp4);
post.setLoadGfyOrStreamableVideoSuccess(true);
post.setLoadVideoSuccess(true);
if (position == holder.getBindingAdapterPosition()) {
((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).bindVideoUri(Uri.parse(post.getVideoUrl()));
}
@ -1911,22 +1900,22 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
@Override
public void failed(int errorCode) {
if (position == holder.getBindingAdapterPosition()) {
((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).errorLoadingGfycatImageView.setVisibility(View.VISIBLE);
((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).errorLoadingVideoImageView.setVisibility(View.VISIBLE);
}
}
});
} else if (post.isStreamable() && !post.isLoadGfycatOrStreamableVideoSuccess()) {
((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall =
} else if (post.isStreamable() && !post.isLoadVideoSuccess()) {
((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchStreamableVideoCall =
mStreamableApiProvider.get().getStreamableData(post.getStreamableShortCode());
FetchStreamableVideo.fetchStreamableVideoInRecyclerViewAdapter(mExecutor, new Handler(),
((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall,
((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchStreamableVideoCall,
new FetchStreamableVideo.FetchStreamableVideoListener() {
@Override
public void success(StreamableVideo streamableVideo) {
StreamableVideo.Media media = streamableVideo.mp4 == null ? streamableVideo.mp4Mobile : streamableVideo.mp4;
post.setVideoDownloadUrl(media.url);
post.setVideoUrl(media.url);
post.setLoadGfyOrStreamableVideoSuccess(true);
post.setLoadVideoSuccess(true);
if (position == holder.getBindingAdapterPosition()) {
((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).bindVideoUri(Uri.parse(post.getVideoUrl()));
}
@ -1935,7 +1924,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
@Override
public void failed() {
if (position == holder.getBindingAdapterPosition()) {
((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).errorLoadingGfycatImageView.setVisibility(View.VISIBLE);
((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).errorLoadingVideoImageView.setVisibility(View.VISIBLE);
}
}
});
@ -2551,11 +2540,11 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
((PostBaseViewHolder) holder).titleTextView.setTextColor(mPostTitleColor);
if (holder instanceof PostBaseVideoAutoplayViewHolder) {
((PostBaseVideoAutoplayViewHolder) holder).mediaUri = null;
if (((PostBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall != null && !((PostBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall.isCanceled()) {
((PostBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall.cancel();
((PostBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall = null;
if (((PostBaseVideoAutoplayViewHolder) holder).fetchStreamableVideoCall != null && !((PostBaseVideoAutoplayViewHolder) holder).fetchStreamableVideoCall.isCanceled()) {
((PostBaseVideoAutoplayViewHolder) holder).fetchStreamableVideoCall.cancel();
((PostBaseVideoAutoplayViewHolder) holder).fetchStreamableVideoCall = null;
}
((PostBaseVideoAutoplayViewHolder) holder).errorLoadingGfycatImageView.setVisibility(View.GONE);
((PostBaseVideoAutoplayViewHolder) holder).errorLoadingVideoImageView.setVisibility(View.GONE);
((PostBaseVideoAutoplayViewHolder) holder).muteButton.setVisibility(View.GONE);
if (!((PostBaseVideoAutoplayViewHolder) holder).isManuallyPaused) {
((PostBaseVideoAutoplayViewHolder) holder).resetVolume();
@ -2581,11 +2570,11 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
((PostTextTypeViewHolder) holder).binding.contentTextViewItemPostTextType.setVisibility(View.GONE);
} else if (holder instanceof PostCard2BaseVideoAutoplayViewHolder) {
((PostCard2BaseVideoAutoplayViewHolder) holder).mediaUri = null;
if (((PostCard2BaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall != null && !((PostCard2BaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall.isCanceled()) {
((PostCard2BaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall.cancel();
((PostCard2BaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall = null;
if (((PostCard2BaseVideoAutoplayViewHolder) holder).fetchStreamableVideoCall != null && !((PostCard2BaseVideoAutoplayViewHolder) holder).fetchStreamableVideoCall.isCanceled()) {
((PostCard2BaseVideoAutoplayViewHolder) holder).fetchStreamableVideoCall.cancel();
((PostCard2BaseVideoAutoplayViewHolder) holder).fetchStreamableVideoCall = null;
}
((PostCard2BaseVideoAutoplayViewHolder) holder).errorLoadingGfycatImageView.setVisibility(View.GONE);
((PostCard2BaseVideoAutoplayViewHolder) holder).errorLoadingVideoImageView.setVisibility(View.GONE);
((PostCard2BaseVideoAutoplayViewHolder) holder).muteButton.setVisibility(View.GONE);
((PostCard2BaseVideoAutoplayViewHolder) holder).resetVolume();
mGlide.clear(((PostCard2BaseVideoAutoplayViewHolder) holder).previewImageView);
@ -2695,11 +2684,11 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
((PostMaterial3CardBaseViewHolder) holder).titleTextView.setTextColor(mPostTitleColor);
if (holder instanceof PostMaterial3CardBaseVideoAutoplayViewHolder) {
((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).mediaUri = null;
if (((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall != null && !((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall.isCanceled()) {
((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall.cancel();
((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchGfycatOrStreamableVideoCall = null;
if (((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchStreamableVideoCall != null && !((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchStreamableVideoCall.isCanceled()) {
((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchStreamableVideoCall.cancel();
((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).fetchStreamableVideoCall = null;
}
((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).errorLoadingGfycatImageView.setVisibility(View.GONE);
((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).errorLoadingVideoImageView.setVisibility(View.GONE);
((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).muteButton.setVisibility(View.GONE);
if (!((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).isManuallyPaused) {
((PostMaterial3CardBaseVideoAutoplayViewHolder) holder).resetVolume();
@ -2822,12 +2811,9 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
if (post.isImgur()) {
intent.setData(Uri.parse(post.getVideoUrl()));
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_IMGUR);
} else if (post.isGfycat()) {
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_GFYCAT);
intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, post.getGfycatId());
} else if (post.isRedgifs()) {
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_REDGIFS);
intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, post.getGfycatId());
intent.putExtra(ViewVideoActivity.EXTRA_REDGIFS_ID, post.getRedgifsId());
} else if (post.isStreamable()) {
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_STREAMABLE);
intent.putExtra(ViewVideoActivity.EXTRA_STREAMABLE_SHORT_CODE, post.getStreamableShortCode());
@ -3546,7 +3532,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
class PostBaseVideoAutoplayViewHolder extends PostBaseViewHolder implements ToroPlayer {
AspectRatioFrameLayout aspectRatioFrameLayout;
GifImageView previewImageView;
ImageView errorLoadingGfycatImageView;
ImageView errorLoadingVideoImageView;
PlayerView videoPlayer;
ImageView muteButton;
ImageView fullscreenButton;
@ -3559,7 +3545,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
ExoPlayerViewHelper helper;
private Uri mediaUri;
private float volume;
public Call<String> fetchGfycatOrStreamableVideoCall;
public Call<String> fetchStreamableVideoCall;
private boolean isManuallyPaused;
PostBaseVideoAutoplayViewHolder(View rootView,
@ -3581,7 +3567,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
CustomTextView awardsTextView,
AspectRatioFrameLayout aspectRatioFrameLayout,
GifImageView previewImageView,
ImageView errorLoadingGfycatImageView,
ImageView errorLoadingVideoImageView,
PlayerView videoPlayer,
ImageView muteButton,
ImageView fullscreenButton,
@ -3625,7 +3611,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
this.aspectRatioFrameLayout = aspectRatioFrameLayout;
this.previewImageView = previewImageView;
this.errorLoadingGfycatImageView = errorLoadingGfycatImageView;
this.errorLoadingVideoImageView = errorLoadingVideoImageView;
this.videoPlayer = videoPlayer;
this.muteButton = muteButton;
this.fullscreenButton = fullscreenButton;
@ -3665,17 +3651,10 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
if (post.isImgur()) {
intent.setData(Uri.parse(post.getVideoUrl()));
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_IMGUR);
} else if (post.isGfycat()) {
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_GFYCAT);
intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, post.getGfycatId());
if (post.isLoadGfycatOrStreamableVideoSuccess()) {
intent.setData(Uri.parse(post.getVideoUrl()));
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_DOWNLOAD_URL, post.getVideoDownloadUrl());
}
} else if (post.isRedgifs()) {
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_REDGIFS);
intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, post.getGfycatId());
if (post.isLoadGfycatOrStreamableVideoSuccess()) {
intent.putExtra(ViewVideoActivity.EXTRA_REDGIFS_ID, post.getRedgifsId());
if (post.isLoadVideoSuccess()) {
intent.setData(Uri.parse(post.getVideoUrl()));
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_DOWNLOAD_URL, post.getVideoDownloadUrl());
}
@ -3876,7 +3855,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
binding.awardsTextViewItemPostVideoTypeAutoplay,
binding.aspectRatioFrameLayoutItemPostVideoTypeAutoplay,
binding.previewImageViewItemPostVideoTypeAutoplay,
binding.errorLoadingGfycatImageViewItemPostVideoTypeAutoplay,
binding.errorLoadingVideoImageViewItemPostVideoTypeAutoplay,
binding.playerViewItemPostVideoTypeAutoplay,
binding.getRoot().findViewById(R.id.mute_exo_playback_control_view),
binding.getRoot().findViewById(R.id.fullscreen_exo_playback_control_view),
@ -3915,7 +3894,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
binding.awardsTextViewItemPostVideoTypeAutoplay,
binding.aspectRatioFrameLayoutItemPostVideoTypeAutoplay,
binding.previewImageViewItemPostVideoTypeAutoplay,
binding.errorLoadingGfycatImageViewItemPostVideoTypeAutoplay,
binding.errorLoadingVideoImageViewItemPostVideoTypeAutoplay,
binding.playerViewItemPostVideoTypeAutoplay,
binding.getRoot().findViewById(R.id.mute_exo_playback_control_view),
binding.getRoot().findViewById(R.id.fullscreen_exo_playback_control_view),
@ -5329,7 +5308,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
class PostCard2BaseVideoAutoplayViewHolder extends PostBaseViewHolder implements ToroPlayer {
AspectRatioFrameLayout aspectRatioFrameLayout;
GifImageView previewImageView;
ImageView errorLoadingGfycatImageView;
ImageView errorLoadingVideoImageView;
PlayerView videoPlayer;
ImageView muteButton;
ImageView fullscreenButton;
@ -5343,7 +5322,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
ExoPlayerViewHelper helper;
private Uri mediaUri;
private float volume;
public Call<String> fetchGfycatOrStreamableVideoCall;
public Call<String> fetchStreamableVideoCall;
private boolean isManuallyPaused;
PostCard2BaseVideoAutoplayViewHolder(View itemView,
@ -5365,7 +5344,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
CustomTextView awardsTextView,
AspectRatioFrameLayout aspectRatioFrameLayout,
GifImageView previewImageView,
ImageView errorLoadingGfycatImageView,
ImageView errorLoadingVideoImageView,
PlayerView videoPlayer,
ImageView muteButton,
ImageView fullscreenButton,
@ -5411,7 +5390,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
this.aspectRatioFrameLayout = aspectRatioFrameLayout;
this.previewImageView = previewImageView;
this.errorLoadingGfycatImageView = errorLoadingGfycatImageView;
this.errorLoadingVideoImageView = errorLoadingVideoImageView;
this.videoPlayer = videoPlayer;
this.muteButton = muteButton;
this.fullscreenButton = fullscreenButton;
@ -5452,17 +5431,10 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
if (post.isImgur()) {
intent.setData(Uri.parse(post.getVideoUrl()));
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_IMGUR);
} else if (post.isGfycat()) {
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_GFYCAT);
intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, post.getGfycatId());
if (post.isLoadGfycatOrStreamableVideoSuccess()) {
intent.setData(Uri.parse(post.getVideoUrl()));
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_DOWNLOAD_URL, post.getVideoDownloadUrl());
}
} else if (post.isRedgifs()) {
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_REDGIFS);
intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, post.getGfycatId());
if (post.isLoadGfycatOrStreamableVideoSuccess()) {
intent.putExtra(ViewVideoActivity.EXTRA_REDGIFS_ID, post.getRedgifsId());
if (post.isLoadVideoSuccess()) {
intent.setData(Uri.parse(post.getVideoUrl()));
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_DOWNLOAD_URL, post.getVideoDownloadUrl());
}
@ -5662,7 +5634,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
binding.awardsTextViewItemPostCard2VideoAutoplay,
binding.aspectRatioFrameLayoutItemPostCard2VideoAutoplay,
binding.previewImageViewItemPostCard2VideoAutoplay,
binding.errorLoadingGfycatImageViewItemPostCard2VideoAutoplay,
binding.errorLoadingVideoImageViewItemPostCard2VideoAutoplay,
binding.playerViewItemPostCard2VideoAutoplay,
binding.getRoot().findViewById(R.id.mute_exo_playback_control_view),
binding.getRoot().findViewById(R.id.fullscreen_exo_playback_control_view),
@ -5702,7 +5674,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
binding.awardsTextViewItemPostCard2VideoAutoplay,
binding.aspectRatioFrameLayoutItemPostCard2VideoAutoplay,
binding.previewImageViewItemPostCard2VideoAutoplay,
binding.errorLoadingGfycatImageViewItemPostCard2VideoAutoplay,
binding.errorLoadingVideoImageViewItemPostCard2VideoAutoplay,
binding.playerViewItemPostCard2VideoAutoplay,
binding.getRoot().findViewById(R.id.mute_exo_playback_control_view),
binding.getRoot().findViewById(R.id.fullscreen_exo_playback_control_view),
@ -6397,7 +6369,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
class PostMaterial3CardBaseVideoAutoplayViewHolder extends PostMaterial3CardBaseViewHolder implements ToroPlayer {
AspectRatioFrameLayout aspectRatioFrameLayout;
GifImageView previewImageView;
ImageView errorLoadingGfycatImageView;
ImageView errorLoadingVideoImageView;
PlayerView videoPlayer;
ImageView muteButton;
ImageView fullscreenButton;
@ -6410,7 +6382,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
ExoPlayerViewHelper helper;
private Uri mediaUri;
private float volume;
public Call<String> fetchGfycatOrStreamableVideoCall;
public Call<String> fetchStreamableVideoCall;
private boolean isManuallyPaused;
PostMaterial3CardBaseVideoAutoplayViewHolder(View rootView,
@ -6422,7 +6394,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
TextView titleTextView,
AspectRatioFrameLayout aspectRatioFrameLayout,
GifImageView previewImageView,
ImageView errorLoadingGfycatImageView,
ImageView errorLoadingVideoImageView,
PlayerView videoPlayer,
ImageView muteButton,
ImageView fullscreenButton,
@ -6457,7 +6429,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
this.aspectRatioFrameLayout = aspectRatioFrameLayout;
this.previewImageView = previewImageView;
this.errorLoadingGfycatImageView = errorLoadingGfycatImageView;
this.errorLoadingVideoImageView = errorLoadingVideoImageView;
this.videoPlayer = videoPlayer;
this.muteButton = muteButton;
this.fullscreenButton = fullscreenButton;
@ -6497,17 +6469,10 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
if (post.isImgur()) {
intent.setData(Uri.parse(post.getVideoUrl()));
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_IMGUR);
} else if (post.isGfycat()) {
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_GFYCAT);
intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, post.getGfycatId());
if (post.isLoadGfycatOrStreamableVideoSuccess()) {
intent.setData(Uri.parse(post.getVideoUrl()));
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_DOWNLOAD_URL, post.getVideoDownloadUrl());
}
} else if (post.isRedgifs()) {
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_TYPE, ViewVideoActivity.VIDEO_TYPE_REDGIFS);
intent.putExtra(ViewVideoActivity.EXTRA_GFYCAT_ID, post.getGfycatId());
if (post.isLoadGfycatOrStreamableVideoSuccess()) {
intent.putExtra(ViewVideoActivity.EXTRA_REDGIFS_ID, post.getRedgifsId());
if (post.isLoadVideoSuccess()) {
intent.setData(Uri.parse(post.getVideoUrl()));
intent.putExtra(ViewVideoActivity.EXTRA_VIDEO_DOWNLOAD_URL, post.getVideoDownloadUrl());
}
@ -6698,7 +6663,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
binding.titleTextViewItemPostCard3VideoTypeAutoplay,
binding.aspectRatioFrameLayoutItemPostCard3VideoTypeAutoplay,
binding.previewImageViewItemPostCard3VideoTypeAutoplay,
binding.errorLoadingGfycatImageViewItemPostCard3VideoTypeAutoplay,
binding.errorLoadingVideoImageViewItemPostCard3VideoTypeAutoplay,
binding.playerViewItemPostCard3VideoTypeAutoplay,
binding.getRoot().findViewById(R.id.mute_exo_playback_control_view),
binding.getRoot().findViewById(R.id.fullscreen_exo_playback_control_view),
@ -6726,7 +6691,7 @@ public class PostRecyclerViewAdapter extends PagingDataAdapter<Post, RecyclerVie
binding.titleTextViewItemPostCard3VideoTypeAutoplay,
binding.aspectRatioFrameLayoutItemPostCard3VideoTypeAutoplay,
binding.previewImageViewItemPostCard3VideoTypeAutoplay,
binding.errorLoadingGfycatImageViewItemPostCard3VideoTypeAutoplay,
binding.errorLoadingVideoImageViewItemPostCard3VideoTypeAutoplay,
binding.playerViewItemPostCard3VideoTypeAutoplay,
binding.getRoot().findViewById(R.id.mute_exo_playback_control_view),
binding.getRoot().findViewById(R.id.fullscreen_exo_playback_control_view),

View File

@ -1,10 +0,0 @@
package eu.toldi.infinityforlemmy.apis;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Path;
public interface GfycatAPI {
@GET("{gfyid}")
Call<String> getGfycatData(@Path("gfyid") String gfyId);
}

View File

@ -187,9 +187,6 @@ public class PostFragment extends Fragment implements FragmentCommunicator {
@Named("oauth")
Retrofit mOauthRetrofit;
@Inject
@Named("gfycat")
Retrofit mGfycatRetrofit;
@Inject
@Named("redgifs")
Retrofit mRedgifsRetrofit;
@Inject
@ -468,7 +465,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator {
sortType = new SortType(st == null ? SortType.Type.TOP_ALL : st,sortTime != null ? SortType.Time.valueOf(sortTime) : null);
postLayout = mPostLayoutSharedPreferences.getInt(SharedPreferencesUtils.POST_LAYOUT_SEARCH_POST, defaultPostLayout);
mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mRetrofit, mGfycatRetrofit,
mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mRetrofit,
mRedgifsRetrofit, mStreamableApiProvider, mCustomThemeWrapper, locale,
accessToken, accountName, postType, postLayout, true,
mSharedPreferences, mCurrentAccountSharedPreferences, mNsfwAndSpoilerSharedPreferences, mPostHistorySharedPreferences,
@ -543,7 +540,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator {
postLayout = mPostLayoutSharedPreferences.getInt(SharedPreferencesUtils.POST_LAYOUT_SUBREDDIT_POST_BASE + subredditName, defaultPostLayout);
mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mRetrofit, mGfycatRetrofit,
mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mRetrofit,
mRedgifsRetrofit, mStreamableApiProvider, mCustomThemeWrapper, locale,
accessToken, accountName, postType, postLayout, displaySubredditName,
mSharedPreferences, mCurrentAccountSharedPreferences, mNsfwAndSpoilerSharedPreferences, mPostHistorySharedPreferences,
@ -612,7 +609,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator {
defaultPostLayout);
mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mRetrofit, mGfycatRetrofit,
mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mRetrofit,
mRedgifsRetrofit, mStreamableApiProvider, mCustomThemeWrapper, locale,
accessToken, accountName, postType, postLayout, true,
mSharedPreferences, mCurrentAccountSharedPreferences, mNsfwAndSpoilerSharedPreferences, mPostHistorySharedPreferences,
@ -678,7 +675,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, mRetrofit, mGfycatRetrofit,
mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mRetrofit,
mRedgifsRetrofit, mStreamableApiProvider, mCustomThemeWrapper, locale,
accessToken, accountName, postType, postLayout, true,
mSharedPreferences, mCurrentAccountSharedPreferences, mNsfwAndSpoilerSharedPreferences, mPostHistorySharedPreferences,
@ -740,7 +737,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator {
postLayout = mPostLayoutSharedPreferences.getInt(SharedPreferencesUtils.POST_LAYOUT_FRONT_PAGE_POST, defaultPostLayout);
mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mRetrofit, mGfycatRetrofit,
mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mRetrofit,
mRedgifsRetrofit, mStreamableApiProvider, mCustomThemeWrapper, locale,
accessToken, accountName, postType, postLayout, true,
mSharedPreferences, mCurrentAccountSharedPreferences, mNsfwAndSpoilerSharedPreferences, mPostHistorySharedPreferences,
@ -799,7 +796,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, mRetrofit, mGfycatRetrofit,
mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mRetrofit,
mRedgifsRetrofit, mStreamableApiProvider, mCustomThemeWrapper, locale,
accessToken, accountName, postType, postLayout, true,
mSharedPreferences, mCurrentAccountSharedPreferences, mNsfwAndSpoilerSharedPreferences, mPostHistorySharedPreferences,
@ -855,7 +852,7 @@ public class PostFragment extends Fragment implements FragmentCommunicator {
sortType = newSortType(sort, sortTime);
postLayout = mPostLayoutSharedPreferences.getInt(SharedPreferencesUtils.POST_LAYOUT_FRONT_PAGE_POST, defaultPostLayout);
mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mRetrofit, mGfycatRetrofit,
mAdapter = new PostRecyclerViewAdapter(activity, this, mExecutor, mRetrofit,
mRedgifsRetrofit, mStreamableApiProvider, mCustomThemeWrapper, locale,
accessToken, accountName, postType, postLayout, true,
mSharedPreferences, mCurrentAccountSharedPreferences, mNsfwAndSpoilerSharedPreferences, mPostHistorySharedPreferences,

View File

@ -167,9 +167,6 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
@Named("reveddit")
Retrofit revedditRetrofit;
@Inject
@Named("gfycat")
Retrofit mGfycatRetrofit;
@Inject
@Named("redgifs")
Retrofit mRedgifsRetrofit;
@Inject
@ -624,7 +621,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
setupMenu();
mPostAdapter = new PostDetailRecyclerViewAdapter(activity,
this, mExecutor, mCustomThemeWrapper, mRetrofit, mGfycatRetrofit,
this, mExecutor, mCustomThemeWrapper, mRetrofit,
mRedgifsRetrofit, mStreamableApiProvider, mRedditDataRoomDatabase, mGlide,
mSeparatePostAndComments, mAccessToken, mAccountName, mPost, mLocale,
mSharedPreferences, mCurrentAccountSharedPreferences, mNsfwAndSpoilerSharedPreferences, mPostDetailsSharedPreferences,
@ -1361,7 +1358,7 @@ public class ViewPostDetailFragment extends Fragment implements FragmentCommunic
mPost = post;
mPostAdapter = new PostDetailRecyclerViewAdapter(activity,
ViewPostDetailFragment.this, mExecutor, mCustomThemeWrapper,
mRetrofit, mGfycatRetrofit, mRedgifsRetrofit,
mRetrofit, mRedgifsRetrofit,
mStreamableApiProvider, mRedditDataRoomDatabase, mGlide, mSeparatePostAndComments,
mAccessToken, mAccountName, mPost, mLocale, mSharedPreferences,
mCurrentAccountSharedPreferences, mNsfwAndSpoilerSharedPreferences,

View File

@ -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);
}

View File

@ -267,18 +267,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);
@ -406,18 +400,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);
@ -467,18 +455,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);
@ -495,22 +477,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);
@ -593,18 +567,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);

View File

@ -45,13 +45,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 loadVideoSuccess;
private String permalink;
private long postTimeMillis;
@ -152,13 +151,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;
loadVideoSuccess = in.readByte() != 0;
permalink = in.readString();
downvotes = in.readInt();
upvotes = in.readInt();
@ -303,12 +301,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() {
@ -327,14 +325,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;
}
@ -351,12 +341,12 @@ public class Post implements Parcelable {
this.isStreamable = isStreamable;
}
public boolean isLoadGfycatOrStreamableVideoSuccess() {
return loadGfyOrStreamableVideoSuccess;
public boolean isLoadVideoSuccess() {
return loadVideoSuccess;
}
public void setLoadGfyOrStreamableVideoSuccess(boolean loadGfyOrStreamableVideoSuccess) {
this.loadGfyOrStreamableVideoSuccess = loadGfyOrStreamableVideoSuccess;
public void setLoadVideoSuccess(boolean loadVideoSuccess) {
this.loadVideoSuccess = loadVideoSuccess;
}
public String getPermalink() {
@ -525,13 +515,12 @@ public class Post implements Parcelable {
parcel.writeString(url);
parcel.writeString(videoUrl);
parcel.writeString(videoDownloadUrl);
parcel.writeString(gfycatId);
parcel.writeString(redgifsId);
parcel.writeString(streamableShortCode);
parcel.writeByte((byte) (isImgur ? 1 : 0));
parcel.writeByte((byte) (isGfycat ? 1 : 0));
parcel.writeByte((byte) (isRedgifs ? 1 : 0));
parcel.writeByte((byte) (isStreamable ? 1 : 0));
parcel.writeByte((byte) (loadGfyOrStreamableVideoSuccess ? 1 : 0));
parcel.writeByte((byte) (loadVideoSuccess ? 1 : 0));
parcel.writeString(permalink);
parcel.writeInt(downvotes);
parcel.writeInt(upvotes);

View File

@ -19,7 +19,6 @@ public class APIUtils {
public static final String API_BASE_URI = "https://lemmy.world";
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/";

View File

@ -111,7 +111,6 @@ public class JSONUtils {
public static final String PATH_KEY = "path";
public static final String ALL_AWARDINGS_KEY = "all_awardings";
public static final String RESIZED_ICONS_KEY = "resized_icons";
public static final String GFY_ITEM_KEY = "gfyItem";
public static final String MP4_URL_KEY = "mp4Url";
public static final String TYPE_KEY = "type";
public static final String MP4_KEY = "mp4";

View File

@ -122,7 +122,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";

View File

@ -12,7 +12,7 @@ import java.io.IOException
class RedGifsPostEnricher(private val redgifsAPI: RedgifsAPI) : PostEnricher {
override fun enrich(posts: Collection<Post>) {
val redGifsPosts = posts.filter { it.isRedgifs && it.previews.isEmpty() }
.groupBy { it.gfycatId }
.groupBy { it.redgifsId }
if (redGifsPosts.isEmpty()) {
return

View File

@ -42,7 +42,7 @@
android:visibility="gone" />
<ImageView
android:id="@+id/error_loading_gfycat_image_view_item_post_card_2_video_autoplay"
android:id="@+id/error_loading_video_image_view_item_post_card_2_video_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
@ -367,4 +367,4 @@
android:layout_height="1dp"
android:paddingBottom="8dp" />
</LinearLayout>
</LinearLayout>

View File

@ -42,7 +42,7 @@
android:visibility="gone" />
<ImageView
android:id="@+id/error_loading_gfycat_image_view_item_post_card_2_video_autoplay"
android:id="@+id/error_loading_video_image_view_item_post_card_2_video_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
@ -366,4 +366,4 @@
android:layout_height="1dp"
android:paddingBottom="8dp" />
</LinearLayout>
</LinearLayout>

View File

@ -40,7 +40,7 @@
android:visibility="gone" />
<ImageView
android:id="@+id/error_loading_gfycat_image_view_item_post_card_3_video_type_autoplay"
android:id="@+id/error_loading_video_image_view_item_post_card_3_video_type_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
@ -262,4 +262,4 @@
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
</com.google.android.material.card.MaterialCardView>

View File

@ -40,7 +40,7 @@
android:visibility="gone" />
<ImageView
android:id="@+id/error_loading_gfycat_image_view_item_post_card_3_video_type_autoplay"
android:id="@+id/error_loading_video_image_view_item_post_card_3_video_type_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
@ -262,4 +262,4 @@
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
</com.google.android.material.card.MaterialCardView>

View File

@ -244,7 +244,7 @@
android:visibility="gone" />
<ImageView
android:id="@+id/error_loading_gfycat_image_view_item_post_detail_video_autoplay"
android:id="@+id/error_loading_video_image_view_item_post_detail_video_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
@ -376,4 +376,4 @@
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</LinearLayout>

View File

@ -247,7 +247,7 @@
android:visibility="gone" />
<ImageView
android:id="@+id/error_loading_gfycat_image_view_item_post_detail_video_autoplay"
android:id="@+id/error_loading_video_image_view_item_post_detail_video_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
@ -379,4 +379,4 @@
</androidx.constraintlayout.widget.ConstraintLayout>
</LinearLayout>
</LinearLayout>

View File

@ -254,7 +254,7 @@
android:visibility="gone" />
<ImageView
android:id="@+id/error_loading_gfycat_image_view_item_post_video_type_autoplay"
android:id="@+id/error_loading_video_image_view_item_post_video_type_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
@ -378,4 +378,4 @@
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
</com.google.android.material.card.MaterialCardView>

View File

@ -254,7 +254,7 @@
android:visibility="gone" />
<ImageView
android:id="@+id/error_loading_gfycat_image_view_item_post_video_type_autoplay"
android:id="@+id/error_loading_video_image_view_item_post_video_type_autoplay"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="16dp"
@ -378,4 +378,4 @@
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
</com.google.android.material.card.MaterialCardView>

View File

@ -314,7 +314,6 @@
<string name="settings_volume_keys_navigate_posts_title">Použít tlačítka hlasitosti pro navigaci v příspěvcích</string>
<string name="settings_mute_video_title">Ztlumit videa</string>
<string name="settings_mute_nsfw_video_title">Ztlumit NSFW videa</string>
<string name="settings_automatically_try_redgifs_title">Automatický pokus o přístup k Redgifs, pokud jsou videa na Gfycat odstraněna.</string>
<string name="settings_video_player_ignore_nav_bar_title">Ignorovat navigační lištu v přehrávači videí</string>
<string name="settings_video_player_ignore_nav_bar_summary">Zabránit ovládání videa mít dodatečný okraj</string>
<string name="settings_confirm_to_exit">Potvrdit pro odchod</string>
@ -717,7 +716,6 @@
<string name="notifications">Oznámení</string>
<string name="messages">Zprávy</string>
<string name="message">Zpráva</string>
<string name="fetch_gfycat_video_failed">Získávání Gfycat videa selhalo</string>
<string name="fetch_redgifs_video_failed">Získávání Redgifs videa selhalo</string>
<string name="fetching_video_info_please_wait">Získávání informací o videu. Čekejte prosím.</string>
<string name="error_fetching_imgur_media">Nelze načíst obrázky</string>
@ -738,7 +736,6 @@
<string name="set_to_lock_screen">Nastavit na zamykací obrazovku</string>
<string name="set_to_both">Nastavit na oboje</string>
<string name="default_font_font_preview">Výchozí</string>
<string name="load_video_in_redgifs">Zkusit načíst video na Redgifs</string>
<string name="top_score">%1$s bodů</string>
<string name="login_activity_2fa_prompt">Pokud máte zapnuté dvoufaktorové ověřování, vyplňte pole tokenu 2FA. V opačném případě jej ponechte prázdné</string>
<string name="submit_crosspost_activity_label">Crosspost</string>

View File

@ -324,7 +324,6 @@
<string name="settings_mute_video_title">Videos stummschalten</string>
<string name="settings_mute_nsfw_video_title">NSFW-Videos stummschalten</string>
<!-- Fuzzy -->
<string name="settings_automatically_try_redgifs_title">Automatisch versuchen, Redgifs abzurufen, falls Videos auf Gfycat entfernt wurden.</string>
<string name="settings_video_player_ignore_nav_bar_title">Navigationsleiste im Video-Player ignorieren</string>
<string name="settings_video_player_ignore_nav_bar_summary">Kein extra Rand beim Video-Controller</string>
<string name="settings_confirm_to_exit">Verlassen bestätigen</string>
@ -744,7 +743,6 @@
<string name="notifications">Benachrichtigungen</string>
<string name="messages">Nachrichten</string>
<string name="message">Nachricht</string>
<string name="fetch_gfycat_video_failed">Abruf des Gfycat-Videos fehlgeschlagen</string>
<string name="fetch_redgifs_video_failed">Abruf des Redgifs-Videos fehlgeschlagen</string>
<string name="fetching_video_info_please_wait">Lade Video-Info. Bitte warten.</string>
<string name="error_fetching_imgur_media">Kann Bilder nicht laden</string>
@ -768,7 +766,6 @@
<string name="set_to_lock_screen">Auf dem Sperrbildschirm setzen</string>
<string name="set_to_both">Auf beiden setzen</string>
<string name="default_font_font_preview">Standard</string>
<string name="load_video_in_redgifs">Versuche Video von Redgifs zu laden</string>
<string name="top_score">%1$s Punkte</string>
<string name="login_activity_2fa_prompt">Sofern du Zwei-Faktor-Authentifizierung aktiviert hast, trage den Code im 2FA-Feld ein. Ansonsten leer lassen</string>
<string name="submit_crosspost_activity_label">Crossposten</string>

View File

@ -294,7 +294,6 @@
<string name="settings_volume_keys_navigate_posts_title">"Περιήγηση στις αναρτήσεις με τα κουμπιά έντασης"</string>
<string name="settings_mute_video_title">"Σίγαση βίντεο"</string>
<string name="settings_mute_nsfw_video_title">"Σίγαση NSFW βίντεο"</string>
<string name="settings_automatically_try_redgifs_title">"Αύτοματη προσπάθεια προσπέλασης στο Redgifs αν τα Βίντεο στο Gfycat έχουν αφαιρεθεί."</string>
<string name="settings_video_player_ignore_nav_bar_title">"Αγνόηση Μπάρας Πλοήγησης κατά την Αναπαραγωγή Βίντεο"</string>
<string name="settings_video_player_ignore_nav_bar_summary">"Αποτρέπει τα Χειριστήρια του Βίντεο να έχουν έξτρα περιθώριο"</string>
<string name="settings_confirm_to_exit">"Επιβεβαίωση για Έξοδο"</string>
@ -686,7 +685,6 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd
<string name="notifications">"Ειδοποιήσεις"</string>
<string name="messages">"Μηνύματα"</string>
<string name="message">"Μήνυμα"</string>
<string name="fetch_gfycat_video_failed">"Η ανάκτηση του βίντεο Gfycat απέτυχε"</string>
<string name="fetch_redgifs_video_failed">"Η ανάκτηση του βίντεο Redgifs απέτυχε"</string>
<string name="fetching_video_info_please_wait">"Ανάκτηση πληροφοριών βίντεο. Παρακαλώ περιμένετε."</string>
<string name="error_fetching_imgur_media">"Αδυναμία φόρτωσης εικόνων"</string>
@ -707,7 +705,6 @@ https://play.google.com/store/apps/details?id=ml.docilealligator.infinityforredd
<string name="set_to_lock_screen">"Ρύθμιση στην Οθόνη Κλειδώματος"</string>
<string name="set_to_both">"Ρύθμιση και στα δύο"</string>
<string name="default_font_font_preview">"Προεπιλογή"</string>
<string name="load_video_in_redgifs">"Προσπάθεια φόρτωσης βίντεο στο Redgifs"</string>
<string name="top_score">"%1$s βθμ"</string>
<string name="login_activity_2fa_prompt">"Αν έχετε ενεργή την ταυτοποίηση 2 παραγόντων, παρακαλώ πληκτρολογήστε τον κωδικό με τον παρακάτω τρόπο: &lt;κωδικός&gt;:&lt;2FA κωδικός&gt;.
Παράδειγμα: οκωδικοςσας:123456"</string>

View File

@ -323,7 +323,6 @@ Premio means prize, so it's better suited the first word instead of the second o
<string name="settings_volume_keys_navigate_posts_title">Usar las teclas de volumen para navegar publicaciones</string>
<string name="settings_mute_video_title">Silenciar vídeos</string>
<string name="settings_mute_nsfw_video_title">Silenciar vídeos NSFW</string>
<string name="settings_automatically_try_redgifs_title">Intentar acceder automáticamente a Redgifs si se eliminan los videos en Gfycat.</string>
<string name="settings_video_player_ignore_nav_bar_title">Ignorar la barra de navegación en el reproductor de vídeo</string>
<string name="settings_video_player_ignore_nav_bar_summary">Bloquear al controlador de vídeo para que no tenga margen extra</string>
<string name="settings_confirm_to_exit">Confirmar para salir</string>
@ -737,7 +736,6 @@ Premio means prize, so it's better suited the first word instead of the second o
<string name="notifications">Notificaciones</string>
<string name="messages">Mensajes</string>
<string name="message">Mensaje</string>
<string name="fetch_gfycat_video_failed">No fue posible obtener el vídeo de Gfycat</string>
<string name="fetch_redgifs_video_failed">No fue posible obtener el vídeo de Redgifs</string>
<string name="fetching_video_info_please_wait">Obteniendo información del vídeo. Por favor espera.</string>
<string name="error_fetching_imgur_media">No fue posible cargar las imágenes</string>
@ -758,7 +756,6 @@ Premio means prize, so it's better suited the first word instead of the second o
<string name="set_to_lock_screen">Establecer como pantalla de bloqueo</string>
<string name="set_to_both">Establecer ambos</string>
<string name="default_font_font_preview">Por defecto</string>
<string name="load_video_in_redgifs">Intentar cargando el vídeo en Redgifs</string>
<string name="top_score">%1$s puntos</string>
<string name="login_activity_2fa_prompt">Si tiene habilitada la autenticación de 2 factores, por favor escriba su contraseña como la siguiente: &lt;contraseña&gt;:&lt;código 2FA&gt;</string>
<string name="submit_crosspost_activity_label">Crosspost</string>

View File

@ -213,7 +213,6 @@
<string name="theme_preview_activity_label">Teeman esikatselu</string>
<string name="no_theme_name">Mikä on tämän teeman nimi\?</string>
<string name="copy_all_raw_text">Kopioi kaikki raakatekstinä</string>
<string name="load_video_in_redgifs">Yritä ladata video Redgifsistä</string>
<string name="invalid_response">Virheellinen vastaus palvelimelta</string>
<string name="action_share_link">Jaa linkki</string>
<string name="yes">Kyllä</string>
@ -384,7 +383,6 @@
\nNapauta yrittääksesi uudelleen.</string>
<string name="custom_theme_listing_activity_label">Mukautetut teemat</string>
<string name="action_change_post_layout">Muuta viestien asettelua</string>
<string name="settings_automatically_try_redgifs_title">Yritä automaattisesti videoita Redgifsistä jos video Gfycatista on poistettu.</string>
<string name="sort_time_6hours">6 tuntia</string>
<string name="app_lock_timeout_1_hour">1 tunti</string>
<string name="settings_swipe_action_title">Pyyhkäisyn toiminto</string>

View File

@ -343,7 +343,6 @@
<string name="settings_mute_video_title">Couper le son des vidéos</string>
<string name="settings_mute_nsfw_video_title">Couper le son des Vidéos NSFW</string>
<!-- Fuzzy -->
<string name="settings_automatically_try_redgifs_title">Essayez d\'accéder automatiquement à redgif si les vidéos sur gfycat sont supprimées.</string>
<string name="settings_video_player_ignore_nav_bar_title">Ignorer la barre de navigation dans le lecteur vidéo</string>
<string name="settings_video_player_ignore_nav_bar_summary">Empêcher le contrôleur vidéo de créer une marge supplémentaire</string>
<string name="settings_confirm_to_exit">Confirmer pour quitter</string>
@ -768,7 +767,6 @@ https://s3.eu-west-1.amazonaws.com/po-pub/i/dFZKKms9HbrDGOlcgW9QTcwF.jpg -->
<string name="notifications">Notifications</string>
<string name="messages">Messages</string>
<string name="message">Message</string>
<string name="fetch_gfycat_video_failed">Échec de la récupération de la vidéo Gfycat</string>
<string name="fetch_redgifs_video_failed">Échec de la récupération de la vidéo Redgifs</string>
<string name="fetching_video_info_please_wait">Récupération des informations vidéo. Veuillez patienter.</string>
<string name="error_fetching_imgur_media">Impossible de charger les images</string>
@ -790,7 +788,6 @@ https://s3.eu-west-1.amazonaws.com/po-pub/i/dFZKKms9HbrDGOlcgW9QTcwF.jpg -->
<string name="set_to_lock_screen">Ajouter à l\'écran de verrouillage</string>
<string name="set_to_both">Définir pour les deux</string>
<string name="default_font_font_preview">Par défaut</string>
<string name="load_video_in_redgifs">Essayez de charger la vidéo sur Redgifs</string>
<string name="top_score">%1$s points</string>
<string name="login_activity_2fa_prompt">Si lauthentification à 2 facteurs est activée, vous devez remplir le champ du jeton 2FA. Sinon, laissez le vide.</string>
<string name="submit_crosspost_activity_label">Republier</string>

View File

@ -333,7 +333,6 @@ Behavior -->
<!-- Are those commands or a state? Like 'search' is a state in 'search opration' but is a command in 'search something'. Hindi has different appraoch for these two. -->
<string name="settings_mute_nsfw_video_title">मौन NSFW वीडियोज</string>
<!-- Fuzzy -->
<string name="settings_automatically_try_redgifs_title">स्वतः ही Redgifs खोलने का प्रयास यदि Gfycat पर वीडियोज हटा दी गयी हों।</string>
<string name="settings_video_player_ignore_nav_bar_title">वीडियो प्लेयर में नेवीगेशन बार का छिपना</string>
<string name="settings_video_player_ignore_nav_bar_summary">वीडियो कंट्रोलर द्वारा अतिरिक्त हाशिया लेने पर रोक</string>
<string name="settings_confirm_to_exit">एप छोड़ने की पुष्टि</string>
@ -748,7 +747,6 @@ Behavior -->
<string name="notifications">अधिसूचनाएं</string>
<string name="messages">संदेश</string>
<string name="message">संदेश</string>
<string name="fetch_gfycat_video_failed">Gfycat वीडियो प्राप्ति सफल</string>
<string name="fetch_redgifs_video_failed">Redgifs वीडियो प्राप्ति असफल</string>
<string name="fetching_video_info_please_wait">वीडियो इनफो प्राप्त हो रहा है। कृपया प्रतीक्षा करें।</string>
<string name="error_fetching_imgur_media">चित्र लोड नहीं हो सका</string>
@ -770,7 +768,6 @@ Behavior -->
<string name="set_to_lock_screen">लक स्क्रीन पे सेट करे</string>
<string name="set_to_both">दोनो पे ही सेट करे</string>
<string name="default_font_font_preview">पूर्वनिर्धारित</string>
<string name="load_video_in_redgifs">वीडियो रेडगिफ्स पर लोड करने कि कोशिश करे</string>
<string name="top_score">%1$s अंक</string>
<string name="login_activity_2fa_prompt">अगार आपका 2-कदाम प्रमाणीकरण चालू है, तो कृपिया आपना पासबर्ड(चाबी) निम्ना लिखित तरीके से दिजीये: &lt;पासबर्ड&gt;:&lt;2FA code&gt;</string>
<string name="submit_crosspost_activity_label">क्रॉसपोस्ट</string>

View File

@ -326,7 +326,6 @@
<string name="settings_mute_video_title">Isključi ton na videozapisima</string>
<string name="settings_mute_nsfw_video_title">Isključi ton na NSFW videozapisima</string>
<!-- Fuzzy -->
<string name="settings_automatically_try_redgifs_title">Automatski pokušaj pristupiti Redgifs ako su videozapisi na Gfycatu uklonjeni.</string>
<string name="settings_video_player_ignore_nav_bar_title">Ignoriraj navigacijsku traku u video playeru</string>
<string name="settings_video_player_ignore_nav_bar_summary">Onemogući dodatnu marginu na video kontroleru</string>
<string name="settings_confirm_to_exit">Potvrdi izlaz</string>
@ -739,7 +738,6 @@
<string name="notifications">Obavijesti</string>
<string name="messages">Poruke</string>
<string name="message">Poruka</string>
<string name="fetch_gfycat_video_failed">Dohvaćanje Gfycat videozapisa nije uspjelo</string>
<string name="fetch_redgifs_video_failed">Dohvaćanje Redgifs videozapisa nije uspjelo</string>
<string name="fetching_video_info_please_wait">Dohvaćanje informacija o videozapisu. Molim pričekajte.</string>
<string name="error_fetching_imgur_media">Nije moguće učitati slike</string>
@ -761,7 +759,6 @@
<string name="set_to_lock_screen">Postavi na Zaključni zaslon</string>
<string name="set_to_both">Postavi na oboje</string>
<string name="default_font_font_preview">Zadano</string>
<string name="load_video_in_redgifs">Pokušajte učitati video na Redgifs</string>
<string name="top_score">%1$s boda/ova</string>
<string name="login_activity_2fa_prompt">Ukoliko imate omogućenu 2-faktorsku autentikaciju, upišite zaporku na sljedeći način:&lt;zaporka&gt;:&lt;2FA kod&gt;. Primjer: vašazaporka:123456</string>
<string name="submit_crosspost_activity_label">Crosspost</string>

View File

@ -309,7 +309,6 @@
<string name="settings_mute_video_title">Videók némítása</string>
<string name="settings_mute_nsfw_video_title">NSFW videók némítása</string>
<!-- Fuzzy -->
<string name="settings_automatically_try_redgifs_title">Próbálja autómatikusan elérni a Redgifeket, ha a videók Gfycat-en el vannak távolítva.</string>
<string name="settings_video_player_ignore_nav_bar_title">Navigációs sáv ignorálása videó lejátszóban</string>
<string name="settings_video_player_ignore_nav_bar_summary">Annak megelőzése, hogy a videó kontrollernek extra szegélye legyen</string>
<string name="settings_confirm_to_exit">Kilépés megerősítése</string>
@ -717,7 +716,6 @@
<string name="notifications">Értesítések</string>
<string name="messages">Üzenetek</string>
<string name="message">Üzenet</string>
<string name="fetch_gfycat_video_failed">Gfycat videó megszerzése nem sikerült</string>
<string name="fetch_redgifs_video_failed">Redgifs videó megszerzése nem sikerült</string>
<string name="fetching_video_info_please_wait">Videó infó megszerzése. Kérlek várj.</string>
<string name="error_fetching_imgur_media">Nem lehet betölteni a képeket</string>
@ -738,7 +736,6 @@
<string name="set_to_lock_screen">Beállítva zárolt képernyőre</string>
<string name="set_to_both">Beállítva mindettőre</string>
<string name="default_font_font_preview">Alapértelmezett</string>
<string name="load_video_in_redgifs">Próbáld meg betölteni a videót Redgifs-en</string>
<string name="top_score">%1$s pont</string>
<string name="login_activity_2fa_prompt">Ha a két faktoros azonosítás be van kapcsolva, kérlek írd be a jelszavad így: &lt;jelszó&gt;:&lt;2FA kód&gt;. Például: jelszavad:123456</string>
<string name="submit_crosspost_activity_label">Crossposzt</string>

View File

@ -308,7 +308,6 @@
<string name="settings_volume_keys_navigate_posts_title">Usa i Tasti del Volume per Navigare i Post</string>
<string name="settings_mute_video_title">Muta i video</string>
<string name="settings_mute_nsfw_video_title">Metti in muto i video NSFW</string>
<string name="settings_automatically_try_redgifs_title">Prova automaticamente ad accedere a Redgifs se i video su Gfycat vengono rimossi.</string>
<string name="settings_video_player_ignore_nav_bar_title">Ignora la Barra di Navigazione nel Lettore Video</string>
<string name="settings_video_player_ignore_nav_bar_summary">Impedisci ai controlli video di avere margine aggiuntivo</string>
<string name="settings_confirm_to_exit">Conferma per uscire</string>
@ -707,7 +706,6 @@
<string name="notifications">Notifiche</string>
<string name="messages">Messaggi</string>
<string name="message">Messaggio</string>
<string name="fetch_gfycat_video_failed">Impossibile recuperare il video da Gfycat</string>
<string name="fetch_redgifs_video_failed">Impossibile recuperare il video da Redgifs</string>
<string name="fetching_video_info_please_wait">Recupero delle informazioni sul video. Attendere prego.</string>
<string name="error_fetching_imgur_media">Impossibile caricare immagini</string>
@ -728,7 +726,6 @@
<string name="set_to_lock_screen">Imposta sulla schermata di blocco</string>
<string name="set_to_both">Imposta su Entrambi</string>
<string name="default_font_font_preview">Predefinito</string>
<string name="load_video_in_redgifs">Prova a caricare il video su Redgifs</string>
<string name="top_score">%1$s pts</string>
<string name="login_activity_2fa_prompt">Se hai attivato l\'autenticazione a due fattori, per favore inserisci la password come segue: &lt;password&gt;:&lt;codice per l\'autenticazione a due fattori&gt;.
\nEsempio: latuapassword:123456</string>

View File

@ -337,7 +337,6 @@
<string name="settings_mute_video_title">動画をミュート再生</string>
<string name="settings_mute_nsfw_video_title">NSFWの動画をミュート再生</string>
<!-- Fuzzy -->
<string name="settings_automatically_try_redgifs_title">Gfycatの動画が削除されていた場合、自動的にRedgifsでリトライ</string>
<string name="settings_video_player_ignore_nav_bar_title">動画プレーヤーでナビゲーションバーを無視</string>
<string name="settings_video_player_ignore_nav_bar_summary">動画コントローラーが余分な余白を使用することを防止します</string>
<string name="settings_confirm_to_exit">アプリの終了確認を表示</string>
@ -758,7 +757,6 @@
<string name="notifications">通知</string>
<string name="messages">メッセージ</string>
<string name="message">メッセージ</string>
<string name="fetch_gfycat_video_failed">Gfycat動画を取得できませんでした</string>
<string name="fetch_redgifs_video_failed">Redgifs動画を取得できませんでした</string>
<string name="fetching_video_info_please_wait">動画の情報を取得中です。少々お待ちください。</string>
<string name="error_fetching_imgur_media">画像をロードできませんでした</string>
@ -782,7 +780,6 @@
<string name="set_to_lock_screen">ロック画面に設定</string>
<string name="set_to_both">両方に設定</string>
<string name="default_font_font_preview">Default</string>
<string name="load_video_in_redgifs">Redgifsから動画のロードを試行</string>
<string name="top_score">%1$s点</string>
<string name="login_activity_2fa_prompt">2段階認証を有効にしている場合、パスワードは次のように入力してください 「&lt;パスワード&gt;:&lt;2段階認証コード&gt;</string>
<string name="submit_crosspost_activity_label">クロスポスト</string>

View File

@ -324,7 +324,6 @@
<string name="settings_volume_keys_navigate_posts_title">"볼륨 키로 포스트 스크롤하기"</string>
<string name="settings_mute_video_title">"둥영상 음소거"</string>
<string name="settings_mute_nsfw_video_title">"NSFW 둥영상 음소거"</string>
<string name="settings_automatically_try_redgifs_title">"Gfycat 비디오가 제거되었을 시 자동으로 Redgifs 접근 시도하기"</string>
<string name="settings_video_player_ignore_nav_bar_title">"영상에서 내비게이션 바 무시"</string>
<string name="settings_confirm_to_exit">"나갈 때 확인"</string>
<string name="settings_category_comment_title">"댓글"</string>

View File

@ -312,7 +312,6 @@
<string name="settings_mute_video_title">Video\'s dempen</string>
<string name="settings_mute_nsfw_video_title">NSFW-video\'s dempen</string>
<!-- Fuzzy -->
<string name="settings_automatically_try_redgifs_title">Automatisch trachten Redgifs te openen als video\'s zijn verwijderd van Gfycat</string>
<string name="settings_video_player_ignore_nav_bar_title">Navigatiebalk verbergen in videospeler</string>
<string name="settings_video_player_ignore_nav_bar_summary">Voorkom dat de navigatiebalk extra opvulling heeft</string>
<string name="settings_confirm_to_exit">Afsluiten bevestigen</string>
@ -722,7 +721,6 @@ not: "5 uren" -->
<string name="notifications">Notificaties</string>
<string name="messages">Berichten</string>
<string name="message">Bericht</string>
<string name="fetch_gfycat_video_failed">Ophalen van Gfycat video is mislukt</string>
<string name="fetch_redgifs_video_failed">Ophalen van Redgifs video is mislukt</string>
<string name="fetching_video_info_please_wait">Ophalen van videoinfo. Even geduld aub.</string>
<string name="error_fetching_imgur_media">Kan afbeeldingen niet laden</string>
@ -744,7 +742,6 @@ not: "5 uren" -->
<string name="set_to_lock_screen">Als vergrendeldscherm instellen</string>
<string name="set_to_both">Als beiden instellen</string>
<string name="default_font_font_preview">Standaard</string>
<string name="load_video_in_redgifs">Probeer de video op Redgifs te laden</string>
<string name="top_score">%1$s pnt</string>
<string name="login_activity_2fa_prompt">Als je 2-factor authenticatie hebt ingeschakeld, typ dan je wachtwoord als volgt in: &lt;wachtwoord&gt;: &lt;2FA code&gt;.
\nVoorbeeld: yourpass:123456</string>

View File

@ -313,7 +313,6 @@
<string name="settings_mute_video_title">Wycisz filmy</string>
<string name="settings_mute_nsfw_video_title">Wycisz wideo NSFW</string>
<!-- Fuzzy -->
<string name="settings_automatically_try_redgifs_title">Automatycznie próbuj uzyskać filmy z Redgifs, gdy są usunięte z Gfycat.</string>
<string name="settings_video_player_ignore_nav_bar_title">Ignoruj pasek nawigacji w odtwarzaczu wideo</string>
<string name="settings_video_player_ignore_nav_bar_summary">Zapobiegaj posiadaniu dodatkowego marginesu przez kontroler wideo</string>
<string name="settings_confirm_to_exit">Potwierdź aby wyjść</string>
@ -720,7 +719,6 @@
<string name="notifications">Powiadomienia</string>
<string name="messages">Wiadomości</string>
<string name="message">Wiadomość</string>
<string name="fetch_gfycat_video_failed">Nie udało się pobrać filmu z Gfycat</string>
<string name="fetch_redgifs_video_failed">Nie udało się pobrać filmu z Redgifs</string>
<string name="fetching_video_info_please_wait">Pobieranie informacji o filmie. Proszę czekać.</string>
<string name="error_fetching_imgur_media">Nie można załadować obrazów</string>
@ -742,7 +740,6 @@
<string name="set_to_lock_screen">Ustaw na ekranie blokady</string>
<string name="set_to_both">Ustaw na obu</string>
<string name="default_font_font_preview">Domyślnie</string>
<string name="load_video_in_redgifs">Spróbuj załadować film na Redgifs</string>
<string name="top_score">%1$s punktów</string>
<string name="login_activity_2fa_prompt">Jeśli masz włączone uwierzytelnianie dwuskładnikowe, wpisz swoje hasło w następujący sposób: &lt;hasło&gt;:&lt;kod 2FA&gt;</string>
<string name="submit_crosspost_activity_label">Crosspost</string>

View File

@ -315,7 +315,6 @@
<string name="settings_volume_keys_navigate_posts_title">Usar as teclas de volume para navegar entre posts</string>
<string name="settings_mute_video_title">Silenciar vídeos</string>
<string name="settings_mute_nsfw_video_title">Silenciar vídeos NSFW</string>
<string name="settings_automatically_try_redgifs_title">Tentar acessar automaticamente o Redgifs se os vídeos do Gfycat forem removidos.</string>
<string name="settings_video_player_ignore_nav_bar_title">Ignorar barra de navegação no reprodutor de vídeos</string>
<string name="settings_video_player_ignore_nav_bar_summary">Evitar que o controle de vídeo tenha margens largas</string>
<string name="settings_confirm_to_exit">Confirmar para sair</string>
@ -717,7 +716,6 @@
<string name="notifications">Notificações</string>
<string name="messages">Mensagens</string>
<string name="message">Mensagem</string>
<string name="fetch_gfycat_video_failed">Falha ao buscar vídeos do Gfycat</string>
<string name="fetch_redgifs_video_failed">Erro ao buscar vídeos do Redgifs</string>
<string name="fetching_video_info_please_wait">Obtendo informações do vídeo. Por favor aguarde.</string>
<string name="error_fetching_imgur_media">Não foi possível carregar as imagens</string>
@ -738,7 +736,6 @@
<string name="set_to_lock_screen">Aplicar na tela de bloqueio</string>
<string name="set_to_both">Aplicar em ambos</string>
<string name="default_font_font_preview">Padrão</string>
<string name="load_video_in_redgifs">Tente carregar o vídeo no Redgifs</string>
<string name="top_score">%1$s pontos</string>
<string name="login_activity_2fa_prompt">Se você tem a Autenticação em 2 Etapas ativada, digite a senha da seguinte forma: &lt;senha&gt;:&lt;código de autenticação&gt;.
\nExemplo: suasenha:123456</string>

View File

@ -318,7 +318,6 @@
<string name="settings_mute_video_title">Vídeos Sem Som</string>
<string name="settings_mute_nsfw_video_title">Vídeos 18+ Sem Som</string>
<!-- Fuzzy -->
<string name="settings_automatically_try_redgifs_title">Tentar aceder ao Redgifs automaticamente caso os vídeos no Gfycat tenham sido removidos.</string>
<string name="settings_video_player_ignore_nav_bar_title">Ignorar Barra de Navegação no Reprodutor de Vídeo</string>
<string name="settings_video_player_ignore_nav_bar_summary">Impedir que o Controlador de Vídeo Tenha Margem Extra</string>
<string name="settings_confirm_to_exit">Confirmar para Sair</string>
@ -709,7 +708,6 @@
<string name="notifications">Notificações</string>
<string name="messages">Mensagens</string>
<string name="message">Mensagem</string>
<string name="fetch_gfycat_video_failed">Falha ao obter vídeo do Gfycat</string>
<string name="fetch_redgifs_video_failed">Falha ao obter vídeo do Redgifs</string>
<string name="fetching_video_info_please_wait">A obter informações do vídeo. Aguarde.</string>
<string name="error_fetching_imgur_media">Impossível carregar imagens</string>
@ -730,7 +728,6 @@
<string name="set_to_lock_screen">Ecrã de Bloqueio</string>
<string name="set_to_both">Ambos</string>
<string name="default_font_font_preview">Padrão</string>
<string name="load_video_in_redgifs">Tente carregar o vídeo no Redgifs</string>
<string name="top_score">%1$s pontos</string>
<string name="login_activity_2fa_prompt">Caso tenha autenticação de dois fatores (2FA) ativada, tem de preencher o campo do token 2FA. Caso contrário, deixe-o vazio</string>
<string name="submit_crosspost_activity_label">Republicar</string>

View File

@ -325,7 +325,6 @@
<string name="settings_volume_keys_navigate_posts_title">Utilizează Tastele de Volum pentru a Naviga Postările</string>
<string name="settings_mute_video_title">Amuțire Videoclip</string>
<string name="settings_mute_nsfw_video_title">Amuțire Videoclipurilor NSFW</string>
<string name="settings_automatically_try_redgifs_title">Încearcă Automat să Accesați Redgifs dacă Videoclipurile de pe Gfycat sunt Eliminate.</string>
<string name="settings_video_player_ignore_nav_bar_title">Ignoră Bara de Navigare în Player-ul pentru Video</string>
<string name="settings_video_player_ignore_nav_bar_summary">Împiedică Controller-ul Video să aibă Margine Suplimentară</string>
<string name="settings_confirm_to_exit">Confirmă pentru a Ieși</string>
@ -735,7 +734,6 @@
<string name="notifications">Notificări</string>
<string name="messages">Mesaje</string>
<string name="message">Mesaj</string>
<string name="fetch_gfycat_video_failed">Obținerea videoclipului Gfycat a eșuat</string>
<string name="fetch_redgifs_video_failed">Obținerea videoclipului Redgifs a eșuat</string>
<string name="fetching_video_info_please_wait">Se obțin informații despre video. Te rugăm să aștepți.</string>
<string name="error_fetching_imgur_media">Nu s-au putut încărca imaginile</string>
@ -756,7 +754,6 @@
<string name="set_to_lock_screen">Setează pe Ecranul de Blocare</string>
<string name="set_to_both">Setează pe Ambele</string>
<string name="default_font_font_preview">Implicit</string>
<string name="load_video_in_redgifs">Încearcă să încarci videoclipul pe Redgifs</string>
<string name="top_score">%1$s pct</string>
<string name="login_activity_2fa_prompt">Dacă aveți autentificarea cu doi pași activată, va trebui să umpleți câmpul jetonului 2FA. Lăsați-l gol altfel</string>
<string name="submit_crosspost_activity_label">Crosspost</string>

View File

@ -319,7 +319,6 @@
<string name="settings_mute_video_title">Видео без звука</string>
<string name="settings_mute_nsfw_video_title">NSFW-видео без звука</string>
<!-- Fuzzy -->
<string name="settings_automatically_try_redgifs_title">Пытаться использовать Redgifs, если видео на Gfycat удалены.</string>
<string name="settings_video_player_ignore_nav_bar_title">Не использовать панель навигации в видеоплеере</string>
<string name="settings_video_player_ignore_nav_bar_summary">Предотвратить случайные нажатия</string>
<string name="settings_confirm_to_exit">Подтверждать выход</string>
@ -723,7 +722,6 @@
<string name="notifications">Уведомления</string>
<string name="messages">Сообщения</string>
<string name="message">Сообщение</string>
<string name="fetch_gfycat_video_failed">Невозможно получить видео Gfycat</string>
<string name="fetch_redgifs_video_failed">Невозможно получить видео Redgifs</string>
<string name="fetching_video_info_please_wait">Получение информации о видео. Пожалуйста, подождите.</string>
<string name="error_fetching_imgur_media">Невозможно загрузить изображения</string>
@ -744,7 +742,6 @@
<string name="set_to_lock_screen">Установить на экран блокировки</string>
<string name="set_to_both">Установить на оба экрана</string>
<string name="default_font_font_preview">По умолчанию</string>
<string name="load_video_in_redgifs">Попробуйте загрузить видео на Redgifs</string>
<string name="top_score">%1$s пойнтов</string>
<string name="login_activity_2fa_prompt">Если у вас включена двухфакторная аутентификация, введите 2FA токен в поле. Иначе оставьте его пустым</string>
<string name="submit_crosspost_activity_label">Кросспост</string>

View File

@ -320,7 +320,6 @@ This translation does it work well in this kinda format. People use "since" in s
<string name="settings_mute_video_title">Videoları Sessize Al</string>
<string name="settings_mute_nsfw_video_title">NSFW Videolarını Sessize Al</string>
<!-- Fuzzy -->
<string name="settings_automatically_try_redgifs_title">Gfycat\'teki Videolar Kaldırılmışsa Otomatik Olarak Redgif\'lere Erişmeyi Dene.</string>
<string name="settings_video_player_ignore_nav_bar_title">Video Oynatıcısındaki Navigasyon Çubuğunu Yoksay</string>
<string name="settings_video_player_ignore_nav_bar_summary">Video Denetleyicisinde Fazladan Kenar Olmasını Önle</string>
<string name="settings_confirm_to_exit">Çıkışı Doğrula</string>
@ -726,7 +725,6 @@ This translation does it work well in this kinda format. People use "since" in s
<string name="notifications">Bildirimler</string>
<string name="messages">Mesajlar</string>
<string name="message">Mesaj</string>
<string name="fetch_gfycat_video_failed">Gfycat video\'su alınamadı</string>
<string name="fetch_redgifs_video_failed">Redgifs video\'su alınamadı</string>
<string name="fetching_video_info_please_wait">Video bilgisi alınıyor. Lütfen bekleyin.</string>
<string name="error_fetching_imgur_media">Görüntüler yüklenemedi</string>
@ -748,7 +746,6 @@ This translation does it work well in this kinda format. People use "since" in s
<string name="set_to_lock_screen">Kilit Ekranına Ayarla</string>
<string name="set_to_both">İkisine de Ayarla</string>
<string name="default_font_font_preview">Varsayılan</string>
<string name="load_video_in_redgifs">Videoyu Redgifs\'e yüklemeyi deneyin</string>
<string name="top_score">%1$s puan</string>
<string name="login_activity_2fa_prompt">2 faktörlü kimlik doğrulamasını etkinleştirdiyseniz, lütfen şifrenizi aşağıdaki gibi yazınız: &lt;parola&gt;: &lt;2FA code&gt;</string>
<string name="submit_crosspost_activity_label">Çapraz Gönderi</string>

View File

@ -312,7 +312,6 @@
<string name="settings_volume_keys_navigate_posts_title">Пересуватися дописами клавішами гучності</string>
<string name="settings_mute_video_title">Глушити відео</string>
<string name="settings_mute_nsfw_video_title">Глушити відео НБДР</string>
<string name="settings_automatically_try_redgifs_title">Автоматично спробувати отримати доступ до Redgifs, якщо відео на Gfycat видалено.</string>
<string name="settings_video_player_ignore_nav_bar_title">Ігнорувати панель пересування у відеопрогравачі</string>
<string name="settings_video_player_ignore_nav_bar_summary">Не дозволяти відеоконтролеру мати додаткове поле</string>
<string name="settings_confirm_to_exit">Підтверджувати вихід</string>
@ -714,7 +713,6 @@
<string name="notifications">Сповіщення</string>
<string name="messages">Повідомлення</string>
<string name="message">Повідомлення</string>
<string name="fetch_gfycat_video_failed">Не вдалося отримати відеозапис Gfycat</string>
<string name="fetch_redgifs_video_failed">Не вдалося отримати відеозапис Redgifs</string>
<string name="fetching_video_info_please_wait">Отримання відомостей про відео. Зачекайте.</string>
<string name="error_fetching_imgur_media">Неможливо завантажити зображення</string>
@ -735,7 +733,6 @@
<string name="set_to_lock_screen">Установити на екран блокування</string>
<string name="set_to_both">Установити для обох</string>
<string name="default_font_font_preview">Типово</string>
<string name="load_video_in_redgifs">Спробувати завантажити відеозапис на Redgifs</string>
<string name="top_score">%1$s балів</string>
<string name="login_activity_2fa_prompt">Якщо у Вас увімкнено 2-факторну автентифікацію, Вам треба заповнити поле «Токен 2FA». Якщо ні — залиште його порожнім</string>
<string name="submit_crosspost_activity_label">Передопис</string>

View File

@ -315,7 +315,6 @@
<string name="settings_mute_video_title">Tắt tiếng Video</string>
<string name="settings_mute_nsfw_video_title">Tắt tiếng video NSFW</string>
<!-- Fuzzy -->
<string name="settings_automatically_try_redgifs_title">Tự động thử truy cập Redgifs nếu Video trên Gfycat bị xóa.</string>
<string name="settings_video_player_ignore_nav_bar_title">Bỏ qua thanh điều hướng trong trình phát video</string>
<string name="settings_video_player_ignore_nav_bar_summary">Ngăn trình điều khiển video có thêm lề</string>
<string name="settings_confirm_to_exit">Xác nhận để thoát</string>
@ -718,7 +717,6 @@
<string name="notifications">Thông báo</string>
<string name="messages">Tin nhắn</string>
<string name="message">Tin nhắn</string>
<string name="fetch_gfycat_video_failed">Lấy video Gfycat thất bại</string>
<string name="fetch_redgifs_video_failed">Lấy video Redgifs thất bại</string>
<string name="fetching_video_info_please_wait">Đang lấy thông tin video. Vui lòng đợi.</string>
<string name="error_fetching_imgur_media">Không thể tải hình ảnh</string>
@ -739,7 +737,6 @@
<string name="set_to_lock_screen">Đặt làm màn hình khoá</string>
<string name="set_to_both">Đặt làm cả hai</string>
<string name="default_font_font_preview">Mặc định</string>
<string name="load_video_in_redgifs">Thử tải video trên Redgifs</string>
<string name="top_score">%1$s điểm</string>
<string name="login_activity_2fa_prompt">Nếu bạn đã bật xác thực 2 yếu tố, hãy vui lòng nhập mật khẩu như sau: &lt;mật khẩu&gt;:&lt;mã 2FA&gt;.
\nVí dụ: yourpass:123456</string>

View File

@ -312,7 +312,6 @@
<string name="settings_mute_video_title">静音视频</string>
<string name="settings_mute_nsfw_video_title">静音 NSFW 视频</string>
<!-- Fuzzy -->
<string name="settings_automatically_try_redgifs_title">如果 Gfycat 上的视频已被删除,则自动尝试访问 Redgifs。</string>
<string name="settings_video_player_ignore_nav_bar_title">视频播放器中忽略导航栏</string>
<!-- Fuzzy -->
<string name="settings_video_player_ignore_nav_bar_summary">防止视频控制栏有额外的外边距</string>
@ -739,7 +738,6 @@
<string name="notifications">通知</string>
<string name="messages">消息</string>
<string name="message">消息</string>
<string name="fetch_gfycat_video_failed">获取 Gfycat 视频失败</string>
<string name="fetch_redgifs_video_failed">获取 Redgifs 视频失败</string>
<string name="fetching_video_info_please_wait">正在获取视频信息,请稍候。</string>
<string name="error_fetching_imgur_media">无法加载图像</string>
@ -761,7 +759,6 @@
<string name="set_to_lock_screen">设置到锁定屏幕</string>
<string name="set_to_both">设置到主屏幕和锁定屏幕</string>
<string name="default_font_font_preview">默认字体</string>
<string name="load_video_in_redgifs">尝试加载 Redgifs 上的视频</string>
<!-- Don't know how to translate it, never seen this before. -->
<string name="top_score">%1$s 分</string>
<string name="login_activity_2fa_prompt">如果您启用了两步验证,请按如下格式输入密码(使用英文的冒号):&lt;密码&gt;:&lt;两步验证代码&gt;

View File

@ -371,7 +371,6 @@
<string name="settings_volume_keys_navigate_posts_title">Use Volume Keys to Navigate Posts</string>
<string name="settings_mute_video_title">Mute Videos</string>
<string name="settings_mute_nsfw_video_title">Mute NSFW Videos</string>
<string name="settings_automatically_try_redgifs_title">Automatically Try Accessing Redgifs if Videos on Gfycat are Removed.</string>
<string name="settings_video_player_ignore_nav_bar_title">Ignore Navigation Bar in Video Player</string>
<string name="settings_video_player_ignore_nav_bar_summary">Prevent the Video Controller Having Extra Margin</string>
<string name="settings_main_page_back_button_action">Main Page Back Button Action</string>
@ -967,7 +966,6 @@
<string name="notifications">Notifications</string>
<string name="messages">Messages</string>
<string name="message">Message</string>
<string name="fetch_gfycat_video_failed">Fetch Gfycat video failed</string>
<string name="fetch_redgifs_video_failed">Fetch Redgifs video failed</string>
<string name="fetching_video_info_please_wait">Fetching video info. Please wait.</string>
<string name="fetch_streamable_video_failed">Fetch Streamable video failed</string>
@ -994,7 +992,6 @@
<string name="set_to_lock_screen">Set to Lock Screen</string>
<string name="set_to_both">Set to Both</string>
<string name="default_font_font_preview">Default</string>
<string name="load_video_in_redgifs">Try loading the video on Redgifs</string>
<string name="top_score">%1$s pts</string>
<string name="login_activity_2fa_prompt">If you have 2-factor authentication enabled, you need to fill the 2FA token filed. Leave empty otherwise</string>
<string name="block_user">Block User</string>

View File

@ -14,11 +14,6 @@
app:icon="@drawable/ic_mute_preferences_24dp"
app:title="@string/settings_mute_nsfw_video_title" />
<eu.toldi.infinityforlemmy.customviews.CustomFontSwitchPreference
app:defaultValue="true"
app:key="automatically_try_redgifs"
app:title="@string/settings_automatically_try_redgifs_title" />
<eu.toldi.infinityforlemmy.customviews.CustomFontSwitchPreference
app:defaultValue="false"
app:key="video_player_ignore_nav_bar"