@@ -49,6 +49,8 @@ pub struct SongSearchInformation {
4949 pub identifier : String ,
5050 /// The details of this song.
5151 pub song : Option < Song > ,
52+ /// The pre-retrieve result of this search.
53+ pub pre_retrieve_result : Option < RetrievedSongInfo > ,
5254}
5355
5456/// [napi-rs] The information of the song retrieved with `retrieve()`.
@@ -135,6 +137,7 @@ impl From<unm_types::SongSearchInformation> for SongSearchInformation {
135137 source : song_information. source . to_string ( ) ,
136138 identifier : song_information. identifier ,
137139 song : song_information. song . map ( Into :: into) ,
140+ pre_retrieve_result : song_information. pre_retrieve_result . map ( Into :: into) ,
138141 }
139142 }
140143}
@@ -145,6 +148,7 @@ impl From<SongSearchInformation> for unm_types::SongSearchInformation {
145148 . source ( song_information. source . into ( ) )
146149 . identifier ( song_information. identifier )
147150 . song ( song_information. song . map ( Into :: into) )
151+ . pre_retrieve_result ( song_information. pre_retrieve_result . map ( Into :: into) )
148152 . build ( )
149153 }
150154}
@@ -158,6 +162,15 @@ impl From<unm_types::RetrievedSongInfo> for RetrievedSongInfo {
158162 }
159163}
160164
165+ impl From < RetrievedSongInfo > for unm_types:: RetrievedSongInfo {
166+ fn from ( song_information : RetrievedSongInfo ) -> Self {
167+ Self :: builder ( )
168+ . source ( song_information. source . into ( ) )
169+ . url ( song_information. url )
170+ . build ( )
171+ }
172+ }
173+
161174impl From < Context > for unm_types:: Context {
162175 fn from ( context : Context ) -> Self {
163176 let config = context
0 commit comments