Skip to content

Commit

Permalink
fix: updateUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Mar 27, 2024
1 parent aae9490 commit 87cd7d7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/src/main/kotlin/li/songe/gkd/ui/home/HomeVm.kt
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ class HomeVm @Inject constructor() : ViewModel() {
}
val newItem = SubsItem(
id = newSubsRaw.id,
updateUrl = newSubsRaw.updateUrl ?: url,
updateUrl = url,
order = if (subItems.isEmpty()) 1 else (subItems.maxBy { it.order }.order + 1)
)
updateSubscription(newSubsRaw)
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/kotlin/li/songe/gkd/util/SubsState.kt
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ data class SubsEntry(
) {
val checkUpdateUrl = run {
val checkUpdateUrl = subscription?.checkUpdateUrl ?: return@run null
val updateUrl = subscription.updateUrl ?: subsItem.updateUrl ?: return@run null
val updateUrl = subscription.updateUrl ?: subsItem.updateUrl ?: return@run checkUpdateUrl
try {
return@run URI(updateUrl).resolve(checkUpdateUrl).toString()
} catch (e: Exception) {
Expand Down

0 comments on commit 87cd7d7

Please sign in to comment.