Open 0xcaff opened 6 years ago
Started working on this. You can see work in refactor/playback.
PlaybackArtworkContainer will be useful when creating PlaybackArtistArtwork. (#7)
Some additional problems we need to consider:
Figure out loading when already loading. If something is already loading and another loading is started, the first loading should be cancelled (or at least its result should be ignored).
Dynamic loading is possible, but it isn't used anywhere. Use it.
It doesn't look like PlaybackArtwork handles rendering a loading animation.
So I've thought about how to solve 1.
Each instance of PlaybackArtworkContainer
will have an identifier.
The state will hold the currently loading item's instance identifier.
Start Loading
The start loading action will be dispatched when loading has been started. It will have the instance identifier of the PlaybackArtworkContainer
. Updates the currently loading item's instance identifier.
Done Loading The done loading action will be dispatched when loading has completed or failed. If for the last loading item's instance identifier, set the loading state to not loading. It will also have an action which will be dispatched if the id passed in the action is the same as the currently loading item.
The queue won't change until loading is complete. Nothing needs to be changed with the UI. The loading animation (2) could be the ripple effect from spinkit. http://tobiasahlin.com/spinkit/
Currently PlaybackArtworkContainer is a PlaybackArtwork wrapped with a redux enhancer. Its only usage is inside a PlaybackAlbumArtwork.
Problems