(
&self,
options: QueryableAlbum,
inclusive: bool,
conn: &mut PooledConnection<ConnectionManager<LoggingConnection<SqliteConnection>>>,
)
| 551 | |
| 552 | #[tracing::instrument(level = "debug", skip(self, conn))] |
| 553 | pub fn get_album_songs( |
| 554 | &self, |
| 555 | options: QueryableAlbum, |
| 556 | inclusive: bool, |
| 557 | conn: &mut PooledConnection<ConnectionManager<LoggingConnection<SqliteConnection>>>, |
| 558 | ) -> Result<Vec<QueryableSong>> { |
| 559 | trace!("Fetching album songs"); |
| 560 | let binding = self.get_albums(options, inclusive, conn)?; |
| 561 | let album = binding.first(); |
| 562 | if album.is_none() { |
| 563 | return Ok(vec![]); |
| 564 | } |
| 565 | |
| 566 | let album = album.unwrap(); |
| 567 | let album_data: Vec<AlbumBridge> = QueryDsl::filter( |
| 568 | album_bridge, |
| 569 | schema::album_bridge::album.eq(album.album_id.clone()), |
| 570 | ) |
| 571 | .load(conn)?; |
| 572 | |
| 573 | let songs: Vec<QueryableSong> = QueryDsl::filter( |
| 574 | allsongs, |
| 575 | _id.eq_any(album_data.iter().map(|v| v.song.clone())), |
| 576 | ) |
| 577 | .load(conn)?; |
| 578 | |
| 579 | info!("Fetched album songs"); |
| 580 | Ok(songs) |
| 581 | } |
| 582 | |
| 583 | #[tracing::instrument(level = "debug", skip(self, conn))] |
| 584 | pub fn get_artist_songs( |
no test coverage detected