[PR #220] [MERGED] Use ttl cache instead of lru #672

Closed
opened 2026-03-02 23:49:19 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/aome510/spotify-player/pull/220
Author: @aome510
Created: 7/15/2023
Status: Merged
Merged: 7/15/2023
Merged by: @aome510

Base: masterHead: use-ttl-cache


📝 Commits (2)

  • 978bd1b replace lru with ttl_cache
  • 5278b78 update the cache usage to ttl_cache functions

📊 Changes

10 files changed (+82 additions, -68 deletions)

View changed files

📝 Cargo.lock (+17 -31)
📝 spotify_player/Cargo.toml (+1 -1)
📝 spotify_player/src/client/handlers.rs (+1 -1)
📝 spotify_player/src/client/mod.rs (+40 -16)
📝 spotify_player/src/event/page.rs (+1 -1)
📝 spotify_player/src/event/window.rs (+1 -1)
📝 spotify_player/src/state/data.rs (+17 -12)
📝 spotify_player/src/state/mod.rs (+0 -1)
📝 spotify_player/src/ui/page.rs (+3 -3)
📝 spotify_player/src/ui/playback.rs (+1 -1)

📄 Description

Replace lru cache with ttl cache.

Context

Using ttl cache avoids the problem that the cached Spotify data becomes invalid after sometimes. For example, daily mix playlist changes the list of tracks everyday, hence playing a song from the cached playlist won't work.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/aome510/spotify-player/pull/220 **Author:** [@aome510](https://github.com/aome510) **Created:** 7/15/2023 **Status:** ✅ Merged **Merged:** 7/15/2023 **Merged by:** [@aome510](https://github.com/aome510) **Base:** `master` ← **Head:** `use-ttl-cache` --- ### 📝 Commits (2) - [`978bd1b`](https://github.com/aome510/spotify-player/commit/978bd1b46e5aae24174ae4e8e2395d7411065778) replace `lru` with `ttl_cache` - [`5278b78`](https://github.com/aome510/spotify-player/commit/5278b78bcc132fbb62901e2c859021c69cb161c3) update the cache usage to `ttl_cache` functions ### 📊 Changes **10 files changed** (+82 additions, -68 deletions) <details> <summary>View changed files</summary> 📝 `Cargo.lock` (+17 -31) 📝 `spotify_player/Cargo.toml` (+1 -1) 📝 `spotify_player/src/client/handlers.rs` (+1 -1) 📝 `spotify_player/src/client/mod.rs` (+40 -16) 📝 `spotify_player/src/event/page.rs` (+1 -1) 📝 `spotify_player/src/event/window.rs` (+1 -1) 📝 `spotify_player/src/state/data.rs` (+17 -12) 📝 `spotify_player/src/state/mod.rs` (+0 -1) 📝 `spotify_player/src/ui/page.rs` (+3 -3) 📝 `spotify_player/src/ui/playback.rs` (+1 -1) </details> ### 📄 Description Replace `lru` cache with `ttl` cache. ## Context Using `ttl` cache avoids the problem that the cached Spotify data becomes invalid after sometimes. For example, daily mix playlist changes the list of tracks everyday, hence playing a song from the cached playlist won't work. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 23:49:19 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify-player#672
No description provided.