diff --git a/Cargo.toml b/Cargo.toml index 790bb5c8..17d33375 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,6 +31,22 @@ members = [ "webui/musicplayer/src-tauri" ] +exclude = [ + "addons/airplay", + "addons/chromecast", + "addons/datpiff", + "addons/deezer", + "addons/genius", + "addons/lastfm", + "addons/local", + "addons/musicbrainz", + "addons/myvazo", + "addons/soundcloud", + "addons/spotify", + "addons/youtube", + "addons/tidal", +] + [[bin]] name = "music-player" path = "src/main.rs" diff --git a/addons/airplay/Cargo.toml b/addons/airplay/Cargo.toml new file mode 100644 index 00000000..8d55d928 --- /dev/null +++ b/addons/airplay/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "music-player-airplay-addon" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/addons/airplay/src/lib.rs b/addons/airplay/src/lib.rs new file mode 100644 index 00000000..7d12d9af --- /dev/null +++ b/addons/airplay/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} diff --git a/addons/chromecast/Cargo.toml b/addons/chromecast/Cargo.toml new file mode 100644 index 00000000..7a7a6625 --- /dev/null +++ b/addons/chromecast/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "music-player-chromecast-addon" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/addons/chromecast/src/lib.rs b/addons/chromecast/src/lib.rs new file mode 100644 index 00000000..7d12d9af --- /dev/null +++ b/addons/chromecast/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} diff --git a/addons/datpiff/Cargo.toml b/addons/datpiff/Cargo.toml new file mode 100644 index 00000000..6b4462dd --- /dev/null +++ b/addons/datpiff/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "music-player-datpiff-addon" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/addons/datpiff/src/lib.rs b/addons/datpiff/src/lib.rs new file mode 100644 index 00000000..7d12d9af --- /dev/null +++ b/addons/datpiff/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} diff --git a/addons/deezer/Cargo.toml b/addons/deezer/Cargo.toml new file mode 100644 index 00000000..7cfb1f29 --- /dev/null +++ b/addons/deezer/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "music-player-deezer-addon" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/addons/deezer/src/lib.rs b/addons/deezer/src/lib.rs new file mode 100644 index 00000000..7d12d9af --- /dev/null +++ b/addons/deezer/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} diff --git a/addons/genius/Cargo.toml b/addons/genius/Cargo.toml new file mode 100644 index 00000000..5f685c59 --- /dev/null +++ b/addons/genius/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "music-player-genius-addon" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/addons/genius/src/lib.rs b/addons/genius/src/lib.rs new file mode 100644 index 00000000..7d12d9af --- /dev/null +++ b/addons/genius/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} diff --git a/addons/lastfm/Cargo.toml b/addons/lastfm/Cargo.toml new file mode 100644 index 00000000..1fe72540 --- /dev/null +++ b/addons/lastfm/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "music-player-lastfm-addon" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/addons/lastfm/src/lib.rs b/addons/lastfm/src/lib.rs new file mode 100644 index 00000000..7d12d9af --- /dev/null +++ b/addons/lastfm/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} diff --git a/addons/local/Cargo.toml b/addons/local/Cargo.toml new file mode 100644 index 00000000..976bee7d --- /dev/null +++ b/addons/local/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "music-player-local-addon" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/addons/local/src/lib.rs b/addons/local/src/lib.rs new file mode 100644 index 00000000..7d12d9af --- /dev/null +++ b/addons/local/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} diff --git a/addons/musicbrainz/Cargo.toml b/addons/musicbrainz/Cargo.toml new file mode 100644 index 00000000..60b5e110 --- /dev/null +++ b/addons/musicbrainz/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "music-player-musicbrainz-addon" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/addons/musicbrainz/src/lib.rs b/addons/musicbrainz/src/lib.rs new file mode 100644 index 00000000..7d12d9af --- /dev/null +++ b/addons/musicbrainz/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} diff --git a/addons/myvazo/Cargo.toml b/addons/myvazo/Cargo.toml new file mode 100644 index 00000000..d789e4ad --- /dev/null +++ b/addons/myvazo/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "music-player-myvazo-addon" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/addons/myvazo/src/lib.rs b/addons/myvazo/src/lib.rs new file mode 100644 index 00000000..7d12d9af --- /dev/null +++ b/addons/myvazo/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} diff --git a/addons/soundcloud/Cargo.toml b/addons/soundcloud/Cargo.toml new file mode 100644 index 00000000..2a1ab63b --- /dev/null +++ b/addons/soundcloud/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "music-player-soundcloud-addon" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/addons/soundcloud/src/lib.rs b/addons/soundcloud/src/lib.rs new file mode 100644 index 00000000..7d12d9af --- /dev/null +++ b/addons/soundcloud/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} diff --git a/addons/spotify/Cargo.toml b/addons/spotify/Cargo.toml new file mode 100644 index 00000000..af18994d --- /dev/null +++ b/addons/spotify/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "music-player-spotify-addon" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/addons/spotify/src/lib.rs b/addons/spotify/src/lib.rs new file mode 100644 index 00000000..7d12d9af --- /dev/null +++ b/addons/spotify/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} diff --git a/addons/src/datpiff.rs b/addons/src/datpiff.rs deleted file mode 100644 index 2eecc491..00000000 --- a/addons/src/datpiff.rs +++ /dev/null @@ -1,53 +0,0 @@ -use super::{Addon, StreamingAddon}; - -pub struct DatPiff { - name: String, - version: String, - author: String, - description: String, - enabled: bool, -} - -impl DatPiff { - pub fn new() -> Self { - Self { - name: "DatPiff".to_string(), - version: "0.1.0".to_string(), - author: "Tsiry Sandratraina".to_string(), - description: "DatPiff addon".to_string(), - enabled: true, - } - } -} - -impl Addon for DatPiff { - fn name(&self) -> &str { - &self.name - } - - fn version(&self) -> &str { - &self.version - } - - fn author(&self) -> &str { - &self.author - } - - fn description(&self) -> &str { - &self.description - } - - fn enabled(&self) -> bool { - self.enabled - } - - fn set_enabled(&mut self, enabled: bool) { - self.enabled = enabled; - } -} - -impl StreamingAddon for DatPiff { - fn stream(&self, url: &str) -> Result<(), Box> { - todo!("Implement DatPiff::stream"); - } -} diff --git a/addons/src/deezer.rs b/addons/src/deezer.rs deleted file mode 100644 index c963d4b5..00000000 --- a/addons/src/deezer.rs +++ /dev/null @@ -1,53 +0,0 @@ -use super::{Addon, StreamingAddon}; - -pub struct Deezer { - name: String, - version: String, - author: String, - description: String, - enabled: bool, -} - -impl Deezer { - pub fn new() -> Self { - Self { - name: "Deezer".to_string(), - version: "0.1.0".to_string(), - author: "Tsiry Sandratraina".to_string(), - description: "Deezer addon".to_string(), - enabled: true, - } - } -} - -impl Addon for Deezer { - fn name(&self) -> &str { - &self.name - } - - fn version(&self) -> &str { - &self.version - } - - fn author(&self) -> &str { - &self.author - } - - fn description(&self) -> &str { - &self.description - } - - fn enabled(&self) -> bool { - self.enabled - } - - fn set_enabled(&mut self, enabled: bool) { - self.enabled = enabled; - } -} - -impl StreamingAddon for Deezer { - fn stream(&self, url: &str) -> Result<(), Box> { - todo!("Implement Deezer::stream"); - } -} diff --git a/addons/src/genius.rs b/addons/src/genius.rs deleted file mode 100644 index b6a340dc..00000000 --- a/addons/src/genius.rs +++ /dev/null @@ -1,53 +0,0 @@ -use super::{Addon, LyricsAddon}; - -pub struct Genius { - name: String, - version: String, - author: String, - description: String, - enabled: bool, -} - -impl Genius { - pub fn new() -> Self { - Self { - name: "Genius".to_string(), - version: "0.1.0".to_string(), - author: "Tsiry Sandratraina".to_string(), - description: "Genius addon".to_string(), - enabled: true, - } - } -} - -impl Addon for Genius { - fn name(&self) -> &str { - &self.name - } - - fn version(&self) -> &str { - &self.version - } - - fn author(&self) -> &str { - &self.author - } - - fn description(&self) -> &str { - &self.description - } - - fn enabled(&self) -> bool { - self.enabled - } - - fn set_enabled(&mut self, enabled: bool) { - self.enabled = enabled; - } -} - -impl LyricsAddon for Genius { - fn get_lyrics(&self, artist: &str, title: &str) -> Option { - todo!("Implement get_lyrics for Genius") - } -} diff --git a/addons/src/lastfm.rs b/addons/src/lastfm.rs deleted file mode 100644 index 959eb16e..00000000 --- a/addons/src/lastfm.rs +++ /dev/null @@ -1,47 +0,0 @@ -use super::Addon; - -pub struct Lastfm { - name: String, - version: String, - author: String, - description: String, - enabled: bool, -} - -impl Lastfm { - pub fn new() -> Self { - Self { - name: "Last.fm".to_string(), - version: "0.1.0".to_string(), - author: "Tsiry Sandratraina".to_string(), - description: "Last.fm addon".to_string(), - enabled: true, - } - } -} - -impl Addon for Lastfm { - fn name(&self) -> &str { - &self.name - } - - fn version(&self) -> &str { - &self.version - } - - fn author(&self) -> &str { - &self.author - } - - fn description(&self) -> &str { - &self.description - } - - fn enabled(&self) -> bool { - self.enabled - } - - fn set_enabled(&mut self, enabled: bool) { - self.enabled = enabled; - } -} diff --git a/addons/src/lib.rs b/addons/src/lib.rs index 6acf529b..cb7f277d 100644 --- a/addons/src/lib.rs +++ b/addons/src/lib.rs @@ -1,10 +1,3 @@ -pub mod datpiff; -pub mod deezer; -pub mod genius; -pub mod local; -pub mod myvazo; -pub mod tononkira; - pub trait Addon { fn name(&self) -> &str; fn version(&self) -> &str; diff --git a/addons/src/local.rs b/addons/src/local.rs deleted file mode 100644 index 5ac7bca9..00000000 --- a/addons/src/local.rs +++ /dev/null @@ -1,53 +0,0 @@ -use super::{Addon, StreamingAddon}; - -pub struct Local { - name: String, - version: String, - author: String, - description: String, - enabled: bool, -} - -impl Local { - pub fn new() -> Self { - Self { - name: "Local".to_string(), - version: "0.1.0".to_string(), - author: "Tsiry Sandratraina".to_string(), - description: "Local addon".to_string(), - enabled: true, - } - } -} - -impl Addon for Local { - fn name(&self) -> &str { - &self.name - } - - fn version(&self) -> &str { - &self.version - } - - fn author(&self) -> &str { - &self.author - } - - fn description(&self) -> &str { - &self.description - } - - fn enabled(&self) -> bool { - self.enabled - } - - fn set_enabled(&mut self, enabled: bool) { - self.enabled = enabled; - } -} - -impl StreamingAddon for Local { - fn stream(&self, url: &str) -> Result<(), Box> { - todo!("Implement Local::stream"); - } -} diff --git a/addons/src/musicbrainz.rs b/addons/src/musicbrainz.rs deleted file mode 100644 index 5edfd590..00000000 --- a/addons/src/musicbrainz.rs +++ /dev/null @@ -1,47 +0,0 @@ -use super::Addon; - -pub struct Musicbrainz { - name: String, - version: String, - author: String, - description: String, - enabled: bool, -} - -impl Musicbrainz { - pub fn new() -> Self { - Self { - name: "Musicbrainz".to_string(), - version: "0.1.0".to_string(), - author: "Tsiry Sandratraina".to_string(), - description: "Musicbrainz addon".to_string(), - enabled: true, - } - } -} - -impl Addon for Musicbrainz { - fn name(&self) -> &str { - &self.name - } - - fn version(&self) -> &str { - &self.version - } - - fn author(&self) -> &str { - &self.author - } - - fn description(&self) -> &str { - &self.description - } - - fn enabled(&self) -> bool { - self.enabled - } - - fn set_enabled(&mut self, enabled: bool) { - self.enabled = enabled; - } -} diff --git a/addons/src/myvazo.rs b/addons/src/myvazo.rs deleted file mode 100644 index 6a27cd2b..00000000 --- a/addons/src/myvazo.rs +++ /dev/null @@ -1,53 +0,0 @@ -use super::{Addon, StreamingAddon}; - -pub struct MyVazo { - name: String, - version: String, - author: String, - description: String, - enabled: bool, -} - -impl MyVazo { - pub fn new() -> Self { - Self { - name: "MyVazo".to_string(), - version: "0.1.0".to_string(), - author: "Tsiry Sandratraina".to_string(), - description: "MyVazo addon".to_string(), - enabled: true, - } - } -} - -impl Addon for MyVazo { - fn name(&self) -> &str { - &self.name - } - - fn version(&self) -> &str { - &self.version - } - - fn author(&self) -> &str { - &self.author - } - - fn description(&self) -> &str { - &self.description - } - - fn enabled(&self) -> bool { - self.enabled - } - - fn set_enabled(&mut self, enabled: bool) { - self.enabled = enabled; - } -} - -impl StreamingAddon for MyVazo { - fn stream(&self, url: &str) -> Result<(), Box> { - todo!("Implement MyVazo::stream"); - } -} diff --git a/addons/src/tononkira.rs b/addons/src/tononkira.rs deleted file mode 100644 index dedc7af7..00000000 --- a/addons/src/tononkira.rs +++ /dev/null @@ -1,53 +0,0 @@ -use super::{Addon, LyricsAddon}; - -pub struct Tononkira { - name: String, - version: String, - author: String, - description: String, - enabled: bool, -} - -impl Tononkira { - pub fn new() -> Self { - Self { - name: "Tononkira".to_string(), - version: "0.1.0".to_string(), - author: "Tsiry Sandratraina".to_string(), - description: "Tononkira addon".to_string(), - enabled: true, - } - } -} - -impl Addon for Tononkira { - fn name(&self) -> &str { - &self.name - } - - fn version(&self) -> &str { - &self.version - } - - fn author(&self) -> &str { - &self.author - } - - fn description(&self) -> &str { - &self.description - } - - fn enabled(&self) -> bool { - self.enabled - } - - fn set_enabled(&mut self, enabled: bool) { - self.enabled = enabled; - } -} - -impl LyricsAddon for Tononkira { - fn get_lyrics(&self, artist: &str, title: &str) -> Option { - todo!("Implement get_lyrics for Tononkira") - } -} diff --git a/addons/tidal/Cargo.toml b/addons/tidal/Cargo.toml new file mode 100644 index 00000000..4cf17f38 --- /dev/null +++ b/addons/tidal/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "music-player-tidal-addon" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/addons/tidal/src/lib.rs b/addons/tidal/src/lib.rs new file mode 100644 index 00000000..7d12d9af --- /dev/null +++ b/addons/tidal/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} diff --git a/addons/tononkira/Cargo.toml b/addons/tononkira/Cargo.toml new file mode 100644 index 00000000..a00f1feb --- /dev/null +++ b/addons/tononkira/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "music-player-tononkira-addon" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/addons/tononkira/src/lib.rs b/addons/tononkira/src/lib.rs new file mode 100644 index 00000000..7d12d9af --- /dev/null +++ b/addons/tononkira/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +} diff --git a/addons/youtube/Cargo.toml b/addons/youtube/Cargo.toml new file mode 100644 index 00000000..f91485a3 --- /dev/null +++ b/addons/youtube/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "music-player-youtube-addon" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] diff --git a/addons/youtube/src/lib.rs b/addons/youtube/src/lib.rs new file mode 100644 index 00000000..7d12d9af --- /dev/null +++ b/addons/youtube/src/lib.rs @@ -0,0 +1,14 @@ +pub fn add(left: usize, right: usize) -> usize { + left + right +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn it_works() { + let result = add(2, 2); + assert_eq!(result, 4); + } +}