Skip to content

Conversation

richard-hajek
Copy link
Contributor

In the home screen, in the "recently played" section, I quite often see duplicates, this fixes it.

Note that I did not test this on phone, only on desktop, as I didn't manage to get uploading builds to android work yet

@richard-hajek
Copy link
Contributor Author

Also, this is my first Dart programming experience, and the performance / stability / any other invariants of the new code are also not tested and I cannot reason about them. Feel free to close this if the code is bad

@KRTirtho
Copy link
Owner

That's an impressive fix. No worries, as it's a dart side fix only and for UI, it'll work on every platform

But that's just a patch on the underlying bug. I probably made some mistake in the RecentlyPlayedItemNotifier where I query the unique recent history from SQLite.

@KRTirtho KRTirtho changed the base branch from master to dev January 30, 2025 15:56
@KRTirtho
Copy link
Owner

KRTirtho commented Jan 30, 2025

Also, it's a not a good idea to do data transformation in the build method of flutter. It can slow down the render process if the data is too large
Usually useMemoized (from flutter_hooks. Same as React.useMemo for reference) is used for caching the result and only changing when something changes related to the data

@richard-hajek
Copy link
Contributor Author

Okay, thank you for the feedback!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants