mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-05 02:39:23 +02:00
re-synchronize selected books
This commit is contained in:
parent
05fd7f181f
commit
76bc6da867
1 changed files with 4 additions and 4 deletions
|
@ -212,14 +212,14 @@ public class SynchroniserService extends Service implements IBookCollection.List
|
|||
private SyncStatus uploadBookToServer(Book book) {
|
||||
final ZLPhysicalFile file = book.File.getPhysicalFile();
|
||||
final String hash = myCollection.getHash(book);
|
||||
final boolean force = book.labels().contains(Book.SYNC_TOSYNC_LABEL);
|
||||
if (hash == null) {
|
||||
return SyncStatus.HashNotComputed;
|
||||
} else if (myActualHashesFromServer.contains(hash)) {
|
||||
return SyncStatus.AlreadyUploaded;
|
||||
} else if (myDeletedHashesFromServer.contains(hash) &&
|
||||
!book.labels().contains(Book.SYNC_TOSYNC_LABEL)) {
|
||||
} else if (!force && myDeletedHashesFromServer.contains(hash)) {
|
||||
return SyncStatus.ToBeDeleted;
|
||||
} else if (book.labels().contains(Book.SYNC_FAILURE_LABEL)) {
|
||||
} else if (!force && book.labels().contains(Book.SYNC_FAILURE_LABEL)) {
|
||||
return SyncStatus.FailedPreviuousTime;
|
||||
}
|
||||
final Map<String,Object> result = new HashMap<String,Object>();
|
||||
|
@ -239,7 +239,7 @@ public class SynchroniserService extends Service implements IBookCollection.List
|
|||
final String csrfToken = myNetworkContext.getCookieValue(DOMAIN, "csrftoken");
|
||||
try {
|
||||
final String status = (String)result.get("status");
|
||||
if ("not found".equals(status)) {
|
||||
if ((force && !"found".equals(status)) || "not found".equals(status)) {
|
||||
try {
|
||||
final UploadRequest uploadRequest = new UploadRequest(file.javaFile());
|
||||
uploadRequest.addHeader("Referer", verificationRequest.getURL());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue