mirror of
https://github.com/Dummi26/musicdb.git
synced 2025-12-15 04:16:16 +01:00
chore: update dependencies
This commit is contained in:
@@ -7,10 +7,10 @@ edition = "2021"
|
||||
base64 = "0.22.1"
|
||||
colorize = "0.1.0"
|
||||
playback-rs = { version = "0.4.4", optional = true }
|
||||
rand = "0.8.5"
|
||||
rand = "0.9.2"
|
||||
rc-u8-reader = "2.0.16"
|
||||
rodio = { version = "0.20.1", optional = true }
|
||||
sysinfo = "0.30.12"
|
||||
rodio = { version = "0.21.1", optional = true }
|
||||
sysinfo = "0.37.0"
|
||||
|
||||
[features]
|
||||
default = []
|
||||
|
||||
@@ -39,8 +39,8 @@ impl CacheManager {
|
||||
let sleep_dur_long = Duration::from_secs(20);
|
||||
let sleep_dur_short = Duration::from_secs(1);
|
||||
let mut si = sysinfo::System::new_with_specifics(
|
||||
sysinfo::RefreshKind::new()
|
||||
.with_memory(sysinfo::MemoryRefreshKind::new().with_ram()),
|
||||
sysinfo::RefreshKind::nothing()
|
||||
.with_memory(sysinfo::MemoryRefreshKind::nothing().with_ram()),
|
||||
);
|
||||
eprintln!("[{}] Starting CacheManager", "INFO".cyan());
|
||||
let mut sleep_short = true;
|
||||
@@ -54,7 +54,7 @@ impl CacheManager {
|
||||
});
|
||||
sleep_short = false;
|
||||
// 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 min_avail_mem = min_avail_mem.load(std::sync::atomic::Ordering::Relaxed);
|
||||
let low_memory = available_memory < min_avail_mem;
|
||||
|
||||
@@ -9,7 +9,7 @@ use std::{
|
||||
};
|
||||
|
||||
use colorize::AnsiColor;
|
||||
use rand::thread_rng;
|
||||
use rand::rng;
|
||||
|
||||
use crate::{
|
||||
load::ToFromBytes,
|
||||
@@ -690,7 +690,7 @@ impl Database {
|
||||
}) = elem.content_mut()
|
||||
{
|
||||
let mut ord: Vec<usize> = (0..content.len()).collect();
|
||||
ord.shuffle(&mut thread_rng());
|
||||
ord.shuffle(&mut rng());
|
||||
self.apply_action_unchecked_seq(
|
||||
Action::QueueSetShuffle(path, ord, set_index),
|
||||
client,
|
||||
|
||||
@@ -418,7 +418,7 @@ impl Queue {
|
||||
}
|
||||
|
||||
impl QueueFolder {
|
||||
pub fn iter(&self) -> QueueFolderIter {
|
||||
pub fn iter(&self) -> QueueFolderIter<'_> {
|
||||
QueueFolderIter {
|
||||
folder: self,
|
||||
index: 0,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use std::{ffi::OsStr, sync::Arc};
|
||||
|
||||
use rc_u8_reader::ArcU8Reader;
|
||||
use rodio::{decoder::DecoderError, Decoder, OutputStream, OutputStreamHandle, Sink, Source};
|
||||
use rodio::{decoder::DecoderError, Decoder, OutputStream, Sink, Source};
|
||||
|
||||
use crate::{
|
||||
data::{song::Song, SongId},
|
||||
@@ -13,8 +13,6 @@ use super::PlayerBackend;
|
||||
pub struct PlayerBackendRodio<T> {
|
||||
#[allow(unused)]
|
||||
output_stream: OutputStream,
|
||||
#[allow(unused)]
|
||||
output_stream_handle: OutputStreamHandle,
|
||||
sink: Sink,
|
||||
stopped: bool,
|
||||
current: Option<(SongId, Arc<Vec<u8>>, Option<u128>, T)>,
|
||||
@@ -34,11 +32,11 @@ impl<T> PlayerBackendRodio<T> {
|
||||
pub fn new_with_optional_command_sending(
|
||||
command_sender: Option<std::sync::mpsc::Sender<(Command, Option<u64>)>>,
|
||||
) -> Result<Self, Box<dyn std::error::Error>> {
|
||||
let (output_stream, output_stream_handle) = rodio::OutputStream::try_default()?;
|
||||
let sink = Sink::try_new(&output_stream_handle)?;
|
||||
let output_stream =
|
||||
rodio::OutputStreamBuilder::from_default_device()?.open_stream_or_fallback()?;
|
||||
let sink = Sink::connect_new(&output_stream.mixer());
|
||||
Ok(Self {
|
||||
output_stream,
|
||||
output_stream_handle,
|
||||
sink,
|
||||
stopped: true,
|
||||
current: None,
|
||||
|
||||
@@ -437,7 +437,7 @@ pub fn run_server_caching_thread_opt(
|
||||
pub fn handle_one_connection_as_main(
|
||||
db: Arc<Mutex<Database>>,
|
||||
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>)>,
|
||||
) -> Result<(), std::io::Error> {
|
||||
// sync database
|
||||
|
||||
Reference in New Issue
Block a user