Skip to content

Commit

Permalink
fix parse m3u
Browse files Browse the repository at this point in the history
  • Loading branch information
lizongying committed Apr 29, 2024
1 parent 006f2aa commit f955252
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
1 change: 0 additions & 1 deletion app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,4 @@
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

</manifest>
3 changes: 0 additions & 3 deletions app/src/main/java/com/lizongying/mytv0/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -599,9 +599,6 @@ class MainActivity : FragmentActivity() {

override fun onStop() {
super.onStop()
SP.positionGroup = TVList.groupModel.position.value!!
SP.position = TVList.position.value!!
Log.i(TAG, "position ${TVList.position.value!!} saved")
}

companion object {
Expand Down
13 changes: 9 additions & 4 deletions app/src/main/java/com/lizongying/mytv0/models/TVList.kt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ object TVList {

groupModel.addTVListModel(TVListModel("全部频道"))

if (SP.configAutoLoad) {
if (SP.configAutoLoad && !SP.config.isNullOrEmpty()) {
SP.config?.let {
update(it)
}
Expand Down Expand Up @@ -142,14 +142,14 @@ object TVList {
Log.i("info", "$title $name $group $logo $uris")
val tv = TV(
0,
name!!,
name ?: "",
title,
"",
logo!!,
logo ?: "",
"",
uris,
mapOf(),
group!!,
group ?: "",
listOf(),
)

Expand Down Expand Up @@ -240,6 +240,11 @@ object TVList {

// set a new position or retry when position same
listModel[position].setReady()

SP.positionGroup = groupModel.position.value!!
SP.position = position
Log.i(TAG, "saved $position")

return true
}

Expand Down

0 comments on commit f955252

Please sign in to comment.