Compare commits
No commits in common. "f328062ed0fdd8565df5d5f4c5178605532af416" and "60082fda8c6239ea889688d30e728d9dfc59cd87" have entirely different histories.
f328062ed0
...
60082fda8c
7 changed files with 163 additions and 157 deletions
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "bandcamp"
|
name = "bandcamp"
|
||||||
version = "0.3.1"
|
version = "0.2.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
authors = ["ThetaDev <thetadev@magenta.de>"]
|
authors = ["ThetaDev <thetadev@magenta.de>"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use serde_with::{serde_as, DefaultOnNull, NoneAsEmptyString, VecSkipError};
|
use serde_with::{serde_as, NoneAsEmptyString, VecSkipError};
|
||||||
use time::OffsetDateTime;
|
use time::OffsetDateTime;
|
||||||
|
|
||||||
use crate::util;
|
use crate::util;
|
||||||
|
@ -78,7 +78,6 @@ pub struct Album {
|
||||||
pub release_date: OffsetDateTime,
|
pub release_date: OffsetDateTime,
|
||||||
/// List of album tags (genres and locations)
|
/// List of album tags (genres and locations)
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
#[serde_as(deserialize_as = "DefaultOnNull")]
|
|
||||||
pub tags: Vec<Tag>,
|
pub tags: Vec<Tag>,
|
||||||
/// List of album tracks
|
/// List of album tracks
|
||||||
pub tracks: Vec<Track>,
|
pub tracks: Vec<Track>,
|
||||||
|
@ -93,11 +92,14 @@ pub struct Track {
|
||||||
pub track_id: u64,
|
pub track_id: u64,
|
||||||
/// Track title
|
/// Track title
|
||||||
pub title: String,
|
pub title: String,
|
||||||
/// Track album ID
|
/// Numeric album id
|
||||||
///
|
pub album_id: u64,
|
||||||
/// Is None for single tracks
|
/// Album title
|
||||||
pub album_id: Option<u64>,
|
#[serde_as(deserialize_as = "NoneAsEmptyString")]
|
||||||
/// Track artist name (may differ from band name)
|
pub album_title: Option<String>,
|
||||||
|
/// Numeric band id
|
||||||
|
pub band_id: u64,
|
||||||
|
/// Band name
|
||||||
#[serde_as(deserialize_as = "NoneAsEmptyString")]
|
#[serde_as(deserialize_as = "NoneAsEmptyString")]
|
||||||
pub band_name: Option<String>,
|
pub band_name: Option<String>,
|
||||||
/// Duration in seconds
|
/// Duration in seconds
|
||||||
|
@ -110,10 +112,9 @@ pub struct Track {
|
||||||
///
|
///
|
||||||
/// `mp3-128` => `https://bandcamp.com/stream_redirect?enc=mp3-128&track_id=4173325157&ts=1686871135&t=a1f7904205e6caca970009ca6744ef0b512f353a`
|
/// `mp3-128` => `https://bandcamp.com/stream_redirect?enc=mp3-128&track_id=4173325157&ts=1686871135&t=a1f7904205e6caca970009ca6744ef0b512f353a`
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
#[serde_as(deserialize_as = "DefaultOnNull")]
|
|
||||||
pub streaming_url: BTreeMap<String, String>,
|
pub streaming_url: BTreeMap<String, String>,
|
||||||
/// Album track number
|
/// Album track number
|
||||||
pub track_num: Option<u16>,
|
pub track_num: u16,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Discograph (album or track)
|
/// Discograph (album or track)
|
||||||
|
@ -244,7 +245,6 @@ pub struct SearchBand {
|
||||||
pub location: Option<String>,
|
pub location: Option<String>,
|
||||||
/// List of tag names associated with the
|
/// List of tag names associated with the
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
#[serde_as(deserialize_as = "DefaultOnNull")]
|
|
||||||
pub tag_names: Vec<String>,
|
pub tag_names: Vec<String>,
|
||||||
/// Bandcamp URL
|
/// Bandcamp URL
|
||||||
///
|
///
|
||||||
|
@ -314,7 +314,6 @@ pub struct FeedStories {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Bandcamp feed item
|
/// Bandcamp feed item
|
||||||
#[serde_as]
|
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||||
#[non_exhaustive]
|
#[non_exhaustive]
|
||||||
pub struct FeedItem {
|
pub struct FeedItem {
|
||||||
|
@ -358,7 +357,6 @@ pub struct FeedItem {
|
||||||
pub num_streamable_tracks: u16,
|
pub num_streamable_tracks: u16,
|
||||||
/// List of tags
|
/// List of tags
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
#[serde_as(deserialize_as = "DefaultOnNull")]
|
|
||||||
pub tags: Vec<Tag>,
|
pub tags: Vec<Tag>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,83 +71,101 @@ Album(
|
||||||
Track(
|
Track(
|
||||||
track_id: 2221991469,
|
track_id: 2221991469,
|
||||||
title: "Sommarfågel",
|
title: "Sommarfågel",
|
||||||
album_id: Some(2572654767),
|
album_id: 2572654767,
|
||||||
|
album_title: None,
|
||||||
|
band_id: 2464198920,
|
||||||
band_name: Some("Wintergatan"),
|
band_name: Some("Wintergatan"),
|
||||||
duration: 232.642,
|
duration: 232.642,
|
||||||
streaming_url: "[streaming_url]",
|
streaming_url: "[streaming_url]",
|
||||||
track_num: Some(1),
|
track_num: 1,
|
||||||
),
|
),
|
||||||
Track(
|
Track(
|
||||||
track_id: 1593213040,
|
track_id: 1593213040,
|
||||||
title: "The Rocket",
|
title: "The Rocket",
|
||||||
album_id: Some(2572654767),
|
album_id: 2572654767,
|
||||||
|
album_title: None,
|
||||||
|
band_id: 2464198920,
|
||||||
band_name: Some("Wintergatan"),
|
band_name: Some("Wintergatan"),
|
||||||
duration: 211.491,
|
duration: 211.491,
|
||||||
streaming_url: "[streaming_url]",
|
streaming_url: "[streaming_url]",
|
||||||
track_num: Some(2),
|
track_num: 2,
|
||||||
),
|
),
|
||||||
Track(
|
Track(
|
||||||
track_id: 2806652396,
|
track_id: 2806652396,
|
||||||
title: "Valentine",
|
title: "Valentine",
|
||||||
album_id: Some(2572654767),
|
album_id: 2572654767,
|
||||||
|
album_title: None,
|
||||||
|
band_id: 2464198920,
|
||||||
band_name: Some("Wintergatan"),
|
band_name: Some("Wintergatan"),
|
||||||
duration: 238.538,
|
duration: 238.538,
|
||||||
streaming_url: "[streaming_url]",
|
streaming_url: "[streaming_url]",
|
||||||
track_num: Some(3),
|
track_num: 3,
|
||||||
),
|
),
|
||||||
Track(
|
Track(
|
||||||
track_id: 4173325157,
|
track_id: 4173325157,
|
||||||
title: "Slottskogen Disc Golf Club",
|
title: "Slottskogen Disc Golf Club",
|
||||||
album_id: Some(2572654767),
|
album_id: 2572654767,
|
||||||
|
album_title: None,
|
||||||
|
band_id: 2464198920,
|
||||||
band_name: Some("Wintergatan"),
|
band_name: Some("Wintergatan"),
|
||||||
duration: 212.65,
|
duration: 212.65,
|
||||||
streaming_url: "[streaming_url]",
|
streaming_url: "[streaming_url]",
|
||||||
track_num: Some(4),
|
track_num: 4,
|
||||||
),
|
),
|
||||||
Track(
|
Track(
|
||||||
track_id: 3038199534,
|
track_id: 3038199534,
|
||||||
title: "Biking Is Better",
|
title: "Biking Is Better",
|
||||||
album_id: Some(2572654767),
|
album_id: 2572654767,
|
||||||
|
album_title: None,
|
||||||
|
band_id: 2464198920,
|
||||||
band_name: Some("Wintergatan"),
|
band_name: Some("Wintergatan"),
|
||||||
duration: 208.27,
|
duration: 208.27,
|
||||||
streaming_url: "[streaming_url]",
|
streaming_url: "[streaming_url]",
|
||||||
track_num: Some(5),
|
track_num: 5,
|
||||||
),
|
),
|
||||||
Track(
|
Track(
|
||||||
track_id: 3487050701,
|
track_id: 3487050701,
|
||||||
title: "Västanberg",
|
title: "Västanberg",
|
||||||
album_id: Some(2572654767),
|
album_id: 2572654767,
|
||||||
|
album_title: None,
|
||||||
|
band_id: 2464198920,
|
||||||
band_name: Some("Wintergatan"),
|
band_name: Some("Wintergatan"),
|
||||||
duration: 265.692,
|
duration: 265.692,
|
||||||
streaming_url: "[streaming_url]",
|
streaming_url: "[streaming_url]",
|
||||||
track_num: Some(6),
|
track_num: 6,
|
||||||
),
|
),
|
||||||
Track(
|
Track(
|
||||||
track_id: 1604303190,
|
track_id: 1604303190,
|
||||||
title: "Starmachine2000",
|
title: "Starmachine2000",
|
||||||
album_id: Some(2572654767),
|
album_id: 2572654767,
|
||||||
|
album_title: None,
|
||||||
|
band_id: 2464198920,
|
||||||
band_name: Some("Wintergatan"),
|
band_name: Some("Wintergatan"),
|
||||||
duration: 243.139,
|
duration: 243.139,
|
||||||
streaming_url: "[streaming_url]",
|
streaming_url: "[streaming_url]",
|
||||||
track_num: Some(7),
|
track_num: 7,
|
||||||
),
|
),
|
||||||
Track(
|
Track(
|
||||||
track_id: 716010980,
|
track_id: 716010980,
|
||||||
title: "All Was Well",
|
title: "All Was Well",
|
||||||
album_id: Some(2572654767),
|
album_id: 2572654767,
|
||||||
|
album_title: None,
|
||||||
|
band_id: 2464198920,
|
||||||
band_name: Some("Wintergatan"),
|
band_name: Some("Wintergatan"),
|
||||||
duration: 183.224,
|
duration: 183.224,
|
||||||
streaming_url: "[streaming_url]",
|
streaming_url: "[streaming_url]",
|
||||||
track_num: Some(8),
|
track_num: 8,
|
||||||
),
|
),
|
||||||
Track(
|
Track(
|
||||||
track_id: 2322125757,
|
track_id: 2322125757,
|
||||||
title: "Paradis",
|
title: "Paradis",
|
||||||
album_id: Some(2572654767),
|
album_id: 2572654767,
|
||||||
|
album_title: None,
|
||||||
|
band_id: 2464198920,
|
||||||
band_name: Some("Wintergatan"),
|
band_name: Some("Wintergatan"),
|
||||||
duration: 850.6,
|
duration: 850.6,
|
||||||
streaming_url: "[streaming_url]",
|
streaming_url: "[streaming_url]",
|
||||||
track_num: Some(9),
|
track_num: 9,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
|
@ -76,254 +76,310 @@ Album(
|
||||||
Track(
|
Track(
|
||||||
track_id: 3886649117,
|
track_id: 3886649117,
|
||||||
title: "Skyjacks",
|
title: "Skyjacks",
|
||||||
album_id: Some(1493086082),
|
album_id: 1493086082,
|
||||||
|
album_title: None,
|
||||||
|
band_id: 3760769193,
|
||||||
band_name: Some("Arne Parrott"),
|
band_name: Some("Arne Parrott"),
|
||||||
duration: 263.262,
|
duration: 263.262,
|
||||||
streaming_url: "[streaming_url]",
|
streaming_url: "[streaming_url]",
|
||||||
track_num: Some(1),
|
track_num: 1,
|
||||||
),
|
),
|
||||||
Track(
|
Track(
|
||||||
track_id: 3353751902,
|
track_id: 3353751902,
|
||||||
title: "Bound for the Cutting Stone",
|
title: "Bound for the Cutting Stone",
|
||||||
album_id: Some(1493086082),
|
album_id: 1493086082,
|
||||||
|
album_title: None,
|
||||||
|
band_id: 3760769193,
|
||||||
band_name: Some("Arne Parrott"),
|
band_name: Some("Arne Parrott"),
|
||||||
duration: 126.905,
|
duration: 126.905,
|
||||||
streaming_url: "[streaming_url]",
|
streaming_url: "[streaming_url]",
|
||||||
track_num: Some(2),
|
track_num: 2,
|
||||||
),
|
),
|
||||||
Track(
|
Track(
|
||||||
track_id: 814453490,
|
track_id: 814453490,
|
||||||
title: "Harmony",
|
title: "Harmony",
|
||||||
album_id: Some(1493086082),
|
album_id: 1493086082,
|
||||||
|
album_title: None,
|
||||||
|
band_id: 3760769193,
|
||||||
band_name: Some("Arne Parrott"),
|
band_name: Some("Arne Parrott"),
|
||||||
duration: 109.548,
|
duration: 109.548,
|
||||||
streaming_url: "[streaming_url]",
|
streaming_url: "[streaming_url]",
|
||||||
track_num: Some(3),
|
track_num: 3,
|
||||||
),
|
),
|
||||||
Track(
|
Track(
|
||||||
track_id: 3751525198,
|
track_id: 3751525198,
|
||||||
title: "Lighthouse",
|
title: "Lighthouse",
|
||||||
album_id: Some(1493086082),
|
album_id: 1493086082,
|
||||||
|
album_title: None,
|
||||||
|
band_id: 3760769193,
|
||||||
band_name: Some("Arne Parrott"),
|
band_name: Some("Arne Parrott"),
|
||||||
duration: 187.492,
|
duration: 187.492,
|
||||||
streaming_url: "[streaming_url]",
|
streaming_url: "[streaming_url]",
|
||||||
track_num: Some(4),
|
track_num: 4,
|
||||||
),
|
),
|
||||||
Track(
|
Track(
|
||||||
track_id: 461427875,
|
track_id: 461427875,
|
||||||
title: "Dark Magic",
|
title: "Dark Magic",
|
||||||
album_id: Some(1493086082),
|
album_id: 1493086082,
|
||||||
|
album_title: None,
|
||||||
|
band_id: 3760769193,
|
||||||
band_name: Some("Arne Parrott"),
|
band_name: Some("Arne Parrott"),
|
||||||
duration: 67.5178,
|
duration: 67.5178,
|
||||||
streaming_url: "[streaming_url]",
|
streaming_url: "[streaming_url]",
|
||||||
track_num: Some(5),
|
track_num: 5,
|
||||||
),
|
),
|
||||||
Track(
|
Track(
|
||||||
track_id: 694400627,
|
track_id: 694400627,
|
||||||
title: "Way Hay Ho",
|
title: "Way Hay Ho",
|
||||||
album_id: Some(1493086082),
|
album_id: 1493086082,
|
||||||
|
album_title: None,
|
||||||
|
band_id: 3760769193,
|
||||||
band_name: Some("Arne Parrott"),
|
band_name: Some("Arne Parrott"),
|
||||||
duration: 179.318,
|
duration: 179.318,
|
||||||
streaming_url: "[streaming_url]",
|
streaming_url: "[streaming_url]",
|
||||||
track_num: Some(6),
|
track_num: 6,
|
||||||
),
|
),
|
||||||
Track(
|
Track(
|
||||||
track_id: 1856437095,
|
track_id: 1856437095,
|
||||||
title: "Toast the Axel",
|
title: "Toast the Axel",
|
||||||
album_id: Some(1493086082),
|
album_id: 1493086082,
|
||||||
|
album_title: None,
|
||||||
|
band_id: 3760769193,
|
||||||
band_name: Some("Arne Parrott"),
|
band_name: Some("Arne Parrott"),
|
||||||
duration: 101.507,
|
duration: 101.507,
|
||||||
streaming_url: "[streaming_url]",
|
streaming_url: "[streaming_url]",
|
||||||
track_num: Some(7),
|
track_num: 7,
|
||||||
),
|
),
|
||||||
Track(
|
Track(
|
||||||
track_id: 1961563423,
|
track_id: 1961563423,
|
||||||
title: "Ring the Bell",
|
title: "Ring the Bell",
|
||||||
album_id: Some(1493086082),
|
album_id: 1493086082,
|
||||||
|
album_title: None,
|
||||||
|
band_id: 3760769193,
|
||||||
band_name: Some("Arne Parrott"),
|
band_name: Some("Arne Parrott"),
|
||||||
duration: 113.478,
|
duration: 113.478,
|
||||||
streaming_url: "[streaming_url]",
|
streaming_url: "[streaming_url]",
|
||||||
track_num: Some(8),
|
track_num: 8,
|
||||||
),
|
),
|
||||||
Track(
|
Track(
|
||||||
track_id: 405906043,
|
track_id: 405906043,
|
||||||
title: "Call of the Sky",
|
title: "Call of the Sky",
|
||||||
album_id: Some(1493086082),
|
album_id: 1493086082,
|
||||||
|
album_title: None,
|
||||||
|
band_id: 3760769193,
|
||||||
band_name: Some("Arne Parrott"),
|
band_name: Some("Arne Parrott"),
|
||||||
duration: 201.026,
|
duration: 201.026,
|
||||||
streaming_url: "[streaming_url]",
|
streaming_url: "[streaming_url]",
|
||||||
track_num: Some(9),
|
track_num: 9,
|
||||||
),
|
),
|
||||||
Track(
|
Track(
|
||||||
track_id: 3751492440,
|
track_id: 3751492440,
|
||||||
title: "Johnny Forgot His Square Knot",
|
title: "Johnny Forgot His Square Knot",
|
||||||
album_id: Some(1493086082),
|
album_id: 1493086082,
|
||||||
|
album_title: None,
|
||||||
|
band_id: 3760769193,
|
||||||
band_name: Some("Arne Parrott"),
|
band_name: Some("Arne Parrott"),
|
||||||
duration: 58.7233,
|
duration: 58.7233,
|
||||||
streaming_url: "[streaming_url]",
|
streaming_url: "[streaming_url]",
|
||||||
track_num: Some(10),
|
track_num: 10,
|
||||||
),
|
),
|
||||||
Track(
|
Track(
|
||||||
track_id: 3046284392,
|
track_id: 3046284392,
|
||||||
title: "Dance",
|
title: "Dance",
|
||||||
album_id: Some(1493086082),
|
album_id: 1493086082,
|
||||||
|
album_title: None,
|
||||||
|
band_id: 3760769193,
|
||||||
band_name: Some("Arne Parrott"),
|
band_name: Some("Arne Parrott"),
|
||||||
duration: 48.9229,
|
duration: 48.9229,
|
||||||
streaming_url: "[streaming_url]",
|
streaming_url: "[streaming_url]",
|
||||||
track_num: Some(11),
|
track_num: 11,
|
||||||
),
|
),
|
||||||
Track(
|
Track(
|
||||||
track_id: 1075587078,
|
track_id: 1075587078,
|
||||||
title: "Skyjacks (Instrumental)",
|
title: "Skyjacks (Instrumental)",
|
||||||
album_id: Some(1493086082),
|
album_id: 1493086082,
|
||||||
|
album_title: None,
|
||||||
|
band_id: 3760769193,
|
||||||
band_name: Some("Arne Parrott"),
|
band_name: Some("Arne Parrott"),
|
||||||
duration: 263.348,
|
duration: 263.348,
|
||||||
streaming_url: "[streaming_url]",
|
streaming_url: "[streaming_url]",
|
||||||
track_num: Some(12),
|
track_num: 12,
|
||||||
),
|
),
|
||||||
Track(
|
Track(
|
||||||
track_id: 3865632006,
|
track_id: 3865632006,
|
||||||
title: "Bound for the Cutting Stone (Instrumental)",
|
title: "Bound for the Cutting Stone (Instrumental)",
|
||||||
album_id: Some(1493086082),
|
album_id: 1493086082,
|
||||||
|
album_title: None,
|
||||||
|
band_id: 3760769193,
|
||||||
band_name: Some("Arne Parrott"),
|
band_name: Some("Arne Parrott"),
|
||||||
duration: 125.76,
|
duration: 125.76,
|
||||||
streaming_url: "[streaming_url]",
|
streaming_url: "[streaming_url]",
|
||||||
track_num: Some(13),
|
track_num: 13,
|
||||||
),
|
),
|
||||||
Track(
|
Track(
|
||||||
track_id: 951718157,
|
track_id: 951718157,
|
||||||
title: "Lighthouse (Instrumental)",
|
title: "Lighthouse (Instrumental)",
|
||||||
album_id: Some(1493086082),
|
album_id: 1493086082,
|
||||||
|
album_title: None,
|
||||||
|
band_id: 3760769193,
|
||||||
band_name: Some("Arne Parrott"),
|
band_name: Some("Arne Parrott"),
|
||||||
duration: 187.492,
|
duration: 187.492,
|
||||||
streaming_url: "[streaming_url]",
|
streaming_url: "[streaming_url]",
|
||||||
track_num: Some(14),
|
track_num: 14,
|
||||||
),
|
),
|
||||||
Track(
|
Track(
|
||||||
track_id: 1384316860,
|
track_id: 1384316860,
|
||||||
title: "Way Hay Ho (Instrumental)",
|
title: "Way Hay Ho (Instrumental)",
|
||||||
album_id: Some(1493086082),
|
album_id: 1493086082,
|
||||||
|
album_title: None,
|
||||||
|
band_id: 3760769193,
|
||||||
band_name: Some("Arne Parrott"),
|
band_name: Some("Arne Parrott"),
|
||||||
duration: 179.318,
|
duration: 179.318,
|
||||||
streaming_url: "[streaming_url]",
|
streaming_url: "[streaming_url]",
|
||||||
track_num: Some(15),
|
track_num: 15,
|
||||||
),
|
),
|
||||||
Track(
|
Track(
|
||||||
track_id: 1215251403,
|
track_id: 1215251403,
|
||||||
title: "Toast the Axel (Instrumental)",
|
title: "Toast the Axel (Instrumental)",
|
||||||
album_id: Some(1493086082),
|
album_id: 1493086082,
|
||||||
|
album_title: None,
|
||||||
|
band_id: 3760769193,
|
||||||
band_name: Some("Arne Parrott"),
|
band_name: Some("Arne Parrott"),
|
||||||
duration: 101.507,
|
duration: 101.507,
|
||||||
streaming_url: "[streaming_url]",
|
streaming_url: "[streaming_url]",
|
||||||
track_num: Some(16),
|
track_num: 16,
|
||||||
),
|
),
|
||||||
Track(
|
Track(
|
||||||
track_id: 1871038324,
|
track_id: 1871038324,
|
||||||
title: "Ring the Bell (Instrumental)",
|
title: "Ring the Bell (Instrumental)",
|
||||||
album_id: Some(1493086082),
|
album_id: 1493086082,
|
||||||
|
album_title: None,
|
||||||
|
band_id: 3760769193,
|
||||||
band_name: Some("Arne Parrott"),
|
band_name: Some("Arne Parrott"),
|
||||||
duration: 111.769,
|
duration: 111.769,
|
||||||
streaming_url: "[streaming_url]",
|
streaming_url: "[streaming_url]",
|
||||||
track_num: Some(17),
|
track_num: 17,
|
||||||
),
|
),
|
||||||
Track(
|
Track(
|
||||||
track_id: 2289302029,
|
track_id: 2289302029,
|
||||||
title: "Call of the Sky (Instrumental)",
|
title: "Call of the Sky (Instrumental)",
|
||||||
album_id: Some(1493086082),
|
album_id: 1493086082,
|
||||||
|
album_title: None,
|
||||||
|
band_id: 3760769193,
|
||||||
band_name: Some("Arne Parrott"),
|
band_name: Some("Arne Parrott"),
|
||||||
duration: 201.026,
|
duration: 201.026,
|
||||||
streaming_url: "[streaming_url]",
|
streaming_url: "[streaming_url]",
|
||||||
track_num: Some(18),
|
track_num: 18,
|
||||||
),
|
),
|
||||||
Track(
|
Track(
|
||||||
track_id: 1290369552,
|
track_id: 1290369552,
|
||||||
title: "Way Hay Ho (Show Cut)",
|
title: "Way Hay Ho (Show Cut)",
|
||||||
album_id: Some(1493086082),
|
album_id: 1493086082,
|
||||||
|
album_title: None,
|
||||||
|
band_id: 3760769193,
|
||||||
band_name: Some("Arne Parrott"),
|
band_name: Some("Arne Parrott"),
|
||||||
duration: 129.01,
|
duration: 129.01,
|
||||||
streaming_url: "[streaming_url]",
|
streaming_url: "[streaming_url]",
|
||||||
track_num: Some(19),
|
track_num: 19,
|
||||||
),
|
),
|
||||||
Track(
|
Track(
|
||||||
track_id: 1453689011,
|
track_id: 1453689011,
|
||||||
title: "Call of the Sky (Acoustic)",
|
title: "Call of the Sky (Acoustic)",
|
||||||
album_id: Some(1493086082),
|
album_id: 1493086082,
|
||||||
|
album_title: None,
|
||||||
|
band_id: 3760769193,
|
||||||
band_name: Some("Arne Parrott"),
|
band_name: Some("Arne Parrott"),
|
||||||
duration: 196.0,
|
duration: 196.0,
|
||||||
streaming_url: "[streaming_url]",
|
streaming_url: "[streaming_url]",
|
||||||
track_num: Some(20),
|
track_num: 20,
|
||||||
),
|
),
|
||||||
Track(
|
Track(
|
||||||
track_id: 3921099822,
|
track_id: 3921099822,
|
||||||
title: "Lighthouse (Cabin Cut)",
|
title: "Lighthouse (Cabin Cut)",
|
||||||
album_id: Some(1493086082),
|
album_id: 1493086082,
|
||||||
|
album_title: None,
|
||||||
|
band_id: 3760769193,
|
||||||
band_name: Some("Arne Parrott"),
|
band_name: Some("Arne Parrott"),
|
||||||
duration: 113.751,
|
duration: 113.751,
|
||||||
streaming_url: "[streaming_url]",
|
streaming_url: "[streaming_url]",
|
||||||
track_num: Some(21),
|
track_num: 21,
|
||||||
),
|
),
|
||||||
Track(
|
Track(
|
||||||
track_id: 2006464954,
|
track_id: 2006464954,
|
||||||
title: "Otto Van Von Veen",
|
title: "Otto Van Von Veen",
|
||||||
album_id: Some(1493086082),
|
album_id: 1493086082,
|
||||||
|
album_title: None,
|
||||||
|
band_id: 3760769193,
|
||||||
band_name: Some("Arne Parrott"),
|
band_name: Some("Arne Parrott"),
|
||||||
duration: 128.545,
|
duration: 128.545,
|
||||||
streaming_url: "[streaming_url]",
|
streaming_url: "[streaming_url]",
|
||||||
track_num: Some(22),
|
track_num: 22,
|
||||||
),
|
),
|
||||||
Track(
|
Track(
|
||||||
track_id: 3157042890,
|
track_id: 3157042890,
|
||||||
title: "Lighthouse (Duet)",
|
title: "Lighthouse (Duet)",
|
||||||
album_id: Some(1493086082),
|
album_id: 1493086082,
|
||||||
|
album_title: None,
|
||||||
|
band_id: 3760769193,
|
||||||
band_name: Some("Arne Parrott"),
|
band_name: Some("Arne Parrott"),
|
||||||
duration: 166.898,
|
duration: 166.898,
|
||||||
streaming_url: "[streaming_url]",
|
streaming_url: "[streaming_url]",
|
||||||
track_num: Some(23),
|
track_num: 23,
|
||||||
),
|
),
|
||||||
Track(
|
Track(
|
||||||
track_id: 3031409543,
|
track_id: 3031409543,
|
||||||
title: "Call of the Sky (Fan Edition)",
|
title: "Call of the Sky (Fan Edition)",
|
||||||
album_id: Some(1493086082),
|
album_id: 1493086082,
|
||||||
|
album_title: None,
|
||||||
|
band_id: 3760769193,
|
||||||
band_name: Some("Arne Parrott"),
|
band_name: Some("Arne Parrott"),
|
||||||
duration: 201.143,
|
duration: 201.143,
|
||||||
streaming_url: "[streaming_url]",
|
streaming_url: "[streaming_url]",
|
||||||
track_num: Some(24),
|
track_num: 24,
|
||||||
),
|
),
|
||||||
Track(
|
Track(
|
||||||
track_id: 3451672807,
|
track_id: 3451672807,
|
||||||
title: "Call of the Sky 2: The Sequel to Call of the Sky (Instrumental)",
|
title: "Call of the Sky 2: The Sequel to Call of the Sky (Instrumental)",
|
||||||
album_id: Some(1493086082),
|
album_id: 1493086082,
|
||||||
|
album_title: None,
|
||||||
|
band_id: 3760769193,
|
||||||
band_name: Some("Arne Parrott"),
|
band_name: Some("Arne Parrott"),
|
||||||
duration: 78.7156,
|
duration: 78.7156,
|
||||||
streaming_url: "[streaming_url]",
|
streaming_url: "[streaming_url]",
|
||||||
track_num: Some(25),
|
track_num: 25,
|
||||||
),
|
),
|
||||||
Track(
|
Track(
|
||||||
track_id: 2232966671,
|
track_id: 2232966671,
|
||||||
title: "Skyjacks: Call of the Sky Behind the Music Part 1",
|
title: "Skyjacks: Call of the Sky Behind the Music Part 1",
|
||||||
album_id: Some(1493086082),
|
album_id: 1493086082,
|
||||||
|
album_title: None,
|
||||||
|
band_id: 3760769193,
|
||||||
band_name: Some("Arne Parrott"),
|
band_name: Some("Arne Parrott"),
|
||||||
duration: 1957.24,
|
duration: 1957.24,
|
||||||
streaming_url: "[streaming_url]",
|
streaming_url: "[streaming_url]",
|
||||||
track_num: Some(26),
|
track_num: 26,
|
||||||
),
|
),
|
||||||
Track(
|
Track(
|
||||||
track_id: 3477530801,
|
track_id: 3477530801,
|
||||||
title: "Skyjacks: Call of the Sky Behind the Music Part 2",
|
title: "Skyjacks: Call of the Sky Behind the Music Part 2",
|
||||||
album_id: Some(1493086082),
|
album_id: 1493086082,
|
||||||
|
album_title: None,
|
||||||
|
band_id: 3760769193,
|
||||||
band_name: Some("Arne Parrott"),
|
band_name: Some("Arne Parrott"),
|
||||||
duration: 3668.83,
|
duration: 3668.83,
|
||||||
streaming_url: "[streaming_url]",
|
streaming_url: "[streaming_url]",
|
||||||
track_num: Some(27),
|
track_num: 27,
|
||||||
),
|
),
|
||||||
Track(
|
Track(
|
||||||
track_id: 3005668857,
|
track_id: 3005668857,
|
||||||
title: "Skyjacks: Call of the Sky Behind the Music Part 3",
|
title: "Skyjacks: Call of the Sky Behind the Music Part 3",
|
||||||
album_id: Some(1493086082),
|
album_id: 1493086082,
|
||||||
|
album_title: None,
|
||||||
|
band_id: 3760769193,
|
||||||
band_name: Some("Arne Parrott"),
|
band_name: Some("Arne Parrott"),
|
||||||
duration: 3876.74,
|
duration: 3876.74,
|
||||||
streaming_url: "[streaming_url]",
|
streaming_url: "[streaming_url]",
|
||||||
track_num: Some(28),
|
track_num: 28,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
|
@ -31,11 +31,13 @@ Album(
|
||||||
Track(
|
Track(
|
||||||
track_id: 716010980,
|
track_id: 716010980,
|
||||||
title: "All Was Well",
|
title: "All Was Well",
|
||||||
album_id: Some(2572654767),
|
album_id: 2572654767,
|
||||||
|
album_title: None,
|
||||||
|
band_id: 2464198920,
|
||||||
band_name: Some("Wintergatan"),
|
band_name: Some("Wintergatan"),
|
||||||
duration: 183.224,
|
duration: 183.224,
|
||||||
streaming_url: "[streaming_url]",
|
streaming_url: "[streaming_url]",
|
||||||
track_num: Some(8),
|
track_num: 8,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,56 +0,0 @@
|
||||||
---
|
|
||||||
source: tests/tests.rs
|
|
||||||
expression: "&album"
|
|
||||||
---
|
|
||||||
Album(
|
|
||||||
id: 3835153004,
|
|
||||||
title: "Test Me",
|
|
||||||
art_id: Some(269941427),
|
|
||||||
type: t,
|
|
||||||
tralbum_artist: "Cydnee with a C",
|
|
||||||
band: BandInfo(
|
|
||||||
band_id: 3453236550,
|
|
||||||
name: "Cydnee with a C",
|
|
||||||
bio: None,
|
|
||||||
image_id: Some(30619318),
|
|
||||||
location: Some("Los Angeles, California"),
|
|
||||||
),
|
|
||||||
bandcamp_url: "https://cydneewithac.bandcamp.com/track/test-me",
|
|
||||||
credits: Some("Cydnee Jazmere Butler \nJackson Renauld"),
|
|
||||||
about: None,
|
|
||||||
featured_track_id: 3835153004,
|
|
||||||
release_date: 1654905600,
|
|
||||||
tags: [
|
|
||||||
Tag(
|
|
||||||
name: "R&B/Soul",
|
|
||||||
norm_name: "r-b-soul",
|
|
||||||
isloc: false,
|
|
||||||
),
|
|
||||||
Tag(
|
|
||||||
name: "drum and bass",
|
|
||||||
norm_name: "drum-and-bass",
|
|
||||||
isloc: false,
|
|
||||||
),
|
|
||||||
Tag(
|
|
||||||
name: "k-pop",
|
|
||||||
norm_name: "k-pop",
|
|
||||||
isloc: false,
|
|
||||||
),
|
|
||||||
Tag(
|
|
||||||
name: "Los Angeles",
|
|
||||||
norm_name: "los-angeles",
|
|
||||||
isloc: true,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
tracks: [
|
|
||||||
Track(
|
|
||||||
track_id: 3835153004,
|
|
||||||
title: "Test Me",
|
|
||||||
album_id: None,
|
|
||||||
band_name: Some("Cydnee with a C"),
|
|
||||||
duration: 106.667,
|
|
||||||
streaming_url: "[streaming_url]",
|
|
||||||
track_num: None,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
)
|
|
|
@ -81,18 +81,6 @@ async fn album_track() {
|
||||||
check_image(&album.img_url().unwrap()).await;
|
check_image(&album.img_url().unwrap()).await;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
|
||||||
async fn album_track2() {
|
|
||||||
let bc = Bandcamp::new();
|
|
||||||
let album = bc.album_uid("3453236550t3835153004").await.unwrap();
|
|
||||||
|
|
||||||
insta::assert_ron_snapshot!(&album, {
|
|
||||||
".tracks[].streaming_url" => "[streaming_url]"
|
|
||||||
});
|
|
||||||
check_stream_urls(&album.tracks);
|
|
||||||
check_image(&album.img_url().unwrap()).await;
|
|
||||||
}
|
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn search() {
|
async fn search() {
|
||||||
let bc = Bandcamp::new();
|
let bc = Bandcamp::new();
|
||||||
|
|
Loading…
Reference in a new issue