A decentralized music tracking and discovery platform built on AT Protocol 🎵

feat: implement data structures and modules for Xata integration

+237
+3
crates/pgpull/src/lib.rs
··· 1 1 use std::env; 2 2 3 + mod repo; 4 + mod xata; 5 + 3 6 use anyhow::Error; 4 7 5 8 pub async fn pull_data() -> Result<(), Error> {
crates/pgpull/src/repo/album.rs

This is a binary file and will not be displayed.

crates/pgpull/src/repo/artist.rs

This is a binary file and will not be displayed.

+6
crates/pgpull/src/repo/mod.rs
··· 1 + pub mod album; 2 + pub mod artist; 3 + pub mod playlist; 4 + pub mod scrobble; 5 + pub mod track; 6 + pub mod user;
crates/pgpull/src/repo/playlist.rs

This is a binary file and will not be displayed.

crates/pgpull/src/repo/scrobble.rs

This is a binary file and will not be displayed.

crates/pgpull/src/repo/track.rs

This is a binary file and will not be displayed.

crates/pgpull/src/repo/user.rs

This is a binary file and will not be displayed.

+21
crates/pgpull/src/xata/album.rs
··· 1 + use chrono::{DateTime, Utc}; 2 + use serde::Deserialize; 3 + 4 + #[derive(Debug, sqlx::FromRow, Deserialize, Clone)] 5 + pub struct Album { 6 + pub xata_id: String, 7 + pub title: String, 8 + pub artist: String, 9 + pub release_date: Option<String>, 10 + pub album_art: Option<String>, 11 + pub year: Option<i32>, 12 + pub spotify_link: Option<String>, 13 + pub tidal_link: Option<String>, 14 + pub youtube_link: Option<String>, 15 + pub apple_music_link: Option<String>, 16 + pub sha256: String, 17 + pub uri: Option<String>, 18 + pub artist_uri: Option<String>, 19 + #[serde(with = "chrono::serde::ts_seconds")] 20 + pub xata_createdat: DateTime<Utc>, 21 + }
+8
crates/pgpull/src/xata/album_track.rs
··· 1 + use serde::Deserialize; 2 + 3 + #[derive(Debug, sqlx::FromRow, Deserialize, Clone)] 4 + pub struct AlbumTrack { 5 + pub xata_id: String, 6 + pub album_id: String, 7 + pub track_id: String, 8 + }
+24
crates/pgpull/src/xata/artist.rs
··· 1 + use chrono::{DateTime, Utc}; 2 + use serde::Deserialize; 3 + 4 + #[derive(Debug, sqlx::FromRow, Deserialize, Clone)] 5 + pub struct Artist { 6 + pub xata_id: String, 7 + pub name: String, 8 + pub biography: Option<String>, 9 + #[serde(with = "chrono::serde::ts_seconds_option")] 10 + pub born: Option<DateTime<Utc>>, 11 + pub born_in: Option<String>, 12 + #[serde(with = "chrono::serde::ts_seconds_option")] 13 + pub died: Option<DateTime<Utc>>, 14 + pub picture: Option<String>, 15 + pub sha256: String, 16 + pub spotify_link: Option<String>, 17 + pub tidal_link: Option<String>, 18 + pub youtube_link: Option<String>, 19 + pub apple_music_link: Option<String>, 20 + pub uri: Option<String>, 21 + pub genres: Option<Vec<String>>, 22 + #[serde(with = "chrono::serde::ts_seconds")] 23 + pub xata_createdat: DateTime<Utc>, 24 + }
+10
crates/pgpull/src/xata/artist_album.rs
··· 1 + use serde::Deserialize; 2 + 3 + #[derive(Debug, sqlx::FromRow, Deserialize, Clone)] 4 + pub struct ArtistAlbum { 5 + pub xata_id: String, 6 + pub artist_id: String, 7 + pub album_id: String, 8 + #[serde(with = "chrono::serde::ts_seconds")] 9 + pub xata_createdat: chrono::DateTime<chrono::Utc>, 10 + }
+10
crates/pgpull/src/xata/artist_track.rs
··· 1 + use serde::Deserialize; 2 + 3 + #[derive(Debug, sqlx::FromRow, Deserialize, Clone)] 4 + pub struct ArtistTrack { 5 + pub xata_id: String, 6 + pub artist_id: String, 7 + pub track_id: String, 8 + #[serde(with = "chrono::serde::ts_seconds")] 9 + pub xata_createdat: chrono::DateTime<chrono::Utc>, 10 + }
+10
crates/pgpull/src/xata/loved_track.rs
··· 1 + use serde::Deserialize; 2 + 3 + #[derive(Debug, sqlx::FromRow, Deserialize, Clone)] 4 + pub struct LovedTrack { 5 + pub xata_id: String, 6 + pub user_id: String, 7 + pub track_id: String, 8 + #[serde(with = "chrono::serde::ts_seconds")] 9 + pub xata_createdat: chrono::DateTime<chrono::Utc>, 10 + }
+15
crates/pgpull/src/xata/mod.rs
··· 1 + pub mod album; 2 + pub mod album_track; 3 + pub mod artist; 4 + pub mod artist_album; 5 + pub mod artist_track; 6 + pub mod loved_track; 7 + pub mod playlist; 8 + pub mod playlist_track; 9 + pub mod scrobble; 10 + pub mod track; 11 + pub mod user; 12 + pub mod user_album; 13 + pub mod user_artist; 14 + pub mod user_playlist; 15 + pub mod user_track;
+19
crates/pgpull/src/xata/playlist.rs
··· 1 + use chrono::{DateTime, Utc}; 2 + use serde::Deserialize; 3 + 4 + #[derive(Debug, sqlx::FromRow, Deserialize, Clone)] 5 + pub struct Playlist { 6 + pub xata_id: String, 7 + pub name: String, 8 + pub description: Option<String>, 9 + pub picture: Option<String>, 10 + pub spotify_link: Option<String>, 11 + pub tidal_link: Option<String>, 12 + pub apple_music_link: Option<String>, 13 + #[serde(with = "chrono::serde::ts_seconds")] 14 + pub xata_createdat: DateTime<Utc>, 15 + #[serde(with = "chrono::serde::ts_seconds")] 16 + pub xata_updatedat: DateTime<Utc>, 17 + pub uri: Option<String>, 18 + pub created_by: String, 19 + }
+11
crates/pgpull/src/xata/playlist_track.rs
··· 1 + use serde::Deserialize; 2 + 3 + #[derive(Debug, sqlx::FromRow, Deserialize, Clone)] 4 + pub struct PlaylistTrack { 5 + pub xata_id: String, 6 + pub playlist_id: String, 7 + pub track_id: String, 8 + pub added_by: String, 9 + #[serde(with = "chrono::serde::ts_seconds")] 10 + pub xata_createdat: chrono::DateTime<chrono::Utc>, 11 + }
+16
crates/pgpull/src/xata/scrobble.rs
··· 1 + use chrono::{DateTime, Utc}; 2 + use serde::Deserialize; 3 + 4 + #[derive(Debug, sqlx::FromRow, Deserialize, Clone)] 5 + pub struct Scrobble { 6 + pub xata_id: String, 7 + pub user_id: String, 8 + pub track_id: String, 9 + pub album_id: Option<String>, 10 + pub artist_id: Option<String>, 11 + pub uri: Option<String>, 12 + #[serde(with = "chrono::serde::ts_seconds")] 13 + pub xata_createdat: DateTime<Utc>, 14 + #[serde(with = "chrono::serde::ts_seconds")] 15 + pub timestamp: DateTime<Utc>, 16 + }
+31
crates/pgpull/src/xata/track.rs
··· 1 + use chrono::{DateTime, Utc}; 2 + use serde::{Deserialize, Serialize}; 3 + 4 + #[derive(Debug, sqlx::FromRow, Serialize, Deserialize, Clone)] 5 + pub struct Track { 6 + pub xata_id: String, 7 + pub title: String, 8 + pub artist: String, 9 + pub album_artist: String, 10 + pub album_art: Option<String>, 11 + pub album: String, 12 + pub track_number: i32, 13 + pub duration: i32, 14 + pub mb_id: Option<String>, 15 + pub youtube_link: Option<String>, 16 + pub spotify_link: Option<String>, 17 + pub tidal_link: Option<String>, 18 + pub apple_music_link: Option<String>, 19 + pub sha256: String, 20 + pub lyrics: Option<String>, 21 + pub composer: Option<String>, 22 + pub genre: Option<String>, 23 + pub disc_number: i32, 24 + pub copyright_message: Option<String>, 25 + pub label: Option<String>, 26 + pub uri: Option<String>, 27 + pub artist_uri: Option<String>, 28 + pub album_uri: Option<String>, 29 + #[serde(with = "chrono::serde::ts_seconds")] 30 + pub xata_createdat: DateTime<Utc>, 31 + }
+13
crates/pgpull/src/xata/user.rs
··· 1 + use chrono::{DateTime, Utc}; 2 + use serde::Deserialize; 3 + 4 + #[derive(Debug, sqlx::FromRow, Deserialize, Clone)] 5 + pub struct User { 6 + pub xata_id: String, 7 + pub display_name: String, 8 + pub did: String, 9 + pub handle: String, 10 + pub avatar: String, 11 + #[serde(with = "chrono::serde::ts_seconds")] 12 + pub xata_createdat: DateTime<Utc>, 13 + }
+10
crates/pgpull/src/xata/user_album.rs
··· 1 + use serde::Deserialize; 2 + 3 + #[derive(Debug, sqlx::FromRow, Deserialize, Clone)] 4 + pub struct UserAlbum { 5 + pub xata_id: String, 6 + pub user_id: String, 7 + pub album_id: String, 8 + #[serde(with = "chrono::serde::ts_seconds")] 9 + pub xata_createdat: chrono::DateTime<chrono::Utc>, 10 + }
+10
crates/pgpull/src/xata/user_artist.rs
··· 1 + use serde::Deserialize; 2 + 3 + #[derive(Debug, sqlx::FromRow, Deserialize, Clone)] 4 + pub struct UserArtist { 5 + pub xata_id: String, 6 + pub user_id: String, 7 + pub artist_id: String, 8 + #[serde(with = "chrono::serde::ts_seconds")] 9 + pub xata_createdat: chrono::DateTime<chrono::Utc>, 10 + }
+10
crates/pgpull/src/xata/user_playlist.rs
··· 1 + use serde::Deserialize; 2 + 3 + #[derive(Debug, sqlx::FromRow, Deserialize, Clone)] 4 + pub struct UserPlaylist { 5 + pub xata_id: String, 6 + pub user_id: String, 7 + pub playlist_id: String, 8 + #[serde(with = "chrono::serde::ts_seconds")] 9 + pub xata_createdat: chrono::DateTime<chrono::Utc>, 10 + }
+10
crates/pgpull/src/xata/user_track.rs
··· 1 + use serde::Deserialize; 2 + 3 + #[derive(Debug, sqlx::FromRow, Deserialize, Clone)] 4 + pub struct UserTrack { 5 + pub xata_id: String, 6 + pub user_id: String, 7 + pub track_id: String, 8 + #[serde(with = "chrono::serde::ts_seconds")] 9 + pub xata_createdat: chrono::DateTime<chrono::Utc>, 10 + }