mirror of
https://github.com/libre-tube/LibreTube.git
synced 2025-04-28 16:00:31 +05:30
fix subscriptions import
This commit is contained in:
parent
6688e7a5de
commit
aaba4f5bfa
@ -20,6 +20,19 @@
|
|||||||
"versionName": "0.2.5",
|
"versionName": "0.2.5",
|
||||||
"outputFile": "app-x86_64-release.apk"
|
"outputFile": "app-x86_64-release.apk"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "ONE_OF_MANY",
|
||||||
|
"filters": [
|
||||||
|
{
|
||||||
|
"filterType": "ABI",
|
||||||
|
"value": "armeabi-v7a"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"attributes": [],
|
||||||
|
"versionCode": 7,
|
||||||
|
"versionName": "0.2.5",
|
||||||
|
"outputFile": "app-armeabi-v7a-release.apk"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "ONE_OF_MANY",
|
"type": "ONE_OF_MANY",
|
||||||
"filters": [
|
"filters": [
|
||||||
@ -45,19 +58,6 @@
|
|||||||
"versionCode": 7,
|
"versionCode": 7,
|
||||||
"versionName": "0.2.5",
|
"versionName": "0.2.5",
|
||||||
"outputFile": "app-arm64-v8a-release.apk"
|
"outputFile": "app-arm64-v8a-release.apk"
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "ONE_OF_MANY",
|
|
||||||
"filters": [
|
|
||||||
{
|
|
||||||
"filterType": "ABI",
|
|
||||||
"value": "armeabi-v7a"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"attributes": [],
|
|
||||||
"versionCode": 7,
|
|
||||||
"versionName": "0.2.5",
|
|
||||||
"outputFile": "app-armeabi-v7a-release.apk"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"elementType": "File"
|
"elementType": "File"
|
||||||
|
@ -53,9 +53,18 @@ class Settings : PreferenceFragmentCompat() {
|
|||||||
val fileReader = FileReader(parcelFile!!.fileDescriptor)
|
val fileReader = FileReader(parcelFile!!.fileDescriptor)
|
||||||
val reader = BufferedReader(fileReader)
|
val reader = BufferedReader(fileReader)
|
||||||
var line: String?
|
var line: String?
|
||||||
|
var channels: MutableList<String> = emptyList<String>().toMutableList()
|
||||||
|
var subscribedCount = 0
|
||||||
while (reader.readLine().also { line = it } != null) {
|
while (reader.readLine().also { line = it } != null) {
|
||||||
Log.d(TAG,reader.readLine())
|
if (line!!.replace(" ","") != "" && subscribedCount >0) {
|
||||||
|
val channel = line!!.split(",")[0]
|
||||||
|
channels.add(channel)
|
||||||
|
|
||||||
|
Log.d(TAG, "subscribed: " + line + " total: " + subscribedCount)
|
||||||
|
}
|
||||||
|
subscribedCount++
|
||||||
}
|
}
|
||||||
|
subscribe(channels)
|
||||||
reader.close()
|
reader.close()
|
||||||
fileReader.close()
|
fileReader.close()
|
||||||
}else{
|
}else{
|
||||||
|
@ -45,7 +45,6 @@ class Subscriptions : Fragment() {
|
|||||||
super.onViewCreated(view, savedInstanceState)
|
super.onViewCreated(view, savedInstanceState)
|
||||||
val sharedPref = context?.getSharedPreferences("token", Context.MODE_PRIVATE)
|
val sharedPref = context?.getSharedPreferences("token", Context.MODE_PRIVATE)
|
||||||
token = sharedPref?.getString("token","")!!
|
token = sharedPref?.getString("token","")!!
|
||||||
Log.e(TAG,token)
|
|
||||||
refreshLayout = view.findViewById(R.id.sub_refresh)
|
refreshLayout = view.findViewById(R.id.sub_refresh)
|
||||||
if(token!=""){
|
if(token!=""){
|
||||||
view.findViewById<RelativeLayout>(R.id.loginOrRegister).visibility=View.GONE
|
view.findViewById<RelativeLayout>(R.id.loginOrRegister).visibility=View.GONE
|
||||||
@ -94,7 +93,7 @@ class Subscriptions : Fragment() {
|
|||||||
val response = try {
|
val response = try {
|
||||||
RetrofitInstance.api.getFeed(token)
|
RetrofitInstance.api.getFeed(token)
|
||||||
}catch(e: IOException) {
|
}catch(e: IOException) {
|
||||||
println(e)
|
Log.e(TAG,e.toString())
|
||||||
Log.e(TAG, "IOException, you might not have internet connection")
|
Log.e(TAG, "IOException, you might not have internet connection")
|
||||||
return@launchWhenCreated
|
return@launchWhenCreated
|
||||||
} catch (e: HttpException) {
|
} catch (e: HttpException) {
|
||||||
@ -121,7 +120,7 @@ class Subscriptions : Fragment() {
|
|||||||
val response = try {
|
val response = try {
|
||||||
RetrofitInstance.api.subscriptions(token)
|
RetrofitInstance.api.subscriptions(token)
|
||||||
}catch(e: IOException) {
|
}catch(e: IOException) {
|
||||||
println(e)
|
Log.e(TAG,e.toString())
|
||||||
Log.e(TAG, "IOException, you might not have internet connection")
|
Log.e(TAG, "IOException, you might not have internet connection")
|
||||||
return@launchWhenCreated
|
return@launchWhenCreated
|
||||||
} catch (e: HttpException) {
|
} catch (e: HttpException) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user