-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[messages][messagegui] - fix music info handling #4073
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
I'll hold off reviewing / testing until this is out of draft, but with it being a core app I'll tag @gfwilliams in the meanwhile |
|
The current code is working, but I ran into an app where GadgetBridge isn't sending musicinfo even on play/pause (libro.fm), so the music entry/controls aren't showing up. If we could just request the info/state, it would simplify things and reduce the need for writing to flash. (I think?) I see someone else proposed this too (https://codeberg.org/Freeyourgadget/Gadgetbridge/issues/4886), and it wasn't outright rejected, so I might do that this weekend and see if it's accepted, then revise this to use it. --- I don't have access to an apple device though, so that does complicate things a little. |
…sting musicinfo; add settings for expiring old music msg
|
Cool! For that last bit, you could ask in discussions, I think there's a few iPhone users about |
|
I'm really not convinced about requesting state (it feels like a hack to work around a bug somewhere) - I've put some more of my thoughts on this on https://codeberg.org/Freeyourgadget/Gadgetbridge/issues/4886#issuecomment-8622057 edit:
This is kind of what I mean - we should fix this in Gadgetbridge (or maybe it's a libro.fm issue?), and then it'll help everyone using it (even those without a Bangle.js). |
|
@gfwilliams The issue I ran into is how to store the music info/state. We might get the music info, but we lose it unless we store it somewhere. For Libro.fm the issue is audiobook chapters means no new musicinfo for a long time. But even if we had the musicinfo, we lose it as soon as we change apps unless we keep writing to flash. But if you listen to short things like songs or youtube shorts, you change musicinfo ever 30s-3min, so it adds up to a lot of writes to flash. I wouldn't poll for music info/state, just once on opening messagegui... but then I ran into the "No messages" popup needing to be closed or delayed to show the new music info. Little design choices started adding up beyond what I was comfortable with. Edit: oooh, wait... Just write to flash on kill events maybe? Set up the kill event handler in the listener and some flag that it was already set up. 🤦 |
…age; and then save to json on kill
|
I've updated this with logic to store the music in the Then This still has a debug method in it to count number of times it writes to file--so not really ready for review/merge. Just here for info purposes for now. |
Yes - to be honest I thought this is what happened already! The idea was always that But I've just looked into this, and as you say, that doesn't happen. I think it might be the return statement here? https://github.com/espruino/BangleApps/blob/master/apps/messagegui/lib.js#L41 So I'm not sure at what point we stopped storing those and why - it looks like it might have slipped in (perhaps even as a typo) as part of 2a506e7 So ideally, I'd really like to try and fix that rather than having code that deliberately extracts the music messages from the messages list and then writes it into a separate file. |
|
I just tried it, and it does feel like literally just removing that one line ( You can send music updates from the Web IDE by pasting in: And then you can use |
|
Just to add, the whole edit: Assuming that removing |
Closing this: The fix requires design choices, so I'll just log an issue and let someone else decide. :P