Skip to content

Commit

Permalink
Update Rust dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Marekkon5 committed Aug 29, 2024
1 parent 8acf8dc commit f760174
Show file tree
Hide file tree
Showing 23 changed files with 646 additions and 1,243 deletions.
1,757 changes: 588 additions & 1,169 deletions Cargo.lock

Large diffs are not rendered by default.

15 changes: 6 additions & 9 deletions crates/onetagger-autotag/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,22 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
zip = "0.6"
log = "0.4"
regex = "1.7"
regex = "1.10"
dunce = "1.0"
image = "0.24"
rodio = "0.17"
image = "0.25"
anyhow = "1.0"
chrono = "0.4"
base64 = "0.21"
base64 = "0.22"
execute = "0.2"
walkdir = "2.3"
tempfile = "3.8"
walkdir = "2.5"
libloading = "0.8"
serde_json = "1.0"
lazy_static = "1.4"
lazy_static = "1.5"
crossbeam-channel = "0.5"

serde = { version = "1.0", features = ["derive"] }
reqwest = { version = "0.11", features = ["json", "blocking", "rustls-tls"], default-features = false }
reqwest = { version = "0.12", features = ["json", "blocking", "rustls-tls"], default-features = false }

songrec = { git = "https://github.com/Marekkon5/SongRec.git" }

Expand Down
6 changes: 3 additions & 3 deletions crates/onetagger-autotag/src/platforms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ use std::sync::{Arc, Mutex};
use base64::Engine;
use libloading::{Library, Symbol};
use onetagger_platforms::{beatport, junodownload, spotify, traxsource, discogs, itunes, musicbrainz, beatsource, bpmsupreme, bandcamp, deezer, musixmatch};
use image::io::Reader as ImageReader;
use image::ImageOutputFormat;
use image::{ImageFormat, ImageReader};
use onetagger_shared::Settings;
use onetagger_tagger::custom::MatchTrackResult;
use onetagger_tagger::{AutotaggerSourceBuilder, PlatformInfo, AutotaggerSource, TaggerConfig, AudioFileInfo, Track, SupportedTag, TrackMatch, ConfigCallbackResponse};
use serde::{Serialize, Deserialize};

lazy_static::lazy_static! {
/// Globally loaded all platforms
Expand Down Expand Up @@ -88,7 +88,7 @@ impl AutotaggerPlatforms {
fn reencode_image(data: &[u8]) -> Result<String, Error> {
let img = ImageReader::new(Cursor::new(data)).with_guessed_format()?.decode()?;
let mut buf = vec![];
img.write_to(&mut Cursor::new(&mut buf), ImageOutputFormat::Png)?;
img.write_to(&mut Cursor::new(&mut buf), ImageFormat::Png)?;
Ok(format!("data:image/png;charset=utf-8;base64,{}", base64::engine::general_purpose::STANDARD.encode(buf)))
}

Expand Down
2 changes: 1 addition & 1 deletion crates/onetagger-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ anyhow = "1.0"
serde_json = "1.0"
convert_case = "0.6"

clap = { version = "4.1", features = ["derive"] }
clap = { version = "4.5", features = ["derive"] }

onetagger-ui = { path = "../onetagger-ui" }
onetagger-tagger = { path = "../onetagger-tagger" }
Expand Down
13 changes: 5 additions & 8 deletions crates/onetagger-platforms/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,18 @@ edition = "2021"

[dependencies]
log = "0.4"
url = "2.2"
url = "2.5"
rand = "0.8"
regex = "1.5"
regex = "1.10"
anyhow = "1.0"
scraper = "0.18"
scraper = "0.20"
serde_json = "1.0"
minify-html = "0.15"

serde = { version = "1.0", features = ["derive"] }
chrono = { version = "0.4", features = ["serde"] }
reqwest = { version = "0.11", features = ["json", "blocking", "rustls-tls"], default-features = false }
# rspotify = { version = "0.12", features = ["client-ureq", "ureq-rustls-tls"], default-features = false }

# tmp fix for https://github.com/ramsayleung/rspotify/issues/452
rspotify = { git = "https://github.com/Marekkon5/rspotify.git", branch = "artistf32", features = ["client-ureq", "ureq-rustls-tls"], default-features = false }
reqwest = { version = "0.12", features = ["json", "blocking", "rustls-tls"], default-features = false }
rspotify = { version = "0.13", features = ["client-ureq", "ureq-rustls-tls"], default-features = false }


onetagger-tag = { path = "../onetagger-tag" }
Expand Down
1 change: 1 addition & 0 deletions crates/onetagger-platforms/src/bandcamp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use onetagger_tagger::{supported_tags, AudioFileInfo, AutotaggerSource, Autotagg
use reqwest::blocking::Client;
use scraper::{Html, Selector};
use serde_json::{json, Value};
use serde::{Serialize, Deserialize};

pub struct Bandcamp {
client: Client
Expand Down
1 change: 1 addition & 0 deletions crates/onetagger-platforms/src/deezer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use chrono::NaiveDate;
use onetagger_tagger::{Track, AutotaggerSourceBuilder, PlatformInfo, TaggerConfig, AutotaggerSource, PlatformCustomOptions, PlatformCustomOptionValue, AudioFileInfo, MatchingUtils, TrackNumber, supported_tags, TrackMatch};
use reqwest::blocking::Client;
use serde::de::DeserializeOwned;
use serde::{Serialize, Deserialize};

/// Rate limit error code
const RATE_LIMIT_CODE: i32 = 4;
Expand Down
2 changes: 1 addition & 1 deletion crates/onetagger-platforms/src/spotify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ fn full_track_to_track(track: FullTrack) -> Track {
release_year: track.album.release_date.as_ref().map(|d| if d.len() > 4 { d[0..4].to_string().parse().ok() } else { None }).flatten(),
release_date: track.album.release_date.as_ref().map(|d| NaiveDate::parse_from_str(d, "%Y-%m-%d").ok()).flatten(),
explicit: Some(track.explicit),
thumbnail: track.album.images.iter().min_by(|a, b| a.width.unwrap_or(1000.0).partial_cmp(&b.width.unwrap_or(1000.0)).unwrap()).map(|i| i.url.to_string()),
thumbnail: track.album.images.iter().min_by(|a, b| a.width.unwrap_or(1000).partial_cmp(&b.width.unwrap_or(1000)).unwrap()).map(|i| i.url.to_string()),
..Default::default()
}
}
Expand Down
8 changes: 3 additions & 5 deletions crates/onetagger-player/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ edition = "2021"
log = "0.4"
alac = "0.5"
hound = "3.5"
lofty = "0.21"
anyhow = "1.0"
lofty = "0.17"
pacmog = "0.4.1"
pacmog = "0.4.2"
mp4parse = "0.17"

rodio = { version = "0.17", features = ["symphonia-aac", "symphonia-isomp4", "symphonia-mp3"] }

onetagger-shared = { path = "../onetagger-shared" }
rodio = { version = "0.19", features = ["symphonia-aac", "symphonia-isomp4", "symphonia-mp3"] }

2 changes: 1 addition & 1 deletion crates/onetagger-player/src/aiff.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use std::path::{Path, PathBuf};
use anyhow::Error;
use lofty::file::AudioFile;
use std::fs::File;
use std::io::Read;
use std::time::Duration;
use lofty::AudioFile;
use pacmog::PcmReader;
use rodio::Source;

Expand Down
2 changes: 1 addition & 1 deletion crates/onetagger-player/src/mp3.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::path::{Path, PathBuf};
use anyhow::Error;
use lofty::AudioFile;
use lofty::file::AudioFile;
use std::io::BufReader;
use std::fs::File;
use rodio::{Source, Decoder};
Expand Down
2 changes: 1 addition & 1 deletion crates/onetagger-player/src/ogg.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use std::time::Duration;
use anyhow::Error;
use lofty::file::AudioFile;
use std::path::{PathBuf, Path};
use std::io::BufReader;
use std::fs::File;
use lofty::AudioFile;
use rodio::{Source, Decoder};

use crate::AudioSource;
Expand Down
4 changes: 2 additions & 2 deletions crates/onetagger-playlist/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ base64 = "0.21"
urlencoding = "2.1"

serde = { version = "1.0", features = ["derive"] }
onetagger-tag = { path = "../onetagger-tag" }
onetagger-shared = { path = "../onetagger-shared" }

onetagger-tag = { path = "../onetagger-tag" }
8 changes: 4 additions & 4 deletions crates/onetagger-renamer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ edition = "2021"
log = "0.4"
pad = "0.1"
dunce = "1.0"
regex = "1.7"
regex = "1.10"
anyhow = "1.0"
titlecase = "2.2"
lazy_static = "1.4"
pulldown-cmark = "0.9"
titlecase = "3.3"
lazy_static = "1.5"
pulldown-cmark = "0.12"

serde = { version = "1.0", features = ["derive"] }

Expand Down
4 changes: 2 additions & 2 deletions crates/onetagger-shared/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ log = "0.4"
anyhow = "1.0"
chrono = "0.4"
backtrace = "0.3"
crossterm = "0.27"
crossterm = "0.28"
serde_json = "1.0"
directories = "5.0"
lazy_static = "1.4"
lazy_static = "1.5"

fern = { version = "0.6", features = ["colored"] }
serde = { version = "1.0", features = ["derive"] }
4 changes: 1 addition & 3 deletions crates/onetagger-tag/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@
#[cfg(feature = "tag")]
#[macro_use] extern crate anyhow;

use serde::de::Visitor;
use serde::{Serialize, Deserialize, Serializer, Deserializer};
use std::ops::{Deref, DerefMut};
use serde::{Serialize, Deserialize};
use std::path::PathBuf;
use std::time::Duration;
use anyhow::Error;
Expand Down
18 changes: 6 additions & 12 deletions crates/onetagger-tag/src/wav.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use anyhow::Error;
use std::io::{BufReader, BufWriter, Cursor};
use std::io::{BufReader, BufWriter, Cursor, Seek, SeekFrom};
use std::fs::File;
use std::collections::HashMap;
use std::path::Path;
Expand Down Expand Up @@ -153,8 +153,7 @@ pub(crate) fn read_wav(path: impl AsRef<Path>) -> Result<Tag, Error> {
offset += chunk.len() as u64;
}

// Resolve nested chunks because SOME apps do that, also find ID3 chunk
let mut id3 = None;
// Resolve nested chunks because SOME apps do that
let mut new_chunks = vec![];
for chunk in chunks {
// Resolve nested
Expand All @@ -164,18 +163,13 @@ pub(crate) fn read_wav(path: impl AsRef<Path>) -> Result<Tag, Error> {
}
continue;
}
// Resolve ID3
if id3.is_none() && (chunk.id() == ID3_ID_1 || chunk.id() == ID3_ID_2) {
let data = chunk.read_contents(&mut file)?;
id3 = Tag::read_from(&data[..]).ok();
continue;
}

new_chunks.push(chunk);
}
let chunks = new_chunks;
// Create default if invalid
let mut id3 = id3.unwrap_or(Tag::new());

// Read ID3 using the new ID3 reader
file.seek(SeekFrom::Start(0))?;
let mut id3 = Tag::read_from2(&mut file).unwrap_or(Tag::new());

// Copy tags from RIFF to ID3 if missing
for (frame_name, chunk_id) in ID3_RIFF.iter() {
Expand Down
4 changes: 2 additions & 2 deletions crates/onetagger-tagger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ edition = "2021"

[dependencies]
log = "0.4"
regex = "1.7"
regex = "1.10"
anyhow = "1.0"
strsim = "0.10"
strsim = "0.11"
unidecode = "0.3"
serde_json = "1.0"

Expand Down
11 changes: 5 additions & 6 deletions crates/onetagger-ui/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ edition = "2021"
log = "0.4"
mime = "0.3"
dunce = "1.0"
trash = "4.0"
trash = "5.1"
image = "0.25"
anyhow = "1.0"
opener = "0.6"
opener = "0.7"
base64 = "0.22"
walkdir = "2.3"
tempfile = "3.3"
serde_json = "1.0"
webbrowser = "0.8"
webbrowser = "1.0"
mime_guess = "2.0"
urlencoding = "2.1"
include_dir = "0.7"
Expand All @@ -25,7 +24,7 @@ tinyfiledialogs = "3.9"

axum = { version = "0.7", features = ["ws"] }
serde = { version = "1.0", features = ["derive"] }
tokio = { version = "1.35", features = ["rt-multi-thread"] }
tokio = { version = "1.39", features = ["rt-multi-thread"] }

onetagger-tag = { path = "../onetagger-tag" }
onetagger-shared = { path = "../onetagger-shared" }
Expand All @@ -38,5 +37,5 @@ onetagger-platforms = { path = "../onetagger-platforms" }

# Windows specific
[target.'cfg(windows)'.dependencies]
sysinfo = "0.30"
sysinfo = "0.31"

3 changes: 1 addition & 2 deletions crates/onetagger-ui/src/quicktag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ use std::fs::read_dir;
use std::path::Path;
use std::io::Cursor;
use walkdir::WalkDir;
use image::ImageFormat;
use image::io::Reader as ImageReader;
use image::{ImageFormat, ImageReader};
use serde::{Deserialize, Serialize};
use onetagger_tag::{AudioFileFormat, Field, Tag, EXTENSIONS, TagSeparators};
use onetagger_playlist::{UIPlaylist, get_files_from_playlist_file};
Expand Down
2 changes: 1 addition & 1 deletion crates/onetagger-ui/src/tageditor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::collections::HashMap;
use std::path::{Path, PathBuf};
use base64::Engine;
use serde::{Serialize, Deserialize};
use image::{GenericImageView, io::Reader as ImageReader};
use image::{GenericImageView, ImageReader};

use onetagger_tag::{AudioFileFormat, CoverType, Picture, Tag};
use onetagger_tag::id3::{ID3Comment, ID3Popularimeter};
Expand Down
8 changes: 4 additions & 4 deletions crates/onetagger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ log = "0.4"
anyhow = "1.0"
urlencoding = "2.1"

tao = { version = "0.24", features = ["rwh_05"] }
wry = { version = "0.35", features = ["devtools"] }
clap = { version = "4.1", features = ["derive"] }
tao = { version = "0.29", features = ["rwh_05"] }
wry = { version = "0.42", features = ["devtools"] }
clap = { version = "4.5", features = ["derive"] }
serde = { version = "1.0", features = ["derive"] }

onetagger-ui = { path = "../onetagger-ui" }
Expand All @@ -31,7 +31,7 @@ winres = "0.1"

# MacOS specific
[target.'cfg(target_os = "macos")'.dependencies]
muda = "0.11"
muda = "0.14"
native-dialog = "0.7.0"


Expand Down
12 changes: 6 additions & 6 deletions crates/onetagger/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use anyhow::Error;
use clap::Parser;
use std::path::PathBuf;
use onetagger_shared::Settings;
use wry::{WebViewBuilder, FileDropEvent, WebContext};
use wry::{DragDropEvent, WebContext, WebViewBuilder};
use tao::dpi::{Size, PhysicalSize};
use tao::event::{StartCause, Event, WindowEvent};
use tao::event_loop::{EventLoopBuilder, ControlFlow};
Expand Down Expand Up @@ -175,14 +175,14 @@ pub fn start_webview() -> Result<(), Error> {

// Configure
let mut webview = builder
.with_url(&format!("http://127.0.0.1:{PORT}/"))?
.with_url(&format!("http://127.0.0.1:{PORT}/"))
.with_devtools(Settings::load().map(|s| s.devtools()).unwrap_or(false))
.with_ipc_handler(move |message| {
let proxy = &p;
if message == "devtools" {
if message.body() == "devtools" {
proxy.send_event(CustomWindowEvent::DevTools).ok();
}
if message == "exit" {
if message.body() == "exit" {
proxy.send_event(CustomWindowEvent::Exit).ok();
}
})
Expand Down Expand Up @@ -210,9 +210,9 @@ pub fn start_webview() -> Result<(), Error> {

// Handle dropped folders (for all other than Windows)
if cfg!(not(target_os = "windows")) {
webview = webview.with_file_drop_handler(move |event| {
webview = webview.with_drag_drop_handler(move |event| {
match event {
FileDropEvent::Dropped { mut paths, .. } => {
DragDropEvent::Drop { mut paths, .. } => {
if paths.len() > 1 || paths.is_empty() {
warn!("Drop only 1 path!");
return true;
Expand Down

0 comments on commit f760174

Please sign in to comment.