From 02904a2b4dc7dd7e5dbbc6ef9bfea1913cf8419e Mon Sep 17 00:00:00 2001 From: Ovyerus Date: Tue, 16 Jul 2024 19:43:09 +1000 Subject: [PATCH] chore: comment out unused fields --- src/api/mod.rs | 7 +++---- src/api/structs/digital_item.rs | 18 ++++++++--------- src/api/structs/mod.rs | 36 ++++++++++++++++----------------- 3 files changed, 30 insertions(+), 31 deletions(-) diff --git a/src/api/mod.rs b/src/api/mod.rs index 66cf3b1..0a029cc 100644 --- a/src/api/mod.rs +++ b/src/api/mod.rs @@ -22,8 +22,7 @@ use crate::util; pub struct BandcampPage { pub download_urls: DownloadsMap, - // TODO: is this actually used anywhere? - pub page_name: String, + // pub page_name: String, } /// Body used to paginate through Bandcamp's collection API. @@ -158,11 +157,11 @@ impl Api { collection.extend(rest); } - let title = soup.tag("title").find().unwrap().text(); + // let title = soup.tag("title").find().unwrap().text(); debug!("Successfully retrieved all download URLs"); Ok(BandcampPage { - page_name: title, + // page_name: title, download_urls: collection, }) } diff --git a/src/api/structs/digital_item.rs b/src/api/structs/digital_item.rs index 5accf73..bfe4879 100644 --- a/src/api/structs/digital_item.rs +++ b/src/api/structs/digital_item.rs @@ -6,12 +6,12 @@ use std::{collections::HashMap, path::Path}; const FORMAT: &str = "%d %b %Y %T %Z"; -#[derive(Clone, Deserialize, Debug)] -#[serde(untagged)] -pub enum ArtId { - Str(String), - Num(i64), -} +// #[derive(Clone, Deserialize, Debug)] +// #[serde(untagged)] +// pub enum ArtId { +// Str(String), +// Num(i64), +// } #[derive(Clone, Deserialize, Debug)] pub struct DigitalItem { @@ -22,14 +22,14 @@ pub struct DigitalItem { pub download_type: Option, pub download_type_str: String, pub item_type: String, - pub art_id: Option, + // pub art_id: Option, } #[derive(Clone, Deserialize, Debug)] pub struct DigitalItemDownload { // pub size_mb: Option, - pub description: String, - pub encoding_name: String, // Download is chosen by comparing this field and the `format` option. + // pub description: String, + // pub encoding_name: String, // Download is chosen by comparing this field and the `format` option. pub url: String, } diff --git a/src/api/structs/mod.rs b/src/api/structs/mod.rs index de1958d..a0a040a 100644 --- a/src/api/structs/mod.rs +++ b/src/api/structs/mod.rs @@ -17,7 +17,7 @@ pub struct ParsedFanpageData { pub collection_data: CollectionData, /// Data about items in the user's music collection that have been hidden. pub hidden_data: CollectionData, - pub item_cache: ItemCache, + // pub item_cache: ItemCache, } #[derive(Deserialize, Debug)] @@ -35,19 +35,19 @@ pub struct CollectionData { pub redownload_urls: Option, } -#[derive(Deserialize, Debug)] -pub struct ItemCache { - pub collection: HashMap, - pub hidden: HashMap, -} +// #[derive(Deserialize, Debug)] +// pub struct ItemCache { +// pub collection: HashMap, +// pub hidden: HashMap, +// } -#[derive(Deserialize, Debug)] -pub struct CachedItem { - #[serde(deserialize_with = "deserialize_string_from_number")] - pub sale_item_id: String, - pub band_name: String, - pub item_title: String, -} +// #[derive(Deserialize, Debug)] +// pub struct CachedItem { +// #[serde(deserialize_with = "deserialize_string_from_number")] +// pub sale_item_id: String, +// pub band_name: String, +// pub item_title: String, +// } /// Structure of the data returned from Bandcamp's collection API. #[derive(Deserialize, Debug)] @@ -62,8 +62,8 @@ pub struct ParsedItemsData { pub digital_items: Vec, } -#[derive(Deserialize, Debug)] -pub struct ParsedStatDownload { - pub download_url: String, - pub url: String, -} +// #[derive(Deserialize, Debug)] +// pub struct ParsedStatDownload { +// pub download_url: String, +// pub url: String, +// }