From 66428e0c3411ac3e5b9cc91769acf7117eeb5b4b Mon Sep 17 00:00:00 2001 From: ivan agosto Date: Wed, 30 Jan 2019 13:03:00 -0600 Subject: [PATCH] Fix subscriptions problems --- .../java/org/libre/agosto/p2play/ReproductorActivity.kt | 8 +++++--- app/src/main/java/org/libre/agosto/p2play/ajax/Videos.kt | 1 + .../java/org/libre/agosto/p2play/models/VideoModel.kt | 3 ++- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/org/libre/agosto/p2play/ReproductorActivity.kt b/app/src/main/java/org/libre/agosto/p2play/ReproductorActivity.kt index de22ac4..206642e 100644 --- a/app/src/main/java/org/libre/agosto/p2play/ReproductorActivity.kt +++ b/app/src/main/java/org/libre/agosto/p2play/ReproductorActivity.kt @@ -53,8 +53,10 @@ class ReproductorActivity : AppCompatActivity() { userTxt.text = this.video.username descriptionVideoTxt.text = this.video.description.toString() + // Check if user had profile image if(this.video.userImageUrl!="") Picasso.get().load("https://"+ManagerSingleton.url+this.video.userImageUrl).into(userImg) + // Load the video videoView.loadUrl("https://"+ManagerSingleton.url+this.video.embedUrl) @@ -76,7 +78,7 @@ class ReproductorActivity : AppCompatActivity() { } private fun subscribe(){ - val account = this.video.userUuid+"@"+this.video.userHost + val account = this.video.nameChannel+"@"+this.video.userHost AsyncTask.execute { if (Looper.myLooper() == null) Looper.prepare() @@ -91,7 +93,7 @@ class ReproductorActivity : AppCompatActivity() { } private fun unSubscribe(){ - val account = this.video.userUuid+"@"+this.video.userHost + val account = this.video.nameChannel+"@"+this.video.userHost AsyncTask.execute { if (Looper.myLooper() == null) Looper.prepare() @@ -151,7 +153,7 @@ class ReproductorActivity : AppCompatActivity() { } private fun getSubscription(){ - val account = this.video.userUuid+"@"+this.video.userHost + val account = this.video.nameChannel+"@"+this.video.userHost AsyncTask.execute { if (Looper.myLooper() == null) Looper.prepare() diff --git a/app/src/main/java/org/libre/agosto/p2play/ajax/Videos.kt b/app/src/main/java/org/libre/agosto/p2play/ajax/Videos.kt index 1b203e7..bd3f5b1 100644 --- a/app/src/main/java/org/libre/agosto/p2play/ajax/Videos.kt +++ b/app/src/main/java/org/libre/agosto/p2play/ajax/Videos.kt @@ -67,6 +67,7 @@ class Videos: Client() { } "uuid" -> video.userUuid = data.nextString() "host" -> video.userHost = data.nextString() + "name" -> video.nameChannel = data.nextString() else-> data.skipValue() } } diff --git a/app/src/main/java/org/libre/agosto/p2play/models/VideoModel.kt b/app/src/main/java/org/libre/agosto/p2play/models/VideoModel.kt index 22f7333..e7bfa95 100644 --- a/app/src/main/java/org/libre/agosto/p2play/models/VideoModel.kt +++ b/app/src/main/java/org/libre/agosto/p2play/models/VideoModel.kt @@ -13,5 +13,6 @@ class VideoModel( var username: String = "", var views: Number = 0, var userUuid: String = "", - var userHost: String = "" + var userHost: String = "", + var nameChannel: String = "" ):Serializable \ No newline at end of file