gphotos-uploader-cli icon indicating copy to clipboard operation
gphotos-uploader-cli copied to clipboard

Sorted upload doesn't work

Open shoeoffhead opened this issue 2 years ago • 1 comments

I run version 3.3.1

https://github.com/gphotosuploader/gphotos-uploader-cli/pull/315

https://github.com/gphotosuploader/gphotos-uploader-cli/issues/301

Links above claim that one can upload files in a sorted fashion. In all my tests this did not work. The files are uploaded in a random order it seems. I always created a new album for each test.

If this is a PWU (problem with the user), please let me know what I am doing wrong. Can you verify with tests, that sorted upload works?

shoeoffhead avatar Apr 08 '22 15:04 shoeoffhead

The code seemed to upload the files in a sorted way, when number of workers is 1 (default). Unfortunately, we don't have an end-to-end test to verify automatically if the code is behaving properly 😢

In my last run, I've seen that it's not uploading the files in the right order 😱

$ ./gphotos-uploader-cli push --debug
[info]   Reading configuration from '/home/paco/.gphotos-uploader-cli/config.hjson'
[debug]  Current configuration: {"APIAppCredentials":{"ClientID":"REMOVED","ClientSecret":"REMOVED"},"Account":"REMOVED","SecretsBackendType":"file","Jobs":[{"SourceFolder":"/home/paco/Downloads/Test","CreateAlbums":"folderName","DeleteAfterUpload":false,"IncludePatterns":[],"ExcludePatterns":[]}]}
[info]   Authenticating using token for 'REMOVED'
Enter the passphrase to open the token store: 
[done] √ Token is valid, expires at 2022-04-08 19:14:23.598521532 +0200 CEST
[debug]  Worker #1 is starting
[debug]  Upload file '/home/paco/Downloads/Test/Album1/file_1.png' to album 'Album1'.
[debug]  Upload file '/home/paco/Downloads/Test/Album1/file_2.png' to album 'Album1'.
[debug]  Upload file '/home/paco/Downloads/Test/Album1/file_3.png' to album 'Album1'.
[debug]  Upload file '/home/paco/Downloads/Test/Album1/file_4.png' to album 'Album1'.
[info]   Found 4 items to be uploaded processing location '/home/paco/Downloads/Test'.
[debug]  Worker #1 processing: /home/paco/Downloads/Test/Album1/file_4.png
[debug]  New resumable upload for file [file_4.png].
[debug]  Current offset for [file_4.png] is 0.
[debug]  Resuming upload session for [file_4.png] starting at offset 0
[debug]  Worker #1 processing: /home/paco/Downloads/Test/Album1/file_2.png
[debug]  New resumable upload for file [file_2.png].
[debug]  Current offset for [file_2.png] is 0.
[debug]  Successfully processing /home/paco/Downloads/Test/Album1/file_4.png
[debug]  Resuming upload session for [file_2.png] starting at offset 0
[debug]  Worker #1 processing: /home/paco/Downloads/Test/Album1/file_1.png
[debug]  New resumable upload for file [file_1.png].
[debug]  Successfully processing /home/paco/Downloads/Test/Album1/file_2.png
[debug]  Current offset for [file_1.png] is 0.
[debug]  Resuming upload session for [file_1.png] starting at offset 0
[debug]  Worker #1 processing: /home/paco/Downloads/Test/Album1/file_3.png
[debug]  New resumable upload for file [file_3.png].
[debug]  Successfully processing /home/paco/Downloads/Test/Album1/file_1.png
[debug]  Current offset for [file_3.png] is 0.
[debug]  Resuming upload session for [file_3.png] starting at offset 0
[debug]  Successfully processing /home/paco/Downloads/Test/Album1/file_3.png
[done] √ 4 processed files: 4 successfully, 0 with errors                                                        
[debug]  Worker #1 is stopping
[debug]  Shutting down File Tracker service...
[debug]  Shutting down Upload Tracker service...
[debug]  Shutting down Token Manager service...
[debug]  All services has been shut down successfully

Given that this sorting is only maintained when:

  • the order is relative to the files you're uploading
  • the album is empty (if you uploaded files previously, the new ones will be added to the end of the album)
  • the number of workers is 1 (default)

I'll leave this issue opened to let others to work on it, I'm not going to fix it right now... feel free to submit a PR.

pacoorozco avatar Apr 08 '22 16:04 pacoorozco