Compare commits

..

No commits in common. "rewrite" and "r0.1" have entirely different histories.

3 changed files with 11 additions and 17 deletions

View File

@ -16,11 +16,12 @@ pipeline:
- zip seafile.zip -r modules icon.png main.py metadata.xml settings.ui - zip seafile.zip -r modules icon.png main.py metadata.xml settings.ui
release: release:
image: plugins/gitea-release image: plugins/gitea-release
api_key: settings:
from_secret: gitea_token api_key:
base_url: https://git.shimun.net from_secret: gitea_token
files: seafile.zip base_url: https://git.shimun.net
checksum: files: seafile.zip
- sha256 checksum:
when: - sha256
event: tag when:
event: tag

View File

@ -111,14 +111,11 @@ class SeafileFile:
self.size = size self.size = size
# curl -v -X PUT -d "p=/foo.md" -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/repos/afc3b694-7d4c-4b8a-86a4-89c9f3261b12/file/shared-link/ # curl -v -X PUT -d "p=/foo.md" -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' -H 'Accept: application/json; indent=4' https://cloud.seafile.com/api2/repos/afc3b694-7d4c-4b8a-86a4-89c9f3261b12/file/shared-link/
def share(self,expire_days=None): def share(self):
data = {'p': self.path}
if expire_days and not expire_days == 0:
data['expire'] = expire_days
resp = self.session.put("%s/repos/%s/file/shared-link/" % (self.library.client.api_endpoint(), self.library.id), resp = self.session.put("%s/repos/%s/file/shared-link/" % (self.library.client.api_endpoint(), self.library.id),
headers={'Authorization': "Token %s" % self.library.client.token.token, headers={'Authorization': "Token %s" % self.library.client.token.token,
'Accept': 'application/json; indent=4'}, 'Accept': 'application/json; indent=4'},
data = data data={'p': self.path}
) )
return resp.headers.get("location") return resp.headers.get("location")

View File

@ -11,7 +11,6 @@ class SeafScreencloudSettings:
self.token = None # SefileToken self.token = None # SefileToken
self.upload_scheme = "regular" self.upload_scheme = "regular"
self.url = None self.url = None
self.link_expiry = None
def _client(self): def _client(self):
if self.token and self.url: if self.token and self.url:
@ -29,7 +28,6 @@ class SeafScreencloudSettings:
self.client = self._client self.client = self._client
self.url = settings.value("seafile-url", None) self.url = settings.value("seafile-url", None)
self.link_expiry = int(settings.value("link-expiry", None))
lib = tuple(settings.value("library", "/").split("/")) lib = tuple(settings.value("library", "/").split("/"))
(id, name) = lib (id, name) = lib
if len(id) == 0 or self.client() == None: if len(id) == 0 or self.client() == None:
@ -66,8 +64,6 @@ class SeafScreencloudSettings:
if self.library is not None: if self.library is not None:
settings.setValue("library", "%s/%s" % settings.setValue("library", "%s/%s" %
(self.library.id, self.library.name)) (self.library.id, self.library.name))
if self.link_expiry is not None:
settings.setValue("link-expiry", self.link_expiry)
settings.setValue("library-path", self.library_path) settings.setValue("library-path", self.library_path)
if self.token != None: if self.token != None:
settings.setValue("auth-username", self.token.username) settings.setValue("auth-username", self.token.username)