(
&self,
options: QueryableArtist,
inclusive: bool,
conn: &mut PooledConnection<ConnectionManager<LoggingConnection<SqliteConnection>>>,
)
| 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( |
no test coverage detected