Nsfw content blocked by default

This commit is contained in:
ivan agosto 2019-02-07 08:27:25 -06:00
parent 66428e0c34
commit 305acc87e7
3 changed files with 6 additions and 2 deletions

View File

@ -9,6 +9,7 @@ object ManagerSingleton {
var url: String?= null var url: String?= null
var user: UserModel = UserModel() var user: UserModel = UserModel()
var token: TokenModel = TokenModel() var token: TokenModel = TokenModel()
var nfsw: Boolean = false
// var keys: // var keys:
fun Toast(text: String?) { fun Toast(text: String?) {

View File

@ -24,8 +24,9 @@ class SplashActivity : AppCompatActivity() {
settings = PreferenceManager.getDefaultSharedPreferences(this) settings = PreferenceManager.getDefaultSharedPreferences(this)
editor = settings.edit()
ManagerSingleton.context = this ManagerSingleton.context = this
ManagerSingleton.nfsw = settings.getBoolean("show_nfsw", false)
val host = settings.getString("hostP2play","") val host = settings.getString("hostP2play","")
val lastHost = settings.getString("last_host","") val lastHost = settings.getString("last_host","")

View File

@ -3,6 +3,7 @@ package org.libre.agosto.p2play.ajax
import android.util.JsonReader import android.util.JsonReader
import android.util.JsonToken import android.util.JsonToken
import android.util.Log import android.util.Log
import org.libre.agosto.p2play.ManagerSingleton
import org.libre.agosto.p2play.models.VideoModel import org.libre.agosto.p2play.models.VideoModel
import java.io.InputStreamReader import java.io.InputStreamReader
@ -92,7 +93,8 @@ class Videos: Client() {
} }
private fun getVideos(start:Int, count:Int, sort:String = "-publishedAt", filter:String = ""):ArrayList<VideoModel>{ private fun getVideos(start:Int, count:Int, sort:String = "-publishedAt", filter:String = ""):ArrayList<VideoModel>{
var params = "start=$start&count=$count&sort=$sort" val nfsw = ManagerSingleton.nfsw
var params = "start=$start&count=$count&sort=$sort&nsfw=$nfsw"
if(filter != "") if(filter != "")
params+="&filter=$filter" params+="&filter=$filter"
var con=this._newCon("videos?$params","GET") var con=this._newCon("videos?$params","GET")