feat(offline): implement Last.fm scrobble queue for offline mode

Research findings:
- Last.fm API supports batch scrobbling (up to 50 tracks)
- Timestamps can be backdated up to 14 days

Implementation:
- Add scrobble_queue table to offline database
- Add queue_scrobble, get_queued_scrobbles, mark_scrobbles_sent commands
- Queue scrobbles when offline instead of skipping
- Flush queue automatically when transitioning to online
- Skip scrobbles older than 14 days (Last.fm limit)
- Cleanup sent scrobbles after 7 days
This commit is contained in:
vicrodh committed 2026-01-15 23:24:24 -06:00
1 parent b4af6f6e9f
commit e7f06fcd2f
5 files changed
+400 -27

No files matched your search

+6
View File
@@ -518,6 +518,12 @@ pub fn run() {
offline::commands::get_pending_playlist_count,
offline::commands::mark_pending_playlist_synced,
offline::commands::delete_pending_playlist,
// Scrobble queue commands (for offline Last.fm scrobbling)
offline::commands::queue_scrobble,
offline::commands::get_queued_scrobbles,
offline::commands::mark_scrobbles_sent,
offline::commands::get_queued_scrobble_count,
offline::commands::cleanup_sent_scrobbles,
])
.run(tauri::generate_context!())
.expect("error while running tauri application");