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

Method get_albums

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

Source from the content-addressed store, hash-verified

356
357 #[tracing::instrument(level = "debug", skip(self, conn))]
358 fn get_albums(
359 &self,
360 options: QueryableAlbum,
361 inclusive: bool,
362 conn: &mut PooledConnection<ConnectionManager<LoggingConnection<SqliteConnection>>>,
363 ) -> Result<Vec<QueryableAlbum>> {
364 let mut predicate = schema::albums::table.into_boxed();
365
366 trace!("Getting albums");
367 predicate = filter_field!(
368 predicate,
369 &options.album_id,
370 schema::albums::album_id,
371 inclusive
372 );
373
374 predicate = filter_field_like!(
375 predicate,
376 &options.album_name,
377 schema::albums::album_name,
378 inclusive
379 );
380
381 let fetched: Vec<QueryableAlbum> = predicate.load(conn)?;
382 info!("Fetched albums");
383 Ok(fetched)
384 }
385
386 #[tracing::instrument(level = "debug", skip(self, conn))]
387 fn get_artists(

Callers 5

insert_songs_by_refMethod · 0.80
get_entity_by_optionsMethod · 0.80
get_album_songsMethod · 0.80
search_allMethod · 0.80
update_albumMethod · 0.80

Calls 1

loadMethod · 0.45

Tested by

no test coverage detected