Fix profile path

This commit is contained in:
世界
2023-11-07 22:16:15 +08:00
parent 273ddc7266
commit fb705ed8a4
3 changed files with 14 additions and 8 deletions

View File

@@ -49,9 +49,12 @@ class Profile(
@Query("DELETE FROM profiles")
fun clear()
@Query("SELECT MAX(userOrder) + 1 FROM profiles")
@Query("SELECT MAX(userOrder) + 1 FROM profiles")
fun nextOrder(): Long?
@Query("SELECT MAX(id) + 1 FROM profiles")
fun nextFileID(): Long?
}
}

View File

@@ -37,6 +37,11 @@ object ProfileManager {
return instance.profileDao().nextOrder() ?: 0
}
suspend fun nextFileID(): Long {
return instance.profileDao().nextFileID() ?: 1
}
suspend fun get(id: Long): Profile? {
return instance.profileDao().get(id)
}