1515// You should have received a copy of the GNU General Public License
1616// along with RustPlayer. If not, see <http://www.gnu.org/licenses/>.
1717
18- use bytes:: Bytes ;
1918use std:: cmp:: max;
20- use std:: fs;
21- use std:: future:: Future ;
22- use std:: io:: Cursor ;
23- use std:: sync:: mpsc:: { Receiver , Sender , TryRecvError } ;
19+
20+ use std:: sync:: mpsc:: { Receiver , Sender } ;
2421use std:: {
25- cell:: { Ref , RefCell } ,
26- fmt:: Debug ,
2722 fs:: File ,
28- io:: { BufReader , Error , Write } ,
23+ io:: { BufReader , Write } ,
2924 ops:: Add ,
3025 path:: Path ,
31- ptr:: null,
32- sync:: {
33- mpsc:: { self , channel} ,
34- Arc , Mutex ,
35- } ,
26+ sync:: mpsc:: channel,
3627 thread,
3728 time:: { Duration , Instant , SystemTime } ,
3829} ;
3930
4031use m3u8_rs:: { MediaPlaylist , Playlist } ;
41- use rodio :: decoder :: DecoderError ;
42- use rodio:: { cpal, source :: Delay } ;
43- use rodio:: { Decoder , Devices , OutputStream , OutputStreamHandle , Sink , Source } ;
32+
33+ use rodio:: cpal;
34+ use rodio:: { Decoder , OutputStream , OutputStreamHandle , Sink , Source } ;
4435use tui:: widgets:: ListState ;
4536
46- use crate :: net :: download ;
37+ use crate :: util :: lyrics :: Lyrics ;
4738use crate :: util:: m3u8:: empty_cache;
48- use crate :: {
49- app,
50- util:: lyrics:: { Lyric , Lyrics } ,
51- } ;
5239use crate :: { m3u8:: download_m3u8_playlist, util:: net:: download_as_bytes} ;
5340
5441use super :: media:: Media ;
@@ -159,7 +146,7 @@ impl Player for MusicPlayer {
159146 super :: media:: Source :: Local ( path) => {
160147 return self . play_with_file ( path, once) ;
161148 }
162- super :: media:: Source :: M3u8 ( path ) => false ,
149+ super :: media:: Source :: M3u8 ( _path ) => false ,
163150 }
164151 }
165152
@@ -448,7 +435,7 @@ impl Player for RadioPlayer {
448435 match src {
449436 super :: media:: Source :: Http ( _) => false ,
450437 super :: media:: Source :: M3u8 ( url) => {
451- let ( tx, mut rx) = channel ( ) ;
438+ let ( tx, rx) = channel ( ) ;
452439 let m3u8_url = url. url . clone ( ) ;
453440 thread:: spawn ( move || {
454441 let playlist = download_m3u8_playlist ( m3u8_url) ;
@@ -472,7 +459,7 @@ impl Player for RadioPlayer {
472459 return true ;
473460 }
474461 }
475- Err ( err ) => {
462+ Err ( _err ) => {
476463 // ignore
477464 }
478465 }
0 commit comments