amethyst
amethyst copied to clipboard
[FEATURE] Ability to customize media upload servers
Is your feature request related to a problem? Please describe. Thanks for the push for NIP-96, highly appreciate it! I want to self-host nostrcheck or void.cat so I can conveniently upload media files to my own server, not depending on external services. Amethyst is already compatible with these, but does not seem to allow customizing the server URL without recompiling
Describe the solution you'd like Ability to add own media hosting server, maybe by choosing an existing API compatibility.
This would really be a great step for decentralization :)
This is definitely an interesting feature. Seems feasible. Please what do you think, @vitorpamplona ?
Please @xeruf do you still need this? Thanks.
Yes please! A really missing feature imo
So we will need to add it in the Settings page. Now the question is if it will replace the current default list, or just be added to it.
PLease what do you think @davotoula @vitorpamplona ?
It should not be at settings. NIP-96 uses event kind 10096 for this. The kind is already being downloaded to LocalCache, we just need a screen to update it and use it on the uploading screens, falling back to the current list if the user hasn't setup yet. You can look at how we did the Relay List setup for DMs (ChatMessageRelayListEvent).
We do need to start merging all of these Account-based settings somewhere. Right now we just have the Relay List in the main left drawer.
So @vitorpamplona based on this change you made, we will just invoke sendFileServersList() when the user adds a custom NIP96 server.
Yeah. It could be very similar to how we edit relays right now.
Yeah. It could be very similar to how we edit relays right now.
Yeah.
@vitorpamplona I wonder how it could be called in the drawer menu. 'Media Upload', 'Media sharing'?
"Media Servers" can be a good caption.
"Media Servers" can be a good caption.
:+1:
@vitorpamplona I also wonder if it should be a global setting or an account-based one.
Account based? Personally I could be using two different organisation or company profiles. Or one personal and one corporate?
Actually since each upload has a drop down different media servers can be defined globally and selected different for each upload?
Account based? Personally I could be using two different organisation or company profiles. Or one personal and one corporate?
Interesting...
We need to use Shared preferences, which complicates things, due to the servers having a name and a URL, except if I use @vitorpamplona 's way of storing it as JSON.
It should be per account to fill in kind 10096 as requested by NIP-96. Kind 10096 then can be used as the options in the server choice on upload dialogs.
We can later add some helper to pre-fill multiple accounts in the same device.
It should be per account to fill in kind 10096 as requested by NIP-96. Kind 10096 then can be used as the options in the server choice on upload dialogs.
We can later add some helper to pre-fill multiple accounts in the same device.
Got it. :+1:
@vitorpamplona it therefore means we need to modify the fileServer in Account to take in a list instead of one, right?
@vitorpamplona it therefore means we need to modify the fileServer in Account to take in a list instead of one, right?
No, that is just the "default" server form the list of server the user has. The app logs the last used server in that field.
Basically, you are trying to replace the Nip96MediaServers.DEFAULT list by the Account.getFileServersList()
No, that is just the "default" server form the list of server the user has. The app logs the last used server in that field.
I see.
Basically, you are trying to replace the Nip96MediaServers.DEFAULT list by the Account.getFileServersList()
Yeah, and use the Default list as a fallback.
Still one question remains: How do we save the labels the user gives to the different servers, assuming there are several of them? There doesn't seem to be a way to save them, since the default list is hard-coded and the app just reads that. cc @vitorpamplona
Yeah, there is no way to save names on 10096. Maybe we just use the domain name of the URL as a name?
Yeah, there is no way to save names on 10096. Maybe we just use the domain name of the URL as a name?
Yeah, that's what I went with.