Added DHT status

This commit is contained in:
Ultradesu
2026-07-21 20:19:10 +03:00
parent 8ee1db9cf8
commit daea24042c
3 changed files with 35 additions and 3 deletions
+6
View File
@@ -525,6 +525,12 @@ impl MusicDhtService {
self.node.db.list_local_items(false).await
}
/// Counts non-expired DHT replica records stored by this node.
pub async fn dht_record_count(&self) -> Result<usize> {
self.node.ensure_running()?;
self.node.db.dht_record_count(now_ms()).await
}
/// Searches only the local database.
pub async fn search_local(&self, query: &str) -> Result<Vec<LibraryItem>> {
let normalized = normalize_name(query);