A Wrapped / Replay like for teal.fm and rocksky.app (currently on hiatus)
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: truncate timestamps to seconds when duplicate checking

Mia 8e5615b2 f4328051

+6 -49
-48
Cargo.lock
··· 352 352 checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" 353 353 354 354 [[package]] 355 - name = "aws-lc-rs" 356 - version = "1.15.1" 357 - source = "registry+https://github.com/rust-lang/crates.io-index" 358 - checksum = "6b5ce75405893cd713f9ab8e297d8e438f624dde7d706108285f7e17a25a180f" 359 - dependencies = [ 360 - "aws-lc-sys", 361 - "zeroize", 362 - ] 363 - 364 - [[package]] 365 - name = "aws-lc-sys" 366 - version = "0.34.0" 367 - source = "registry+https://github.com/rust-lang/crates.io-index" 368 - checksum = "179c3777a8b5e70e90ea426114ffc565b2c1a9f82f6c4a0c5a34aa6ef5e781b6" 369 - dependencies = [ 370 - "cc", 371 - "cmake", 372 - "dunce", 373 - "fs_extra", 374 - ] 375 - 376 - [[package]] 377 355 name = "axum" 378 356 version = "0.8.6" 379 357 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 791 769 checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" 792 770 793 771 [[package]] 794 - name = "cmake" 795 - version = "0.1.54" 796 - source = "registry+https://github.com/rust-lang/crates.io-index" 797 - checksum = "e7caa3f9de89ddbe2c607f4101924c5abec803763ae9534e4f4d7d8f84aa81f0" 798 - dependencies = [ 799 - "cc", 800 - ] 801 - 802 - [[package]] 803 772 name = "colorchoice" 804 773 version = "1.0.4" 805 774 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1161 1130 ] 1162 1131 1163 1132 [[package]] 1164 - name = "dunce" 1165 - version = "1.0.5" 1166 - source = "registry+https://github.com/rust-lang/crates.io-index" 1167 - checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" 1168 - 1169 - [[package]] 1170 1133 name = "dyn-clone" 1171 1134 version = "1.0.20" 1172 1135 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1394 1357 ] 1395 1358 1396 1359 [[package]] 1397 - name = "fs_extra" 1398 - version = "1.3.0" 1399 - source = "registry+https://github.com/rust-lang/crates.io-index" 1400 - checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" 1401 - 1402 - [[package]] 1403 1360 name = "funty" 1404 1361 version = "2.0.0" 1405 1362 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 1871 1828 "hyper", 1872 1829 "hyper-util", 1873 1830 "rustls", 1874 - "rustls-native-certs", 1875 1831 "rustls-pki-types", 1876 1832 "tokio", 1877 1833 "tokio-rustls", ··· 2697 2653 "base64", 2698 2654 "http-body-util", 2699 2655 "hyper", 2700 - "hyper-rustls", 2701 2656 "hyper-util", 2702 2657 "indexmap 2.12.0", 2703 2658 "ipnet", 2704 2659 "metrics", 2705 2660 "metrics-util", 2706 2661 "quanta", 2707 - "rustls", 2708 2662 "thiserror 2.0.17", 2709 2663 "tokio", 2710 2664 "tracing", ··· 3788 3742 source = "registry+https://github.com/rust-lang/crates.io-index" 3789 3743 checksum = "533f54bc6a7d4f647e46ad909549eda97bf5afc1585190ef692b4286b198bd8f" 3790 3744 dependencies = [ 3791 - "aws-lc-rs", 3792 3745 "once_cell", 3793 3746 "ring", 3794 3747 "rustls-pki-types", ··· 3825 3778 source = "registry+https://github.com/rust-lang/crates.io-index" 3826 3779 checksum = "2ffdfa2f5286e2247234e03f680868ac2815974dc39e00ea15adc445d0aafe52" 3827 3780 dependencies = [ 3828 - "aws-lc-rs", 3829 3781 "ring", 3830 3782 "rustls-pki-types", 3831 3783 "untrusted",
+1 -1
Cargo.toml
··· 20 20 jacquard-identity = { version = "0.9.2", features = ["cache"] } 21 21 jacquard-lexicon = "0.9.2" 22 22 metrics = "0.24.3" 23 - metrics-exporter-prometheus = "0.18.0" 23 + metrics-exporter-prometheus = { version = "0.18.0", default-features = false, features = ["http-listener"] } 24 24 r2d2 = "0.8" 25 25 reqwest = "0.12.24" 26 26 serde = { version = "1.0.228", features = ["derive"] }
+5
src/ingest/scrobbles.rs
··· 1 1 use crate::mbz::{FindMbzData, try_find_mbz_data}; 2 2 use chrono::prelude::*; 3 + use chrono::{DurationRound, TimeDelta}; 3 4 use duckdb::{Connection, DuckdbConnectionManager, OptionalExt, params}; 4 5 use jacquard::types::datetime::Datetime; 5 6 use jacquard_api::app_rocksky::scrobble::Scrobble as RockskyScrobble; ··· 123 124 track: &str, 124 125 created: DateTime<Utc>, 125 126 ) -> duckdb::Result<Option<String>> { 127 + // try to round the timestamp down to just seconds - if it fails, just use the og timestamp. 128 + let created = created 129 + .duration_trunc(TimeDelta::seconds(1)) 130 + .unwrap_or(created); 126 131 let mut stmt = conn.prepare_cached( 127 132 "SELECT rkey FROM scrobbles WHERE did = $1 AND track_name = $2 AND created_at = $3", 128 133 )?;