Skip to content

Commit

Permalink
fix: load local subs not found
Browse files Browse the repository at this point in the history
  • Loading branch information
lisonge committed Nov 21, 2024
1 parent 12dfdfa commit aa49bdf
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions app/src/main/kotlin/li/songe/gkd/util/SubsState.kt
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,21 @@ fun getSubsStatus(ruleSummary: RuleSummary, count: Long): String {
private fun loadSubs(id: Long): RawSubscription {
val file = subsFolder.resolve("${id}.json")
if (!file.exists()) {
// 某些设备出现这种情况
if (id == LOCAL_SUBS_ID) {
return RawSubscription(
id = LOCAL_SUBS_ID,
name = "本地订阅",
version = 0
)
}
if (id == LOCAL_HTTP_SUBS_ID) {
return RawSubscription(
id = LOCAL_HTTP_SUBS_ID,
name = "内存订阅",
version = 0
)
}
error("订阅文件不存在")
}
val subscription = try {
Expand Down

0 comments on commit aa49bdf

Please sign in to comment.