MCPcopy Create free account
hub / github.com/Moosync/Moosync / get_artists

Method get_artists

src-tauri/database/src/database.rs:387–420  ·  view source on GitHub ↗
(
        &self,
        options: QueryableArtist,
        inclusive: bool,
        conn: &mut PooledConnection<ConnectionManager<LoggingConnection<SqliteConnection>>>,
    )

Source from the content-addressed store, hash-verified

385
386 #[tracing::instrument(level = "debug", skip(self, conn))]
387 fn get_artists(
388 &self,
389 options: QueryableArtist,
390 inclusive: bool,
391 conn: &mut PooledConnection<ConnectionManager<LoggingConnection<SqliteConnection>>>,
392 ) -> Result<Vec<QueryableArtist>> {
393 let mut predicate = schema::artists::table.into_boxed();
394
395 trace!("Fetching artists");
396 predicate = filter_field!(
397 predicate,
398 &options.artist_id,
399 schema::artists::artist_id,
400 inclusive
401 );
402
403 predicate = filter_field_like!(
404 predicate,
405 &options.artist_name,
406 schema::artists::artist_name,
407 inclusive
408 );
409
410 predicate = filter_field!(
411 predicate,
412 &options.artist_mbid,
413 schema::artists::artist_mbid,
414 inclusive
415 );
416
417 let fetched: Vec<QueryableArtist> = predicate.load(conn)?;
418 info!("Fetched artists");
419 Ok(fetched)
420 }
421
422 #[tracing::instrument(level = "debug", skip(self, conn))]
423 fn get_genres(

Callers 5

insert_songs_by_refMethod · 0.80
get_entity_by_optionsMethod · 0.80
get_artist_songsMethod · 0.80
search_allMethod · 0.80
update_artistMethod · 0.80

Calls 1

loadMethod · 0.45

Tested by

no test coverage detected