amethyst icon indicating copy to clipboard operation
amethyst copied to clipboard

[FEATURE] Ability to customize media upload servers

Open xeruf opened this issue 1 year ago • 2 comments

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.

xeruf avatar Dec 27 '23 06:12 xeruf

This would really be a great step for decentralization :)

xeruf avatar Jan 15 '24 07:01 xeruf

This is definitely an interesting feature. Seems feasible. Please what do you think, @vitorpamplona ?

KotlinGeekDev avatar Mar 12 '24 15:03 KotlinGeekDev

Please @xeruf do you still need this? Thanks.

KotlinGeekDev avatar May 30 '24 11:05 KotlinGeekDev

Yes please! A really missing feature imo

davotoula avatar May 30 '24 11:05 davotoula

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.

KotlinGeekDev avatar May 30 '24 13:05 KotlinGeekDev

PLease what do you think @davotoula @vitorpamplona ?

KotlinGeekDev avatar May 30 '24 13:05 KotlinGeekDev

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.

vitorpamplona avatar May 30 '24 14:05 vitorpamplona

So @vitorpamplona based on this change you made, we will just invoke sendFileServersList() when the user adds a custom NIP96 server.

KotlinGeekDev avatar May 30 '24 15:05 KotlinGeekDev

Yeah. It could be very similar to how we edit relays right now.

vitorpamplona avatar May 30 '24 15:05 vitorpamplona

Yeah. It could be very similar to how we edit relays right now.

Yeah.

KotlinGeekDev avatar May 30 '24 16:05 KotlinGeekDev

@vitorpamplona I wonder how it could be called in the drawer menu. 'Media Upload', 'Media sharing'?

KotlinGeekDev avatar Jun 05 '24 21:06 KotlinGeekDev

"Media Servers" can be a good caption.

vitorpamplona avatar Jun 05 '24 22:06 vitorpamplona

"Media Servers" can be a good caption.

:+1:

KotlinGeekDev avatar Jun 05 '24 22:06 KotlinGeekDev

@vitorpamplona I also wonder if it should be a global setting or an account-based one.

KotlinGeekDev avatar Jun 10 '24 12:06 KotlinGeekDev

Account based? Personally I could be using two different organisation or company profiles. Or one personal and one corporate?

davotoula avatar Jun 10 '24 12:06 davotoula

Actually since each upload has a drop down different media servers can be defined globally and selected different for each upload?

davotoula avatar Jun 10 '24 12:06 davotoula

Account based? Personally I could be using two different organisation or company profiles. Or one personal and one corporate?

Interesting...

KotlinGeekDev avatar Jun 10 '24 20:06 KotlinGeekDev

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.

KotlinGeekDev avatar Jun 11 '24 01:06 KotlinGeekDev

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.

vitorpamplona avatar Jun 11 '24 01:06 vitorpamplona

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:

KotlinGeekDev avatar Jun 11 '24 08:06 KotlinGeekDev

@vitorpamplona it therefore means we need to modify the fileServer in Account to take in a list instead of one, right?

KotlinGeekDev avatar Jun 11 '24 13:06 KotlinGeekDev

@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()

vitorpamplona avatar Jun 11 '24 13:06 vitorpamplona

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.

KotlinGeekDev avatar Jun 11 '24 13:06 KotlinGeekDev

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

KotlinGeekDev avatar Jun 11 '24 15:06 KotlinGeekDev

Yeah, there is no way to save names on 10096. Maybe we just use the domain name of the URL as a name?

vitorpamplona avatar Jun 11 '24 15:06 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, that's what I went with.

KotlinGeekDev avatar Jun 11 '24 15:06 KotlinGeekDev