Skip to content
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

Added Seafile Support #1061

Merged
merged 2 commits into from Oct 13, 2015
Merged

Added Seafile Support #1061

merged 2 commits into from Oct 13, 2015

Conversation

zikeji
Copy link
Contributor

@zikeji zikeji commented Oct 13, 2015

I tested as much as I could find, for further testing others are open to downloading the experimental setup with Seafile support.

Download: https://seacloud.cc/f/71f961cd4c/

unknown and others added 2 commits October 12, 2015 21:24
added Seafile task
-
ShareX.UploadersLib/UploadersConfig.cs
added Seafile configuration properties
-
ShareX.UploadersLib/Forms/UploadersConfigForm.resx
ShareX.UploadersLib/Forms/UploadersConfigForm.Designer.cs
ShareX.UploadersLib/Forms/UploadersConfigForm.cs
added Seafile tab, settings, and relevant configuration & validation utilities
-
ShareX.UploadersLib/FileUploaders/Seafile.cs
main Seafile controller class, watch out for the ShareURL class as it doesn't used shared http classes due to contentlength and postdata PUT constraints
Jaex added a commit that referenced this pull request Oct 13, 2015
@Jaex Jaex merged commit 668519b into ShareX:master Oct 13, 2015
@Jaex
Copy link
Member

Jaex commented Oct 13, 2015

Destination settings window not shows ShareX icon for some reason in your commit. When I return to previous commit it shows properly. But can't find what is wrong. Only thing I can't check is resx file because GitHub not shows comparison. So something could be wrong there must be caused it?

@zikeji
Copy link
Contributor Author

zikeji commented Oct 13, 2015

Odd. I am done for the night I will look into it tomorrow (I am in UTC-5,
2AM for me right now). Roll it back for now, sorry I didn't notice.
On Oct 13, 2015 1:42 AM, "Jaex" notifications@github.com wrote:

Destination settings window not shows ShareX icon for some reason in your
commit. When I return to previous commit it shows properly. But can't find
what is wrong.


Reply to this email directly or view it on GitHub
#1061 (comment).

@Jaex
Copy link
Member

Jaex commented Oct 13, 2015

I just reverted your resx changes and indeed resx was causing it. This gonna be very complicated to fix too because can't even see full comparison. I wonder now is there anything else broken in resx :(

@zikeji
Copy link
Contributor Author

zikeji commented Oct 13, 2015

All I did was add the Seafile icon to the resx. Could Git have corrupted
the resx? Maybe restore old and add Seafile image again.
On Oct 13, 2015 1:55 AM, "Jaex" notifications@github.com wrote:

I just reverted your resx changes and indeed resx was causing it. This
gonna be very complicated to fix too because can't even see full
comparison. I wonder now is there anything else broken in resx :(


Reply to this email directly or view it on GitHub
#1061 (comment).

@Jaex
Copy link
Member

Jaex commented Oct 13, 2015

I found way to see all differences just add ".patch" to end of commit link.
And from there I searched "Icon" and indeed you changed form icon there.
I can't restore 2000 lines of resx changes manually. But I can revert that Icon part now. But worrying what if something else changed too.

Edit: Fixed Icon from VS designer. Now gonna test uploading.

@zikeji
Copy link
Contributor Author

zikeji commented Oct 13, 2015

I didn't change form icon, at least not intentionally. Sorry i caused you
trouble.
On Oct 13, 2015 2:00 AM, "Jaex" notifications@github.com wrote:

I found way to see all differences just add ".patch" to end of commit link.
And from there I searched "Icon" and indeed you changed form icon there.


Reply to this email directly or view it on GitHub
#1061 (comment).

@Jaex
Copy link
Member

Jaex commented Oct 13, 2015

I meant your commit changed.

By the way API URL setting is very confusing, now how am I supposed to find that URL? Can't find anywhere in web site. How normal users supposed to find it?!

Also people can't find Auth Token too because it is not looks connected with that group box in right side.

So I don't think people can figure out how to fill these settings.

@Jaex
Copy link
Member

Jaex commented Oct 13, 2015

This is example ss from Seafile app I think:

More obvious there what URL to use but when I used that URL showed there validate button gave error. So still dunno what URL to use.

@zikeji
Copy link
Contributor Author

zikeji commented Oct 13, 2015

Use auto complete URL. Should he /api2 on the end of the URL. I didn't
want to auto add it in case the private server version people have hosted
uses a different end URL. Should be https://seacloud.cc/api2
On Oct 13, 2015 2:06 AM, "Jaex" notifications@github.com wrote:

This is example ss from Seafile app I think:

https://camo.githubusercontent.com/a144c78698825e7a43814ed7bfc6779c8a24ded7/68747470733a2f2f736561636c6f75642e63632f6d656469612f696d672f68656c702f68656c702d636c69656e742f73656166696c652d6164642d6163636f756e742e706e67

More obvious there what URL to use but when I used that URL showed there
validate button gave error. So still dunno what URL to use.


Reply to this email directly or view it on GitHub
#1061 (comment).

//
// grpSeafileAccInfo
//
this.grpSeafileAccInfo.Controls.Add(this.myListView1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't find this myListView1 in UI.
Edit: It was outside of group box area therefore not visible and not used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was gonna say I didn't know what those were. I should have looked harder
for remnants like that.
On Oct 13, 2015 2:18 AM, "Jaex" notifications@github.com wrote:

In ShareX.UploadersLib/Forms/UploadersConfigForm.Designer.cs
#1061 (comment):

  •        //
    
  •        // txtSeafileUploadLocationRefresh
    
  •        //
    
  •        resources.ApplyResources(this.txtSeafileUploadLocationRefresh, "txtSeafileUploadLocationRefresh");
    
  •        this.txtSeafileUploadLocationRefresh.Name = "txtSeafileUploadLocationRefresh";
    
  •        this.txtSeafileUploadLocationRefresh.UseVisualStyleBackColor = true;
    
  •        this.txtSeafileUploadLocationRefresh.Click += new System.EventHandler(this.txtSeafileUploadLocationRefresh_Click);
    
  •        //
    
  •        // lblSeafileSelectLibrary
    
  •        //
    
  •        resources.ApplyResources(this.lblSeafileSelectLibrary, "lblSeafileSelectLibrary");
    
  •        this.lblSeafileSelectLibrary.Name = "lblSeafileSelectLibrary";
    
  •        //
    
  •        // grpSeafileAccInfo
    
  •        //
    
  •        this.grpSeafileAccInfo.Controls.Add(this.myListView1);
    

I can't find this in UI.


Reply to this email directly or view it on GitHub
https://github.com/ShareX/ShareX/pull/1061/files#r41830262.

@Jaex
Copy link
Member

Jaex commented Oct 13, 2015

Because you reading and replying my messages from email I bet you don't see my countless edits I keep doing after send messages.

Gonna use dropdown control for API URL now.

return;
}
txtSeafileAccInfoEmail.Text = SeafileCheckAccInfoResponse.email;
txtSeafileAccInfoUsage.Text = HelpersLib.NumberExtensions.ToSizeString(SeafileCheckAccInfoResponse.usage).ToString() + " / " + HelpersLib.NumberExtensions.ToSizeString(SeafileCheckAccInfoResponse.total).ToString();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand why you used extensions like that in here. Not to mention you converted string to string there.
Extensions used like this: SeafileCheckAccInfoResponse.usage.ToSizeString()

@zikeji
Copy link
Contributor Author

zikeji commented Oct 13, 2015 via email

libraryItem.SubItems.Add(HelpersLib.NumberExtensions.ToSizeString(SeafileLibrary.size));
if (SeafileLibrary.encrypted)
{
ListViewItem.ListViewSubItem isEncrypt = libraryItem.SubItems.Add("\u221A");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sub item not used at all?

@Jaex
Copy link
Member

Jaex commented Oct 13, 2015

This looks better:

By the way it would be far better if we used messenger instead of spamming here :P

@zikeji
Copy link
Contributor Author

zikeji commented Oct 13, 2015

It does look better like that! Sorry I haven't used C# in a couple months
so some of the shortcuts are rusty. Been into Golang working on a
lightweight URL shortener.

And yeah messenger could work but I'm in bed replying to these emails from
my phone lol. 2:40 am
On Oct 13, 2015 2:35 AM, "Jaex" notifications@github.com wrote:

This looks better:

https://camo.githubusercontent.com/07b7e49a13d5e25784a44adba2860b395fa86472/68747470733a2f2f646c2e64726f70626f7875736572636f6e74656e742e636f6d2f752f31343037363239382f5368617265582f323031352f31302f62346e674e577943774d2e706e67

By the way it would be far better if we used messenger instead of spamming
here :P


Reply to this email directly or view it on GitHub
#1061 (comment).

@Jaex
Copy link
Member

Jaex commented Oct 13, 2015

Why days to expiration is 7 by default and I can't make it never expire?

@Jaex
Copy link
Member

Jaex commented Oct 13, 2015

Upload is successful: https://seacloud.cc/f/b7ed3e3d63/
Good job!

Now I must try to find way to use current Uploader methods for ShareFile method because it is currently very ugly.

@Jaex
Copy link
Member

Jaex commented Oct 13, 2015

I wonder is it possible to get this direct link https://seacloud.cc/f/b7ed3e3d63/?raw=1 redirected from it.

@Jaex
Copy link
Member

Jaex commented Oct 13, 2015

I fixed accept header issue it was not working properly when set in header. But still always getting:

The remote server returned an error: (415) UNSUPPORTED MEDIA TYPE.

Response:
{"detail": "Unsupported media type '' in request."}

Edit: Finally made it work. This API is ridiculous.

@zikeji
Copy link
Contributor Author

zikeji commented Oct 13, 2015

Edit: Finally made it work. This API is ridiculous.

That's exactly what I was thinking. Why use PUT for a request that could have been handled easily with GET, and why the heck return variables in the header and not in JSON?!

@Jaex
Copy link
Member

Jaex commented Oct 15, 2015

Did you missed my question?

@zikeji
Copy link
Contributor Author

zikeji commented Oct 15, 2015

Did you missed my question?

Could you repeat the question?

@Jaex
Copy link
Member

Jaex commented Oct 15, 2015

Jaex commented 3 days ago
Why days to expiration is 7 by default and I can't make it never expire?

@zikeji
Copy link
Contributor Author

zikeji commented Oct 15, 2015

Why days to expiration is 7 by default and I can't make it never expire?

Setting it to 0 should set it to never expire. The API didn't have enough info on the matter though, the 7 I just left as an arbitrary number.

@Jaex
Copy link
Member

Jaex commented Oct 16, 2015

You can't set it to 0. Minimum is 1 you did. Also by default why anyone would want it to expire.
And if you make it possible to set 0 then you must still mention that 0 disables it. Not everyone can guess it. I mean it is easy for developer to predict 0 disables it but not for everyone.

@Jaex
Copy link
Member

Jaex commented Oct 16, 2015

By the way are you using Steam? For to be able to easily communicate.

@zikeji
Copy link
Contributor Author

zikeji commented Oct 16, 2015

You can't set it to 0. Minimum is 1 you did. Also by default why anyone would want it to expire.
And if you make it possible to set 0 then you must still mention that 0 disables it. Not everyone can guess it.

Should probably be an option to disable it then.

BTW, expiration only applies to the shared link. If you upload a file to share, you generally don't want the link accessible indefinitely. The expiration doesn't effect the file at all, just the public share link.

As for Steam, yeah: http://steamcommunity.com/id/zikeji/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants