Implemented the remaining methods (happy paths primarily - non-happy paths are hard to predict right now and will mostly be discovered through testing) for AmazonMusicController. This includes the following methods:
toggleLike and toggleDislike: Unlike other methods, theres were simpler and more reliable to do with DOM interaction simulations due to the complex structure and data in the action that would otherwise be required to dispatch. Added a waitForElement util function because the dislike requires opening a context menu that takes time (< 50ms) to open.
getPlayerState: Fairly self-explanatory
getQueue: Main logic here was just getting the queue to load. By default, the queue data is not loaded unless the user opens it up. I added methods to load in the queue and check whether it was loaded. On my machine with fast internet, it takes about 0.75-1 seconds to load. Also added a method to convert the Amazon Music queue items to SynQ SongInfo structure.
isReady: Checked whether the user is a premium member. If they are not, SynQ should not attempt to sync their session.
Overview
Implemented the remaining methods (happy paths primarily - non-happy paths are hard to predict right now and will mostly be discovered through testing) for AmazonMusicController. This includes the following methods:
toggleLike
andtoggleDislike
: Unlike other methods, theres were simpler and more reliable to do with DOM interaction simulations due to the complex structure and data in the action that would otherwise be required to dispatch. Added awaitForElement
util function because the dislike requires opening a context menu that takes time (< 50ms) to open.getPlayerState
: Fairly self-explanatorygetQueue
: Main logic here was just getting the queue to load. By default, the queue data is not loaded unless the user opens it up. I added methods to load in the queue and check whether it was loaded. On my machine with fast internet, it takes about 0.75-1 seconds to load. Also added a method to convert the Amazon Music queue items to SynQ SongInfo structure.isReady
: Checked whether the user is a premium member. If they are not, SynQ should not attempt to sync their session.