-
Notifications
You must be signed in to change notification settings - Fork 16
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
RfE: Provide a simplified Media upload api #62
Comments
@pilhuhn Would a method with the signature That would bring the handling of |
Changes Media.postMedia() to accept a File and a media type String as parameters, then builds the necessary okhttp3.MultipartBody.Part itself instead of exposing this. A more extensive Builder was suggested in andregasser#62, but I think that would need to live elsewhere, not directly in one of our method classes.
@bocops Absolutely. |
Changes Media.postMedia() to accept a File and a media type String as parameters, then builds the necessary okhttp3.MultipartBody.Part itself instead of exposing this. A more extensive Builder was suggested in andregasser#62, but I think that would need to live elsewhere, not directly in one of our method classes.
@pilhuhn Great, that change should be part of the next snapshot. @andregasser Should we have a general discussion about service functionality such as the Builder with different sources for file data suggested by pilhuhn? On the one hand, I can definitely see how that would make life easier for library users, but on the other hand, it is not strictly "Mastodon client" functionality but a whole new layer on top of it. Perhaps that is something for a later date, after core functionality works as expected? |
Sure, let's have a discussion on how we could simplify the media upload API further. Feel free to open a new discussion thread. For the moment I think the As soon as we know how to build the new MediaUpload API, we can open an issue and start implementing it. Hope, that sounds like a plan 🙂 Btw: I have just published an updated snapshot, so @pilhuhn should be able to use the new API now. |
The current api for media upload is complicated and requires multiple steps, which are not super well documented (already in the original mastodon4j code).
Provide a simple
Media.upload()
method / builder, that 'asks' for the required parts and does the magic ofMultipartBody.Part
handling under the covers. One option would be somefromFile()
and/orfromResource()
/fromUrl()
builder methods to upload the actual content.The text was updated successfully, but these errors were encountered: