mirror of
https://framagit.org/tom79/fedilab-tube
synced 2025-06-05 21:09:11 +02:00
Censor videos having youtube + download in their title (Google Play release only).
This commit is contained in:
@ -39,6 +39,7 @@ import org.jetbrains.annotations.NotNull;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import app.fedilab.fedilabtube.BuildConfig;
|
||||||
import app.fedilab.fedilabtube.R;
|
import app.fedilab.fedilabtube.R;
|
||||||
import app.fedilab.fedilabtube.client.data.VideoData;
|
import app.fedilab.fedilabtube.client.data.VideoData;
|
||||||
import app.fedilab.fedilabtube.client.entities.SepiaSearch;
|
import app.fedilab.fedilabtube.client.entities.SepiaSearch;
|
||||||
@ -215,7 +216,17 @@ public class DisplaySepiaSearchFragment extends Fragment implements AccountsHori
|
|||||||
int previousPosition = this.peertubes.size();
|
int previousPosition = this.peertubes.size();
|
||||||
int videoPerPage = sharedpreferences.getInt(Helper.SET_VIDEOS_PER_PAGE, Helper.VIDEOS_PER_PAGE);
|
int videoPerPage = sharedpreferences.getInt(Helper.SET_VIDEOS_PER_PAGE, Helper.VIDEOS_PER_PAGE);
|
||||||
sepiaSearchVideo.setStart(String.valueOf(Integer.parseInt(sepiaSearchVideo.getStart())+ videoPerPage));
|
sepiaSearchVideo.setStart(String.valueOf(Integer.parseInt(sepiaSearchVideo.getStart())+ videoPerPage));
|
||||||
|
|
||||||
|
if(!BuildConfig.google_restriction) {
|
||||||
this.peertubes.addAll(videoData.data);
|
this.peertubes.addAll(videoData.data);
|
||||||
|
}else{
|
||||||
|
for(VideoData.Video video: videoData.data) {
|
||||||
|
if ( video.getName() == null || !video.getName().toLowerCase().contains("youtube") || !video.getName().toLowerCase().contains("download")) {
|
||||||
|
this.peertubes.add(video);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//If no item were inserted previously the adapter is created
|
//If no item were inserted previously the adapter is created
|
||||||
if (previousPosition == 0) {
|
if (previousPosition == 0) {
|
||||||
peertubeAdapater = new PeertubeAdapter(this.peertubes, SEPIA_SEARCH, true);
|
peertubeAdapater = new PeertubeAdapter(this.peertubes, SEPIA_SEARCH, true);
|
||||||
|
@ -46,6 +46,7 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import app.fedilab.fedilabtube.BuildConfig;
|
||||||
import app.fedilab.fedilabtube.MainActivity;
|
import app.fedilab.fedilabtube.MainActivity;
|
||||||
import app.fedilab.fedilabtube.R;
|
import app.fedilab.fedilabtube.R;
|
||||||
import app.fedilab.fedilabtube.client.APIResponse;
|
import app.fedilab.fedilabtube.client.APIResponse;
|
||||||
@ -334,7 +335,17 @@ public class DisplayVideosFragment extends Fragment implements AccountsHorizonta
|
|||||||
apiResponse.getPeertubes().add(v.getVideo());
|
apiResponse.getPeertubes().add(v.getVideo());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(!BuildConfig.google_restriction) {
|
||||||
this.peertubes.addAll(apiResponse.getPeertubes());
|
this.peertubes.addAll(apiResponse.getPeertubes());
|
||||||
|
}else{
|
||||||
|
for(VideoData.Video video: apiResponse.getPeertubes()) {
|
||||||
|
if ( video.getName() == null || !video.getName().toLowerCase().contains("youtube") || !video.getName().toLowerCase().contains("download")) {
|
||||||
|
this.peertubes.add(video);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//If no item were inserted previously the adapter is created
|
//If no item were inserted previously the adapter is created
|
||||||
if (previousPosition == 0) {
|
if (previousPosition == 0) {
|
||||||
peertubeAdapater = new PeertubeAdapter(this.peertubes, type, sepiaSearch);
|
peertubeAdapater = new PeertubeAdapter(this.peertubes, type, sepiaSearch);
|
||||||
|
Reference in New Issue
Block a user