chore: init new addons directory structure

This commit is contained in:
Tsiry Sandratraina
2022-12-11 21:14:22 +03:00
parent 1e3bfcd9e3
commit b8e5db1d99
38 changed files with 324 additions and 419 deletions

View File

@@ -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"

View File

@@ -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]

14
addons/airplay/src/lib.rs Normal file
View File

@@ -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);
}
}

View File

@@ -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]

View File

@@ -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);
}
}

View File

@@ -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]

14
addons/datpiff/src/lib.rs Normal file
View File

@@ -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);
}
}

8
addons/deezer/Cargo.toml Normal file
View File

@@ -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]

14
addons/deezer/src/lib.rs Normal file
View File

@@ -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);
}
}

8
addons/genius/Cargo.toml Normal file
View File

@@ -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]

14
addons/genius/src/lib.rs Normal file
View File

@@ -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);
}
}

8
addons/lastfm/Cargo.toml Normal file
View File

@@ -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]

14
addons/lastfm/src/lib.rs Normal file
View File

@@ -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);
}
}

8
addons/local/Cargo.toml Normal file
View File

@@ -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]

14
addons/local/src/lib.rs Normal file
View File

@@ -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);
}
}

View File

@@ -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]

View File

@@ -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);
}
}

8
addons/myvazo/Cargo.toml Normal file
View File

@@ -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]

14
addons/myvazo/src/lib.rs Normal file
View File

@@ -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);
}
}

View File

@@ -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]

View File

@@ -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);
}
}

View File

@@ -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]

14
addons/spotify/src/lib.rs Normal file
View File

@@ -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);
}
}

View File

@@ -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<dyn std::error::Error>> {
todo!("Implement DatPiff::stream");
}
}

View File

@@ -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<dyn std::error::Error>> {
todo!("Implement Deezer::stream");
}
}

View File

@@ -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<String> {
todo!("Implement get_lyrics for Genius")
}
}

View File

@@ -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;
}
}

View File

@@ -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;

View File

@@ -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<dyn std::error::Error>> {
todo!("Implement Local::stream");
}
}

View File

@@ -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;
}
}

View File

@@ -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<dyn std::error::Error>> {
todo!("Implement MyVazo::stream");
}
}

View File

@@ -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<String> {
todo!("Implement get_lyrics for Tononkira")
}
}

8
addons/tidal/Cargo.toml Normal file
View File

@@ -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]

14
addons/tidal/src/lib.rs Normal file
View File

@@ -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);
}
}

View File

@@ -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]

View File

@@ -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);
}
}

View File

@@ -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]

14
addons/youtube/src/lib.rs Normal file
View File

@@ -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);
}
}