Skip to content

Commit

Permalink
modify the logic of obtaining a share link (#937)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxiaoping authored Jul 11, 2022
1 parent 9d700d7 commit 61761eb
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId 'com.seafile.seadroid2'
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 120
versionName "2.2.45"
versionCode 121
versionName "2.2.46"
multiDexEnabled true
resValue "string", "authorities", applicationId + '.cameraupload.provider'
resValue "string", "account_type", "com.seafile.seadroid2.account.api2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@ public GetShareLinkTask(String repoID, String path, boolean isdir, SeafConnectio

@Override
protected void runTask() {

// If you has Shared links to delete Shared links
DataManager dataManager = new DataManager(account);
//get share link
ArrayList<SeafLink> shareLinks = dataManager.getShareLink(repoID, path);
for (SeafLink shareLink : shareLinks) {
//delete link
dataManager.deleteShareLink(shareLink.getToken());
}
//create new link
try {
link = conn.getShareLink(repoID, path, password, days);
} catch (SeafException e) {
setTaskException(e);
if (shareLinks.size() == 0) {
try {
//creating a Share link
link = conn.getShareLink(repoID, path, password, days);
} catch (SeafException e) {
setTaskException(e);
}
} else {
//return to existing link
link = shareLinks.get(0).getLink();
}
}

Expand Down

0 comments on commit 61761eb

Please sign in to comment.