-
Notifications
You must be signed in to change notification settings - Fork 32
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
Add S3 uploader #244
base: master
Are you sure you want to change the base?
Add S3 uploader #244
Conversation
Another thing, I have no idea how you run this project as debug, so I can't really properly look through things. If you could provide instructions for doing so, that would be great. |
Did some digging around, I'm worried Discord might've deprecated support for external images being displayed by Rich Presence activities. I tried testing it by manually handing it one, and it hasn't seemed to work so far. |
This should work with the provided VS project, given that you installed musicbee using the installer (not store) and did not change installation directory. Otherwise check the project configuration in VS.
Need to test that myself In general the idea behind the whole uploader stuff is that it should be possible using a free hosting service. I am currently not aware that there are any free s3 offerings. I would be interested which service you use for hosting the images. |
What I did in VS is Debug -> Attach to Process, searched and selected MusicBee, and that's it. Nothing happened, I uninstalled the plugin from MusicBee prior to this, as I assume it doesn't work if you don't. I've never debugged via attaching to a process period, if what I did sounds like it's incorrect, some help would be great.
Determined this is not the case as the program is still working for some people, will be investigating more today. My current theory is that some change between version 3.0.2 and 3.1.0 made things more prone to breaking, as someone who is on 3.0.2 was able to show the functionality still works.
S3 is not free, and would thus be up to the user to configure and provide for (though, the charge is .023 USD for 1 GB, so it's fairly inexpensive). However, at the very least it is an extra option. I wanted to put CatBox.moe functionality in, however, the package does not target an old enough version. I will see what I can do about that, but I'd like to see if I can get what currently exists to work first off, as it should be possible, given others have it working. |
If you have a better place I can contact you, that would be great. I'm digging into the Imgur errors now and trying to make sense of them and what versions they happen on, would really love some pointers or at least to properly get the debugging set up so I can see it happen in real time and not just through error logs. |
Update: figured out how to debug it now. Will see what I can do. |
37de1f4
to
0239bed
Compare
I will take a look at it, but pls be patient I guess it will take more than a few days 😞 |
Absolutely, I can help in that, and take all the time you need! |
Hey, thanks for creating the PR for this feature. I believe the fork you're referring to was mine, seeing how the changes are mostly nearly identical. I intended to get a PR created, but if I recall correctly, there were some bugs and polish (believe it was quirks with the settings UI, feeling like the S3 health check could be improved, and readme updates) that I didn't get around to wrapping it up as I had other priorities going on. I would at least appreciate some credit for my work 😅 That said, I've been using my fork for a while and it works quite well. Example usageAlbum cover hosted on AWS S3 served with CloudFront endpoint: |
I think the original commits (before the last force-push) actually included your authorship, so please restore the author @suflors |
You're going to have to tell me exactly what you mean by that, do you want me to just change the commits back to the original commits? I can do this, if so. Did not mean to step on any feet, merely thought it'd be better if the original commit was split into two, as I felt that adding the uploader switcher and the new uploader in one commit was a lot. Say the words and I'll go change it back to the original commit + my changes, though. Edit: Decided to just go ahead and do it, hope it's all fine now. |
0239bed
to
cdd36fd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries @suflors, thanks for fixing the commit history. It looks good now. 👍
I believe I see the issues you were having with the GetBaseUrl()
method. I hadn't adequately tested this without a CustomDomain
value, as I use AWS CloudFront to serve assets from my S3 bucket.
I left some feedback on your changes, wrote a suggestion that better handles building the base URL from Endpoint
without having to query the bucket's region, and suggestions on other things I noticed.
Co-authored-by: Kramer Campbell <[email protected]>
theres also https://imgbb.com, it has an API and its free - used here https://github.com/VZCE/mbrpc |
Will consider it for when I start writing other image uploaders. Thanks! |
Co-authored-by: Kramer Campbell <[email protected]>
Co-authored-by: Kramer Campbell <[email protected]>
f31006d
to
ef7e1bd
Compare
…eUrlPreview() to show a proper example.
Handled everything, I think. I left comments on each one for the most part, as well. By the way, do I have to worry about most of your commits being marked as "Unverified"? I'm not quite sure if it's something I'm supposed to do anything about. |
thanks again for working on this, is there any documentation I should follow to set this up myself? I've just made a bucket for s3 and given my credentials in the plugin but its not uploading anything |
Not yet, might be missing something but you should just have to turn off "Block all public access" and make your bucket policy look something like this: Feel free to harass me in the DiscordBee server if it still doesn't work. |
thankyou, it worked using the policy you sent |
Hey I've been meaning to follow up on this, just got a lot of stuff going right now. Sorry to keep you all waiting. |
No problem, I've been busy on my own stuff anyway. Though I do wonder if @sll552 has looked at the branch yet at all. |
I did take a look at the code, which looks fine, unfortunately I haven't had time to test it yet. |
Found a fork that might be able to offer a solution, however, I have only been able to ensure that the images are being uploaded to Amazon S3 from this, it may be that my custom app that I just made is not properly working yet, or otherwise the actual thing setting the image to be displayed does not work. Will test again later to make sure, but in the meantime, I heavily suggest you test it yourself. If it is in fact broken, I will attempt to fix it in this branch.