chore: update dependencies

This commit is contained in:
Mark 2025-08-23 11:32:01 +02:00
parent bf100f38e3
commit c23d487a02
12 changed files with 39 additions and 33 deletions

View File

@ -7,11 +7,11 @@ edition = "2021"
[dependencies] [dependencies]
musicdb-lib = { path = "../musicdb-lib", default-features = false } musicdb-lib = { path = "../musicdb-lib", default-features = false }
clap = { version = "4.4.6", features = ["derive"] } clap = { version = "4.5.45", features = ["derive"] }
directories = "5.0.1" directories = "6.0.0"
regex = "1.9.3" regex = "1.11.1"
speedy2d = { version = "1.12.0", optional = true } speedy2d = { version = "2.1.0", optional = true }
toml = "0.7.6" toml = "0.9.5"
# musicdb-mers = { version = "0.1.0", path = "../musicdb-mers", optional = true } # musicdb-mers = { version = "0.1.0", path = "../musicdb-mers", optional = true }
uianimator = "0.1.1" uianimator = "0.1.1"
@ -27,7 +27,9 @@ default = ["gui", "default-playback"]
# enables syncplayer modes, where the client mirrors the server's playback # enables syncplayer modes, where the client mirrors the server's playback
gui = ["speedy2d"] gui = ["speedy2d"]
# merscfg = ["mers", "gui"] # merscfg = ["mers", "gui"]
merscfg = []
# mers = ["musicdb-mers"] # mers = ["musicdb-mers"]
mers = []
playback = [] playback = []
default-playback = ["playback", "musicdb-lib/default-playback"] default-playback = ["playback", "musicdb-lib/default-playback"]
playback-via-playback-rs = ["playback", "musicdb-lib/playback-via-playback-rs"] playback-via-playback-rs = ["playback", "musicdb-lib/playback-via-playback-rs"]

View File

@ -1,4 +1,4 @@
use std::{fmt::Display, rc::Rc, sync::Arc}; use std::{fmt::Display, sync::Arc};
use musicdb_lib::data::CoverId; use musicdb_lib::data::CoverId;
use speedy2d::{ use speedy2d::{
@ -30,7 +30,7 @@ pub struct Content {
text: String, text: String,
color: Color, color: Color,
background: Option<Color>, background: Option<Color>,
formatted: Option<Rc<FormattedTextBlock>>, formatted: Option<FormattedTextBlock>,
} }
#[allow(unused)] #[allow(unused)]

View File

@ -1,4 +1,5 @@
// #![allow(unused)] #![allow(dead_code)]
#![allow(unused_variables)]
use std::{ use std::{
io::{BufReader, Write}, io::{BufReader, Write},
@ -146,7 +147,6 @@ fn main() {
| Mode::GuiSyncplayerNetwork | Mode::GuiSyncplayerNetwork
); );
#[cfg(feature = "playback")] #[cfg(feature = "playback")]
#[allow(unused)]
let mut cache_manager = None; let mut cache_manager = None;
#[cfg(feature = "playback")] #[cfg(feature = "playback")]
let mut player = if is_syncplayer { let mut player = if is_syncplayer {
@ -160,6 +160,12 @@ fn main() {
} else { } else {
None None
}; };
// prevent unused assignment warning, we might
// need cache manager at some point -_-
#[cfg(feature = "playback")]
if false {
drop(cache_manager);
}
#[allow(unused_labels)] #[allow(unused_labels)]
'ifstatementworkaround: { 'ifstatementworkaround: {
// use if+break instead of if-else because we can't #[cfg(feature)] the if statement, // use if+break instead of if-else because we can't #[cfg(feature)] the if statement,

View File

@ -6,6 +6,6 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
id3 = "1.16.0" id3 = "1.16.3"
mp3-duration = "0.1.10" mp3-duration = "0.1.10"
musicdb-lib = { version = "0.1.0", path = "../musicdb-lib" } musicdb-lib = { version = "0.1.0", path = "../musicdb-lib" }

View File

@ -7,10 +7,10 @@ edition = "2021"
base64 = "0.22.1" base64 = "0.22.1"
colorize = "0.1.0" colorize = "0.1.0"
playback-rs = { version = "0.4.4", optional = true } playback-rs = { version = "0.4.4", optional = true }
rand = "0.8.5" rand = "0.9.2"
rc-u8-reader = "2.0.16" rc-u8-reader = "2.0.16"
rodio = { version = "0.20.1", optional = true } rodio = { version = "0.21.1", optional = true }
sysinfo = "0.30.12" sysinfo = "0.37.0"
[features] [features]
default = [] default = []

View File

@ -39,8 +39,8 @@ impl CacheManager {
let sleep_dur_long = Duration::from_secs(20); let sleep_dur_long = Duration::from_secs(20);
let sleep_dur_short = Duration::from_secs(1); let sleep_dur_short = Duration::from_secs(1);
let mut si = sysinfo::System::new_with_specifics( let mut si = sysinfo::System::new_with_specifics(
sysinfo::RefreshKind::new() sysinfo::RefreshKind::nothing()
.with_memory(sysinfo::MemoryRefreshKind::new().with_ram()), .with_memory(sysinfo::MemoryRefreshKind::nothing().with_ram()),
); );
eprintln!("[{}] Starting CacheManager", "INFO".cyan()); eprintln!("[{}] Starting CacheManager", "INFO".cyan());
let mut sleep_short = true; let mut sleep_short = true;
@ -54,7 +54,7 @@ impl CacheManager {
}); });
sleep_short = false; sleep_short = false;
// memory stuff // memory stuff
si.refresh_memory_specifics(sysinfo::MemoryRefreshKind::new().with_ram()); si.refresh_memory_specifics(sysinfo::MemoryRefreshKind::nothing().with_ram());
let available_memory = si.available_memory(); let available_memory = si.available_memory();
let min_avail_mem = min_avail_mem.load(std::sync::atomic::Ordering::Relaxed); let min_avail_mem = min_avail_mem.load(std::sync::atomic::Ordering::Relaxed);
let low_memory = available_memory < min_avail_mem; let low_memory = available_memory < min_avail_mem;

View File

@ -9,7 +9,7 @@ use std::{
}; };
use colorize::AnsiColor; use colorize::AnsiColor;
use rand::thread_rng; use rand::rng;
use crate::{ use crate::{
load::ToFromBytes, load::ToFromBytes,
@ -690,7 +690,7 @@ impl Database {
}) = elem.content_mut() }) = elem.content_mut()
{ {
let mut ord: Vec<usize> = (0..content.len()).collect(); let mut ord: Vec<usize> = (0..content.len()).collect();
ord.shuffle(&mut thread_rng()); ord.shuffle(&mut rng());
self.apply_action_unchecked_seq( self.apply_action_unchecked_seq(
Action::QueueSetShuffle(path, ord, set_index), Action::QueueSetShuffle(path, ord, set_index),
client, client,

View File

@ -418,7 +418,7 @@ impl Queue {
} }
impl QueueFolder { impl QueueFolder {
pub fn iter(&self) -> QueueFolderIter { pub fn iter(&self) -> QueueFolderIter<'_> {
QueueFolderIter { QueueFolderIter {
folder: self, folder: self,
index: 0, index: 0,

View File

@ -1,7 +1,7 @@
use std::{ffi::OsStr, sync::Arc}; use std::{ffi::OsStr, sync::Arc};
use rc_u8_reader::ArcU8Reader; use rc_u8_reader::ArcU8Reader;
use rodio::{decoder::DecoderError, Decoder, OutputStream, OutputStreamHandle, Sink, Source}; use rodio::{decoder::DecoderError, Decoder, OutputStream, Sink, Source};
use crate::{ use crate::{
data::{song::Song, SongId}, data::{song::Song, SongId},
@ -13,8 +13,6 @@ use super::PlayerBackend;
pub struct PlayerBackendRodio<T> { pub struct PlayerBackendRodio<T> {
#[allow(unused)] #[allow(unused)]
output_stream: OutputStream, output_stream: OutputStream,
#[allow(unused)]
output_stream_handle: OutputStreamHandle,
sink: Sink, sink: Sink,
stopped: bool, stopped: bool,
current: Option<(SongId, Arc<Vec<u8>>, Option<u128>, T)>, current: Option<(SongId, Arc<Vec<u8>>, Option<u128>, T)>,
@ -34,11 +32,11 @@ impl<T> PlayerBackendRodio<T> {
pub fn new_with_optional_command_sending( pub fn new_with_optional_command_sending(
command_sender: Option<std::sync::mpsc::Sender<(Command, Option<u64>)>>, command_sender: Option<std::sync::mpsc::Sender<(Command, Option<u64>)>>,
) -> Result<Self, Box<dyn std::error::Error>> { ) -> Result<Self, Box<dyn std::error::Error>> {
let (output_stream, output_stream_handle) = rodio::OutputStream::try_default()?; let output_stream =
let sink = Sink::try_new(&output_stream_handle)?; rodio::OutputStreamBuilder::from_default_device()?.open_stream_or_fallback()?;
let sink = Sink::connect_new(&output_stream.mixer());
Ok(Self { Ok(Self {
output_stream, output_stream,
output_stream_handle,
sink, sink,
stopped: true, stopped: true,
current: None, current: None,

View File

@ -437,7 +437,7 @@ pub fn run_server_caching_thread_opt(
pub fn handle_one_connection_as_main( pub fn handle_one_connection_as_main(
db: Arc<Mutex<Database>>, db: Arc<Mutex<Database>>,
connection: &mut impl Read, connection: &mut impl Read,
mut send_to: (impl Write + Sync + Send + 'static), mut send_to: impl Write + Sync + Send + 'static,
command_sender: &mpsc::Sender<(Command, Option<u64>)>, command_sender: &mpsc::Sender<(Command, Option<u64>)>,
) -> Result<(), std::io::Error> { ) -> Result<(), std::io::Error> {
// sync database // sync database

View File

@ -7,12 +7,12 @@ edition = "2021"
[dependencies] [dependencies]
musicdb-lib = { path = "../musicdb-lib" } musicdb-lib = { path = "../musicdb-lib" }
clap = { version = "4.4.6", features = ["derive"] } clap = { version = "4.5.45", features = ["derive"] }
headers = "0.3.8" headers = "0.4.1"
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0" serde_json = "1.0"
tokio = { version = "1.37.0", optional = true, features = ["rt"] } tokio = { version = "1.47.1", optional = true, features = ["rt"] }
rocket = { version = "0.5.0", optional = true } rocket = { version = "0.5.1", optional = true }
html-escape = { version = "0.2.13", optional = true } html-escape = { version = "0.2.13", optional = true }
rocket_ws = "0.1.1" rocket_ws = "0.1.1"
rocket_seek_stream = "0.2.6" rocket_seek_stream = "0.2.6"

View File

@ -302,14 +302,14 @@ fn now_playing_ids(data: &State<Data>) -> String {
} }
#[get("/song/<id>")] #[get("/song/<id>")]
fn song1(data: &State<Data>, id: SongId) -> Option<SeekStream> { fn song1(data: &State<Data>, id: SongId) -> Option<SeekStream<'_>> {
song(data, id) song(data, id)
} }
#[get("/song/<id>/<_>")] #[get("/song/<id>/<_>")]
fn song2(data: &State<Data>, id: SongId) -> Option<SeekStream> { fn song2(data: &State<Data>, id: SongId) -> Option<SeekStream<'_>> {
song(data, id) song(data, id)
} }
fn song(data: &State<Data>, id: SongId) -> Option<SeekStream> { fn song(data: &State<Data>, id: SongId) -> Option<SeekStream<'_>> {
let db = data.db.lock().unwrap(); let db = data.db.lock().unwrap();
if let Some(song) = db.get_song(&id) { if let Some(song) = db.get_song(&id) {
song.cached_data().cache_data_start_thread(&*db, song); song.cached_data().cache_data_start_thread(&*db, song);