File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -116,6 +116,9 @@ impl Loader {
116116 println ! ( "Skipping {}" , output_path. to_string_lossy( ) ) ;
117117 return Ok ( ( ) ) ;
118118 }
119+ if let Some ( parent) = output_path. parent ( ) {
120+ create_dir_all ( parent) . await ?;
121+ }
119122 println ! ( "Downloading {}" , output_path. to_string_lossy( ) ) ;
120123
121124 let backend = audio_backend:: find ( Some ( "pipe" . to_owned ( ) ) )
Original file line number Diff line number Diff line change @@ -94,7 +94,7 @@ pub async fn get_file_name(
9494 . unwrap_or ( "" . to_owned ( ) ) ,
9595 )
9696 . replace ( "%A" , & get_artists_line ( & artists) )
97- . replace ( "%t" , & audio_item. name )
97+ . replace ( "%t" , & legalize_name ( & audio_item. name ) )
9898 . replace ( "%n" , & format ! ( "{:02}" , track_number. unwrap_or( 0 ) ) ) ;
9999
100100 match extension {
@@ -107,7 +107,7 @@ pub async fn get_file_name(
107107
108108 let title = template
109109 . replace ( "%a" , & show_name)
110- . replace ( "%t" , & audio_item. name )
110+ . replace ( "%t" , & legalize_name ( & audio_item. name ) )
111111 . replace ( "%n" , & format ! ( "{:02}" , track_number. unwrap_or( 0 ) ) ) ;
112112
113113 match extension {
@@ -118,9 +118,9 @@ pub async fn get_file_name(
118118 } ;
119119
120120 if let Some ( regex) = REGEX_FILTER . get ( ) {
121- legalize_name ( & regex. replace_all ( & name, "" ) . into_owned ( ) )
121+ regex. replace_all ( & name, "" ) . into_owned ( )
122122 } else {
123- legalize_name ( & name)
123+ name
124124 }
125125}
126126
You can’t perform that action at this time.
0 commit comments