@@ -9,30 +9,36 @@ use std::sync::{Mutex, MutexGuard};
99// so we need to make sure operations are not executed in parallel.
1010static LOCK : OnceCell < Mutex < QBittorrentClient > > = OnceCell :: const_new ( ) ;
1111
12- static V2_MAGNET : & str = "magnet:?xt=urn:btmh:1220caf1e1c30e81cb361b9ee167c4aa64228a7fa4fa9f6105232b28ad099f3a302e&dn=bittorrent-v2-test" ;
13- static V2_TORRENT : & [ u8 ] = include_bytes ! ( "bittorrent-v2-test.torrent" ) ;
14- static V2_V2HASH : & str = "caf1e1c30e81cb361b9ee167c4aa64228a7fa4fa9f6105232b28ad099f3a302e" ;
15- static V2_ID : & str = "caf1e1c30e81cb361b9ee167c4aa64228a7fa4fa" ;
16- static V2_NAME : & str = "bittorrent-v2-test" ;
12+ // static V2_MAGNET: &str = "magnet:?xt=urn:btmh:1220caf1e1c30e81cb361b9ee167c4aa64228a7fa4fa9f6105232b28ad099f3a302e&dn=bittorrent-v2-test";
13+ // static V2_TORRENT: &[u8] = include_bytes!("bittorrent-v2-test.torrent");
14+ // static V2_V2HASH: &str = "caf1e1c30e81cb361b9ee167c4aa64228a7fa4fa9f6105232b28ad099f3a302e";
15+ // static V2_ID: &str = "caf1e1c30e81cb361b9ee167c4aa64228a7fa4fa";
16+ // static V2_NAME: &str = "bittorrent-v2-test";
1717
18- static HYBRID_MAGNET : & str = "magnet:?xt=urn:btih:631a31dd0a46257d5078c0dee4e66e26f73e42ac&xt=urn:btmh:1220d8dd32ac93357c368556af3ac1d95c9d76bd0dff6fa9833ecdac3d53134efabb&dn=bittorrent-v1-v2-test" ;
19- static HYBRID_TORRENT : & [ u8 ] = include_bytes ! ( "bittorrent-v2-hybrid-test.torrent" ) ;
20- static HYBRID_V2HASH : & str = "d8dd32ac93357c368556af3ac1d95c9d76bd0dff6fa9833ecdac3d53134efabb" ;
21- static HYBRID_V1HASH : & str = "631a31dd0a46257d5078c0dee4e66e26f73e42ac" ;
22- static HYBRID_ID : & str = "d8dd32ac93357c368556af3ac1d95c9d76bd0dff" ;
23- static HYBRID_NAME : & str = "bittorrent-v1-v2-hybrid-test" ;
18+ // static HYBRID_MAGNET: &str = "magnet:?xt=urn:btih:631a31dd0a46257d5078c0dee4e66e26f73e42ac&xt=urn:btmh:1220d8dd32ac93357c368556af3ac1d95c9d76bd0dff6fa9833ecdac3d53134efabb&dn=bittorrent-v1-v2-test";
19+ // static HYBRID_TORRENT: &[u8] = include_bytes!("bittorrent-v2-hybrid-test.torrent");
20+ // static HYBRID_V2HASH: &str = "d8dd32ac93357c368556af3ac1d95c9d76bd0dff6fa9833ecdac3d53134efabb";
21+ // static HYBRID_V1HASH: &str = "631a31dd0a46257d5078c0dee4e66e26f73e42ac";
22+ // static HYBRID_ID: &str = "d8dd32ac93357c368556af3ac1d95c9d76bd0dff";
23+ // static HYBRID_NAME: &str = "bittorrent-v1-v2-hybrid-test";
2424
2525static V1_MAGNET : & str = "magnet:?xt=urn:btih:2c6e17017f6bb87125b2ba98c56a67f8ffe7e02c&dn=tails-amd64-5.6-img&tr=udp%3a%2f%2ftracker.torrent.eu.org%3a451&tr=udp%3a%2f%2ftracker.coppersurfer.tk%3a6969" ;
26- static V1_TORRENT : & [ u8 ] = include_bytes ! ( "tails-amd64-5.6.img.torrent" ) ;
26+ // static V1_TORRENT: &[u8] = include_bytes!("tails-amd64-5.6.img.torrent");
2727static V1_V1HASH : & str = "2c6e17017f6bb87125b2ba98c56a67f8ffe7e02c" ;
28- static V1_ID : & str = "2c6e17017f6bb87125b2ba98c56a67f8ffe7e02c" ;
29- static V1_NAME : & str = "tails-amd64-5.6.img" ;
30-
28+ // static V1_ID: &str = "2c6e17017f6bb87125b2ba98c56a67f8ffe7e02c";
29+ // static V1_NAME: &str = "tails-amd64-5.6.img";
3130
3231async fn client ( ) -> MutexGuard < ' static , QBittorrentClient > {
3332 LOCK . get_or_init ( || async {
34- Mutex :: new ( QBittorrentClient :: login ( "http://localhost:8080" , "admin" , "adminadmin" ) . await . unwrap ( ) )
35- } ) . await . lock ( ) . unwrap ( )
33+ Mutex :: new (
34+ QBittorrentClient :: login ( "http://localhost:8080" , "admin" , "adminadmin" )
35+ . await
36+ . unwrap ( ) ,
37+ )
38+ } )
39+ . await
40+ . lock ( )
41+ . unwrap ( )
3642}
3743
3844#[ tokio:: test]
0 commit comments