@@ -6,7 +6,13 @@ use structures::performance::STARTUP_TIME;
66use term:: { Manager , ManagerMessage } ;
77use tokio:: select;
88
9- use std:: { future:: Future , panic, path:: { Path , PathBuf } , str:: FromStr , sync:: RwLock } ;
9+ use std:: {
10+ future:: Future ,
11+ panic,
12+ path:: { Path , PathBuf } ,
13+ str:: FromStr ,
14+ sync:: RwLock ,
15+ } ;
1016use systems:: { logger:: init, player:: player_system} ;
1117
1218use crate :: {
@@ -20,12 +26,12 @@ mod config;
2026mod consts;
2127mod database;
2228mod errors;
29+ mod shutdown;
2330mod structures;
2431mod systems;
2532mod term;
2633mod utils;
27- mod shutdown;
28- pub use shutdown:: { ShutdownSignal , is_shutdown_sent, shutdown} ;
34+ pub use shutdown:: { is_shutdown_sent, shutdown, ShutdownSignal } ;
2935mod tasks;
3036
3137pub use database:: DATABASE ;
@@ -231,10 +237,7 @@ async fn app_start_main(updater_r: Receiver<ManagerMessage>, updater_s: Sender<M
231237 // Spawn the player task
232238 let ( sa, player) = player_system ( updater_s. clone ( ) ) ;
233239 // Spawn the downloader system
234- DOWNLOAD_MANAGER . spawn_system (
235- ShutdownSignal ,
236- download_manager_handler ( sa. clone ( ) ) ,
237- ) ;
240+ DOWNLOAD_MANAGER . spawn_system ( ShutdownSignal , download_manager_handler ( sa. clone ( ) ) ) ;
238241 STARTUP_TIME . log ( "Spawned system task" ) ;
239242 tasks:: last_playlist:: spawn_last_playlist_task ( updater_s. clone ( ) ) ;
240243 STARTUP_TIME . log ( "Spawned last playlist task" ) ;
@@ -248,6 +251,7 @@ async fn app_start_main(updater_r: Receiver<ManagerMessage>, updater_s: Sender<M
248251 let mut manager = Manager :: new ( sa, player) . await ;
249252 manager. run ( & updater_r) . unwrap ( ) ;
250253}
254+
251255fn app_start ( ) {
252256 let ( updater_s, updater_r) = flume:: unbounded :: < ManagerMessage > ( ) ;
253257 let updater_s_c = updater_s. clone ( ) ;
0 commit comments