Skip to content

Commit

Permalink
chore: comment out unused fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Ovyerus committed Jul 16, 2024
1 parent e9e756e commit 02904a2
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 31 deletions.
7 changes: 3 additions & 4 deletions src/api/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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,
})
}
Expand Down
18 changes: 9 additions & 9 deletions src/api/structs/digital_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -22,14 +22,14 @@ pub struct DigitalItem {
pub download_type: Option<String>,
pub download_type_str: String,
pub item_type: String,
pub art_id: Option<ArtId>,
// pub art_id: Option<ArtId>,
}

#[derive(Clone, Deserialize, Debug)]
pub struct DigitalItemDownload {
// pub size_mb: Option<String>,
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,
}

Expand Down
36 changes: 18 additions & 18 deletions src/api/structs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand All @@ -35,19 +35,19 @@ pub struct CollectionData {
pub redownload_urls: Option<DownloadsMap>,
}

#[derive(Deserialize, Debug)]
pub struct ItemCache {
pub collection: HashMap<String, CachedItem>,
pub hidden: HashMap<String, CachedItem>,
}
// #[derive(Deserialize, Debug)]
// pub struct ItemCache {
// pub collection: HashMap<String, CachedItem>,
// pub hidden: HashMap<String, CachedItem>,
// }

#[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)]
Expand All @@ -62,8 +62,8 @@ pub struct ParsedItemsData {
pub digital_items: Vec<DigitalItem>,
}

#[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,
// }

0 comments on commit 02904a2

Please sign in to comment.