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

Method search_all

src-tauri/database/src/database.rs:792–881  ·  view source on GitHub ↗
(&self, term: String)

Source from the content-addressed store, hash-verified

790
791 #[tracing::instrument(level = "debug", skip(self))]
792 pub fn search_all(&self, term: String) -> Result<SearchResult> {
793 trace!("Searching all by term");
794
795 let term = format!("%{}%", term);
796 let songs = self.get_songs_by_options(GetSongOptions {
797 song: Some(SearchableSong {
798 _id: None,
799 path: Some(term.clone()),
800 title: Some(term.clone()),
801 sample_rate: None,
802 hash: None,
803 type_: None,
804 url: None,
805 playback_url: None,
806 provider_extension: None,
807 show_in_library: None,
808 }),
809 artist: None,
810 album: None,
811 genre: None,
812 playlist: None,
813 inclusive: Some(false),
814 })?;
815
816 let mut conn = self.pool.get().unwrap();
817 let _albums = self.get_albums(
818 QueryableAlbum {
819 album_id: None,
820 album_name: Some(term.clone()),
821 album_artist: None,
822 album_coverpath_high: None,
823 album_song_count: 0f64,
824 year: None,
825 album_coverpath_low: None,
826 album_extra_info: None,
827 },
828 false,
829 &mut conn,
830 )?;
831
832 let _artists = self.get_artists(
833 QueryableArtist {
834 artist_id: None,
835 artist_mbid: None,
836 artist_name: Some(term.clone()),
837 artist_coverpath: None,
838 artist_song_count: 0f64,
839 artist_extra_info: None,
840 sanitized_artist_name: None,
841 },
842 false,
843 &mut conn,
844 )?;
845
846 let _genres = self.get_genres(
847 QueryableGenre {
848 genre_id: None,
849 genre_name: Some(term.clone()),

Callers 1

test_searchFunction · 0.80

Calls 7

get_songs_by_optionsMethod · 0.80
cloneMethod · 0.80
getMethod · 0.80
get_albumsMethod · 0.80
get_artistsMethod · 0.80
get_genresMethod · 0.80
get_playlistsMethod · 0.80

Tested by 1

test_searchFunction · 0.64