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