Update function name to the correct one

This commit is contained in:
Ivan Agosto 2024-03-25 19:57:22 -06:00
parent 0d9bd5410a
commit eeb20f1f9d
4 changed files with 5 additions and 10 deletions

View File

@ -1,8 +1,6 @@
package org.libre.agosto.p2play
import android.annotation.SuppressLint
import android.app.Activity
import android.content.DialogInterface
import android.content.Intent
import android.content.pm.ActivityInfo
import android.graphics.Bitmap
@ -96,7 +94,7 @@ class ReproductorActivity : AppCompatActivity() {
userImg.setOnClickListener {
val intent = Intent(this, ChannelActivity::class.java)
intent.putExtra("channel", video.getAccount())
intent.putExtra("channel", video.getChannel())
startActivity(intent)
}
}
@ -105,7 +103,7 @@ class ReproductorActivity : AppCompatActivity() {
AsyncTask.execute {
if (Looper.myLooper() == null)
Looper.prepare()
val res = this._actions.subscribe(ManagerSingleton.token.token, video.getAccount())
val res = this._actions.subscribe(ManagerSingleton.token.token, video.getChannel())
if (res == 1) {
runOnUiThread {
ManagerSingleton.Toast(getString(R.string.subscribeMsg), this)
@ -119,7 +117,7 @@ class ReproductorActivity : AppCompatActivity() {
AsyncTask.execute {
if (Looper.myLooper() == null)
Looper.prepare()
val res = this._actions.unSubscribe(ManagerSingleton.token.token, video.getAccount())
val res = this._actions.unSubscribe(ManagerSingleton.token.token, video.getChannel())
if (res == 1) {
runOnUiThread {
ManagerSingleton.Toast(getString(R.string.unSubscribeMsg), this)

View File

@ -66,7 +66,7 @@ class VideosAdapter(private val myDataset: ArrayList<VideoModel>) :
holder.userImg.setOnClickListener {
val intent = Intent(holder.context, ChannelActivity::class.java)
intent.putExtra("channel", myDataset[position].getAccount())
intent.putExtra("channel", myDataset[position].getChannel())
holder.context.startActivity(intent)
}

View File

@ -10,8 +10,6 @@ import java.net.HttpURLConnection
import java.net.URL
open class Client {
protected fun _newCon(uri: String, method: String, token: String = ""): HttpURLConnection {
val url = URL("https://${ManagerSingleton.url}/api/v1/$uri")
val con = url.openConnection() as HttpURLConnection
@ -67,5 +65,4 @@ open class Client {
return keys
}
}

View File

@ -19,7 +19,7 @@ class VideoModel(
var userHost: String = "",
var nameChannel: String = ""
):Serializable {
fun getAccount(): String {
fun getChannel(): String {
return "$nameChannel@$userHost"
}