mirror of
https://github.com/Serial-ATA/lofty-rs
synced 2025-03-04 14:57:17 +00:00
Remove lewton and ogg as dependencies
Signed-off-by: Serial <69764315+Serial-ATA@users.noreply.github.com>
This commit is contained in:
parent
4498e04068
commit
f75e693b7d
5 changed files with 2 additions and 86 deletions
37
Cargo.lock
generated
37
Cargo.lock
generated
|
@ -306,17 +306,6 @@ version = "1.4.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
||||
|
||||
[[package]]
|
||||
name = "lewton"
|
||||
version = "0.10.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "777b48df9aaab155475a83a7df3070395ea1ac6902f5cd062b8f2b028075c030"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
"ogg",
|
||||
"tinyvec",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.93"
|
||||
|
@ -333,12 +322,10 @@ dependencies = [
|
|||
"criterion",
|
||||
"filepath",
|
||||
"id3",
|
||||
"lewton",
|
||||
"lofty_attr",
|
||||
"metaflac",
|
||||
"mp3-duration",
|
||||
"mp4ameta",
|
||||
"ogg",
|
||||
"ogg_pager",
|
||||
"riff",
|
||||
"thiserror",
|
||||
|
@ -443,15 +430,6 @@ dependencies = [
|
|||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ogg"
|
||||
version = "0.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6951b4e8bf21c8193da321bcce9c9dd2e13c858fe078bf9054a288b419ae5d6e"
|
||||
dependencies = [
|
||||
"byteorder",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "ogg_pager"
|
||||
version = "0.1.3"
|
||||
|
@ -700,21 +678,6 @@ dependencies = [
|
|||
"serde_json",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tinyvec"
|
||||
version = "1.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "5b5220f05bb7de7f3f53c7c065e1199b3172696fe2db9f9c4d8ad9b4ee74c342"
|
||||
dependencies = [
|
||||
"tinyvec_macros",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tinyvec_macros"
|
||||
version = "0.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
|
||||
|
||||
[[package]]
|
||||
name = "unicode-width"
|
||||
version = "0.1.8"
|
||||
|
|
|
@ -21,8 +21,6 @@ filepath = { version = "0.1.1", optional = true } # wav/aiff only supports paths
|
|||
mp3-duration = {version = "0.1.10", optional = true} # Duration
|
||||
# Ogg
|
||||
ogg_pager = { version = "0.1.3", optional = true, git = "https://github.com/Serial-ATA/lofty-rs" }
|
||||
lewton = {version = "0.10.2", optional = true} # Decoding
|
||||
ogg = {version = "0.8.0", optional = true} # Encoding
|
||||
# Mp4
|
||||
mp4ameta = {version = "0.10.2", optional = true}
|
||||
# Flac
|
||||
|
@ -41,7 +39,7 @@ full = ["all_tags", "duration"]
|
|||
format-mp4 = ["mp4ameta"]
|
||||
format-flac = ["metaflac"]
|
||||
format-opus = ["ogg_pager"]
|
||||
format-vorbis = ["lewton", "ogg", "ogg_pager"]
|
||||
format-vorbis = ["ogg_pager"]
|
||||
format-ape = ["ape"]
|
||||
format-id3 = ["id3", "filepath"]
|
||||
format-riff = ["riff"]
|
||||
|
|
|
@ -31,10 +31,8 @@ All these great projects helped make this crate possible. (*Sorted alphabeticall
|
|||
|
||||
* [**ape**](https://github.com/rossnomann/rust-ape)
|
||||
* [**id3**](https://github.com/polyfloyd/rust-id3)
|
||||
* [**lewton**](https://github.com/RustAudio/lewton)
|
||||
* [**metaflac**](https://github.com/jameshurst/rust-metaflac)
|
||||
* [**mp4ameta**](https://github.com/Saecki/rust-mp4ameta)
|
||||
* [**ogg**](https://github.com/RustAudio/ogg)
|
||||
* [**opus_headers**](https://github.com/zaethan/opus_headers)
|
||||
* [**riff**](https://github.com/frabert/riff)
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@ use crate::components::logic::ogg::read::OGGTags;
|
|||
|
||||
use lofty_attr::impl_tag;
|
||||
|
||||
use lewton::inside_ogg::OggStreamReader;
|
||||
use std::borrow::Cow;
|
||||
use std::collections::HashMap;
|
||||
use std::convert::{TryFrom, TryInto};
|
||||
|
@ -99,43 +98,7 @@ impl VorbisInnerTag {
|
|||
#[impl_tag(VorbisInnerTag, TagType::Ogg(OggFormat::Vorbis))]
|
||||
pub struct VorbisTag;
|
||||
|
||||
#[cfg(feature = "format-vorbis")]
|
||||
impl TryFrom<lewton::inside_ogg::OggStreamReader<File>> for VorbisTag {
|
||||
type Error = LoftyError;
|
||||
|
||||
fn try_from(inp: OggStreamReader<File>) -> Result<Self> {
|
||||
let mut tag = Self::default();
|
||||
|
||||
let mut comments = inp.comment_hdr.comment_list;
|
||||
|
||||
let mut pictures: Vec<Picture> = Vec::new();
|
||||
|
||||
if let Some(p) = comments
|
||||
.iter()
|
||||
.position(|(k, _)| *k == "METADATA_BLOCK_PICTURE")
|
||||
{
|
||||
let kv = comments.remove(p);
|
||||
if let Ok(pic) = Picture::from_apic_bytes(&kv.1.as_bytes()) {
|
||||
pictures.push(pic)
|
||||
}
|
||||
}
|
||||
|
||||
tag.inner = VorbisInnerTag {
|
||||
format: Some(OggFormat::Vorbis),
|
||||
vendor: inp.comment_hdr.vendor,
|
||||
comments: comments.into_iter().collect(),
|
||||
pictures: if pictures.is_empty() {
|
||||
None
|
||||
} else {
|
||||
Some(Cow::from(pictures))
|
||||
},
|
||||
};
|
||||
|
||||
Ok(tag)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "format-opus")]
|
||||
#[cfg(any(feature = "format-opus", feature = "format-vorbis"))]
|
||||
impl TryFrom<OGGTags> for VorbisTag {
|
||||
type Error = LoftyError;
|
||||
|
||||
|
|
|
@ -48,12 +48,6 @@ pub enum LoftyError {
|
|||
/// Any error from [`mp4ameta`]
|
||||
#[error(transparent)]
|
||||
Mp4Tag(#[from] mp4ameta::Error),
|
||||
/// Any error from [`lewton`]
|
||||
#[error(transparent)]
|
||||
Lewton(#[from] lewton::VorbisError),
|
||||
/// Any error from [`ogg`]
|
||||
#[error(transparent)]
|
||||
Ogg(#[from] ogg::OggReadError),
|
||||
/// Errors that arrist while parsing OGG pages
|
||||
#[error(transparent)]
|
||||
OggPage(#[from] ogg_pager::PageError),
|
||||
|
|
Loading…
Add table
Reference in a new issue