-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
285a411
commit 75d83dd
Showing
7 changed files
with
66 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[package] | ||
name = "sync_dis_boi" | ||
version = "0.2.0" | ||
version = "0.3.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
use std::path::Path; | ||
|
||
use color_eyre::eyre::Result; | ||
use tracing::info; | ||
|
||
use crate::music_api::DynMusicApi; | ||
|
||
pub async fn export(src_api: DynMusicApi, path: &Path, minify: bool) -> Result<()> { | ||
info!("retrieving playlists..."); | ||
let src_playlists = src_api.get_playlists_full().await?; | ||
|
||
info!("exporting playlists..."); | ||
if !minify { | ||
serde_json::to_writer_pretty(std::fs::File::create(path)?, &src_playlists)?; | ||
} else { | ||
serde_json::to_writer(std::fs::File::create(path)?, &src_playlists)?; | ||
} | ||
info!("successfully exported playlists to: {:?}", path); | ||
|
||
Ok(()) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
pub mod export; | ||
pub mod music_api; | ||
pub mod spotify; | ||
pub mod sync; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters