mdd_lib/domain/
track.rs

1use std::path::Path;
2use std::time::SystemTime;
3
4#[derive(Debug, Clone)]
5pub struct Playlist<'a> {
6    pub meta: PlaylistMeta,
7    pub tracks: Vec<&'a Track<'a>>,
8}
9
10#[derive(Debug, Clone)]
11pub struct PlaylistMeta {
12    pub name: String,
13    pub timestamp: SystemTime,
14    pub playlist_source: PlaylistSource,
15}
16
17#[derive(Debug, Clone)]
18pub enum DownloadSource {
19    MyFreeMp3,
20}
21
22#[derive(Debug, Clone)]
23pub enum PlaylistSource {
24    Soundcloud,
25    Spotify,
26}
27
28#[derive(Debug, Clone)]
29pub struct Track<'a> {
30    pub tags: IDv3Tags,
31    pub meta: &'a TrackMeta<'a>,
32}
33
34#[derive(Debug, Clone)]
35pub struct IDv3Tags {
36    pub title: String,
37    pub artists: Vec<String>,
38}
39
40#[derive(Debug, Clone)]
41pub struct TrackMeta<'a> {
42    pub timestamp: SystemTime,
43    pub dl_info: Option<TrackDownloadInfo<'a>>,
44}
45
46#[derive(Debug, Clone)]
47pub struct TrackDownloadInfo<'a> {
48    pub cache_dir: &'a Path,
49    pub dl_source: DownloadSource,
50}