Skip to content
This repository was archived by the owner on Jul 30, 2025. It is now read-only.

Fixed problems with Album sync #5549

Merged
merged 7 commits into from
Jan 31, 2025
Merged

Conversation

twistios
Copy link

@twistios twistios commented Jan 31, 2025

  • fixes some problems related to album sync
  • fixes explicit icon missing in certain cases (at least) (the explicit icon is added at an appropriate place, so songs that already have none might not get fixed, also it does not work for radio,...)

Also:

  • added an improved check for if the device is connected to the network (internet)
  • maybe it can replace isNetworkAvailable (and similar method)

This was created in cooperation with @aneesh1122.

- added an improved check for if the device is connected to the network (internet)
- maybe can replace `isNetworkAvailable` (and similar method)
- not a perfect fix, but it (can) ensures that the prefix is added to the title if it is missing
Summary:
- fix "should not sync": if no network connection (breaks because it cannot fetch the album) or it should not sync (invalid syncing)
- fix "album disappears": related to above problem
- added (helper) data class `AlbumSongsState`: used to restore state related to song
- code improvements: formatting, performance (idea by me, code by @aneesh1122)
Performance optimisation:
- was running the "album insertion code" for each song (only required once)
- now code is only run once per album-update
@fast4x
Copy link
Owner

fast4x commented Jan 31, 2025

Why added new func isNetworkConnected, if just present isNetworkAvailable fun ?

@twistios
Copy link
Author

twistios commented Jan 31, 2025

Why added new func isNetworkConnected, if just present isNetworkAvailable fun ?

isNetworkAvailable is not doing what I need (It does not actually check that the network is connected to the internet).
If you think that I can fix this method instead of using a new one, then I can do that.
I did not want to break it (maybe there was some intention why it is like this)

@fast4x
Copy link
Owner

fast4x commented Jan 31, 2025

Ok good answer, thanks

@twistios
Copy link
Author

So should I fix the other method or let it like this?

@twistios
Copy link
Author

twistios commented Jan 31, 2025

There is still some other small change I need to add.

Edit: Done.

@twistios twistios marked this pull request as draft January 31, 2025 13:32
@twistios twistios marked this pull request as ready for review January 31, 2025 13:45
@fast4x fast4x merged commit e840f2c into fast4x:master Jan 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants