diff --git a/Cargo.toml b/Cargo.toml index a6a988c..b5546c6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,17 +1,17 @@ [package] name = "songlify" -version = "0.3.3" +version = "0.3.3-beta" edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -teloxide = { version = "0.9.1", features = ["auto-send", "macros"] } +teloxide = { version = "0.9.2", features = ["auto-send", "macros"] } log = "0.4.17" pretty_env_logger = "0.4.0" -tokio = { version = "1.18.2", features = ["rt-multi-thread", "macros"] } +tokio = { version = "1.20.0", features = ["rt-multi-thread", "macros"] } rspotify = { version = "0.11.5", features = ["default"]} -sentry = "0.26.0" +sentry = "0.27.0" invidious = "0.2.1" chrono = "0.4.19" itertools = "0.10.3" diff --git a/src/main.rs b/src/main.rs index e463ee1..7505725 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,17 +1,14 @@ -use log::{debug, info, log, LevelFilter}; +use log::{debug, info, LevelFilter}; use search::spotify; use sentry::ClientInitGuard; use std::env; -use std::process::id; -use std::sync::Arc; use teloxide::prelude::*; use search::spotify::ContentKind::Track; -use search::spotify::{PlayableKind, TrackInfo}; +use search::spotify::TrackInfo; use crate::search::get_spotify_kind; -use crate::spotify::ContentKind; -use search::spotify::ContentKind::{Album, Episode, Playlist, Podcast}; +use search::spotify::ContentKind::{Album, Playlist}; mod search; mod tgformatter; diff --git a/src/search/mod.rs b/src/search/mod.rs index 6579582..1d85b71 100644 --- a/src/search/mod.rs +++ b/src/search/mod.rs @@ -1,6 +1,5 @@ use crate::spotify::{get_entry_kind, AlbumInfo, PlaylistInfo}; use crate::TrackInfo; -use log::info; use spotify::ContentKind; use std::collections::HashSet; use youtube::Video; @@ -89,14 +88,6 @@ impl ArtistComposed for PlaylistItem { } } -// The enum holds all the currently supported type of Id which the engine can search for -#[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub(crate) enum ServiceIdKind { - Spotify(String), - Youtube(String), - Automatic(String), -} - // This struct will allow us in the future to search, cache and store data and metadata regarding // tracks, albums and playlists #[derive(Debug, Clone)] diff --git a/src/search/spotify/mod.rs b/src/search/spotify/mod.rs index 7485b44..5b6e3ca 100644 --- a/src/search/spotify/mod.rs +++ b/src/search/spotify/mod.rs @@ -1,8 +1,7 @@ use rspotify::model::PlayableItem::{Episode, Track}; -use rspotify::model::{AlbumId, FullTrack, PlaylistId, TrackId}; +use rspotify::model::{AlbumId, PlaylistId, TrackId}; use rspotify::prelude::*; use rspotify::{ClientCredsSpotify, Credentials}; -use std::any::Any; use std::sync::Arc; use std::time::Duration; diff --git a/src/tgformatter/mod.rs b/src/tgformatter/mod.rs index 1e7b11b..a4da140 100644 --- a/src/tgformatter/mod.rs +++ b/src/tgformatter/mod.rs @@ -1,13 +1,8 @@ mod utils; use crate::search::{AlbumItem, ArtistComposed, PlaylistItem, TrackItem}; -use crate::TrackInfo; -use log::{info, log}; -use std::borrow::Borrow; use std::collections::HashSet; -use std::fmt::format; use std::time::Duration; -use teloxide::repl; static MAX_ARTISTS_CHARS: usize = 200; @@ -58,7 +53,7 @@ pub(crate) fn format_album_message(album_info: AlbumItem) -> Option { get_artists(boxed_info.clone()) ); - let mut album_genres = get_album_genres(boxed_info.clone()); + let album_genres = get_album_genres(boxed_info.clone()); if album_genres.len() > 0 { reply.push_str(format!("\n💿 Genre(s): {}", itertools::join(&album_genres, ", ")).as_str()); } @@ -74,7 +69,7 @@ pub(crate) fn format_playlist_message(playlist_info: PlaylistItem) -> Option