fix: fixed merge conflicts

This commit is contained in:
moonleay 2024-03-10 21:39:59 +01:00
commit 2f89b9dbb9
Signed by: moonleay
GPG key ID: 82667543CCD715FB
3 changed files with 5 additions and 6 deletions

View file

@ -37,7 +37,7 @@ impl EventHandler for TrackEndNotifier {
}
return None;
}
let mut head = match music_queue::get_head(&self.guild_id).await {
let mut head = match music_queue::next(&self.guild_id).await {
Some(head) => head,
None => {
println!("Cannot get head of queue");

View file

@ -84,7 +84,7 @@ pub async fn attempt_to_queue_song(
return Embed::create_yt_playing(src, username, "Added to queue").await;
}
let _query = music_queue::get_head(guild_id)
let _query = music_queue::next(guild_id)
.await
.expect("Cannot get head of queue");
music_queue::set_now_playing(guild_id, Some(src.clone())).await;
@ -193,7 +193,7 @@ pub async fn attempt_to_skip_current_song(
}
}
let head = music_queue::get_head(guild_id).await; // TODO match
let head = music_queue::next(guild_id).await; // TODO match
if head.is_none() {
return Embed::create_error_respose(
username,

View file

@ -10,7 +10,6 @@ type MusicQueueItem = Arc<Mutex<MusicQueue>>;
#[derive(Debug)]
pub struct MusicQueue {
pub guild_id: GuildId,
pub queue: VecDeque<YoutubeDl>,
pub now_playing: Option<YoutubeDl>,
pub now_playing_track_handle: Option<TrackHandle>
@ -26,7 +25,6 @@ async fn get_music_queue(guild_id: &GuildId) -> MusicQueueItem {
queues
.entry(*guild_id)
.or_insert(Arc::new(Mutex::new(MusicQueue {
guild_id: *guild_id,
queue: VecDeque::new(),
now_playing: None,
now_playing_track_handle: None,
@ -57,7 +55,8 @@ pub async fn add_to_queue(guild_id: &GuildId, input: YoutubeDl) {
with_music_queue(guild_id, |queue| queue.queue.push_back(input)).await;
}
pub async fn get_head(guild_id: &GuildId) -> Option<YoutubeDl> {
/// Get next track in queue
pub async fn next(guild_id: &GuildId) -> Option<YoutubeDl> {
with_music_queue(guild_id, |queue| queue.queue.pop_front()).await
}