diff --git a/.gitignore b/.gitignore index cd53d71..ae7866f 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ Temp/ Music *.json yt-dlp -ffmpeg \ No newline at end of file +ffmpeg +password \ No newline at end of file diff --git a/BuildDockerAndUpload.sh b/BuildDockerAndUpload.sh new file mode 100755 index 0000000..2ea7011 --- /dev/null +++ b/BuildDockerAndUpload.sh @@ -0,0 +1,4 @@ +#!/bin/bash +cat password | docker login -u happytanuki12 --password-stdin +docker build --tag happytanuki12/bumblebee:latest . +docker push happytanuki12/bumblebee:latest \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index bb8b9a2..9bb828b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,10 +19,10 @@ RUN pip3 install --break-system-packages pycryptodome RUN curl -Lo dpp.deb https://dl.dpp.dev/ RUN dpkg -i dpp.deb RUN rm dpp.deb -RUN curl -LO https://github.com/BtbN/FFmpeg-Builds/releases/latest/download/ffmpeg-master-latest-linux64-gpl.tar.xz -RUN tar -xf ffmpeg-master-latest-linux64-gpl.tar.xz -RUN rm ffmpeg-master-latest-linux64-gpl.tar.xz -RUN mv ffmpeg-master-latest-linux64-gpl ffmpeg +# RUN curl -LO https://github.com/BtbN/FFmpeg-Builds/releases/latest/download/ffmpeg-master-latest-linux64-gpl.tar.xz +# RUN tar -xf ffmpeg-master-latest-linux64-gpl.tar.xz +# RUN rm ffmpeg-master-latest-linux64-gpl.tar.xz +# RUN mv ffmpeg-master-latest-linux64-gpl ffmpeg RUN curl -LO https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp RUN chmod +x ./yt-dlp COPY ./build/BumbleCee /BumbleCee diff --git a/docker-compose.yml b/docker-compose.yml index 5adcd11..b79be89 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ services: bumblebee: - build: . + image: happytanuki12/bumblebee:latest container_name: BumbleBee volumes: - ./config.json:/config.json diff --git a/src/Audio/MusicPlayManager.cpp b/src/Audio/MusicPlayManager.cpp index fb6e91f..909d0ab 100644 --- a/src/Audio/MusicPlayManager.cpp +++ b/src/Audio/MusicPlayManager.cpp @@ -81,6 +81,8 @@ std::list MusicPlayManager::getQueue(const dpp::snowflake gui MusicQueueElement MusicPlayManager::getNowPlaying(const dpp::snowflake guildId) { std::shared_ptr nowplaying = queueMap[guildId]->nowplaying(); + if (nowplaying == nullptr) + return MusicQueueElement("", "", dpp::user(), dpp::embed()); MusicQueueElement returnValue(*nowplaying); return returnValue; } diff --git a/src/Queue/MusicQueue.cpp b/src/Queue/MusicQueue.cpp index bdd6934..e2276ed 100644 --- a/src/Queue/MusicQueue.cpp +++ b/src/Queue/MusicQueue.cpp @@ -36,7 +36,10 @@ std::list>::iterator MusicQueue::findByIndex( } std::shared_ptr MusicQueue::nowplaying() { std::lock_guard lock(queueMutex); - return *currentPlayingPosition; + if (currentPlayingPosition == queue.end()) + return nullptr; + else + return *currentPlayingPosition; } std::list>::iterator MusicQueue::next_music() { std::lock_guard lock(queueMutex);