fix(searcher): skip artist if already indexed

This commit is contained in:
Tsiry Sandratraina
2023-04-22 11:43:06 +03:00
parent 1f66a01f25
commit 4b6dbd4883
3 changed files with 4 additions and 4 deletions

4
Cargo.lock generated
View File

@@ -4522,7 +4522,7 @@ dependencies = [
[[package]]
name = "music-player-settings"
version = "0.1.5"
version = "0.1.6"
dependencies = [
"config 0.13.3",
"dirs",
@@ -4534,7 +4534,7 @@ dependencies = [
[[package]]
name = "music-player-storage"
version = "0.1.7"
version = "0.1.8"
dependencies = [
"anyhow",
"itertools",

View File

@@ -1,6 +1,6 @@
[package]
name = "music-player-storage"
version = "0.1.7"
version = "0.1.8"
edition = "2021"
repository = "https://github.com/tsirysndr/music-player"
license = "MIT"

View File

@@ -55,7 +55,7 @@ impl ArtistSearcher {
// Check if the artist already exists
let searcher = self.reader.searcher();
let query = TermQuery::new(
Term::from_field_text(name, artist.name.as_str()),
Term::from_field_text(id, &artist.id),
IndexRecordOption::Basic,
);
let top_docs = searcher.search(&query, &TopDocs::with_limit(1))?;