Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Indexed only photos in albums #112

Closed
matthewmmorrow opened this issue Aug 22, 2019 · 14 comments
Closed

Indexed only photos in albums #112

matthewmmorrow opened this issue Aug 22, 2019 · 14 comments

Comments

@matthewmmorrow
Copy link

From what I can tell, after running this the only photos that I have are ones that are from albums. I don't have any from the main list. I get the same result with the --flush-index option.

@gilesknap
Copy link
Owner

That does not sound good. Please can you verify that you are passing no parameters except for the root folder?

Independent of my code you can see what the Google API is doing by going to https://developers.google.com/photos/library/reference/rest/v1/mediaItems/list
and clicking 'Execute' this will ask you for your photos account details and then output the results in the bottom right. Please see what you get when you do this. If you don't mind sending me that output and also the log file created by gphotos-sync you can send them to [email protected].

Thanks.

@matthewmmorrow
Copy link
Author

Ok, so I checked the API result like you asked but unfortunately through the explorer I can only get files from the last month. When I compared them I have all the ones from August which is odd but I only have 28/61 items from July and unfortunately the explorer won't let me get a result for July. I was thinking it had something to do with Google Drive and Photos no longer syncing but these photos were all uploaded through the android Photos app. It's odd too because my wife's account downloaded 29k/30k files but mine only has <2k/32k.

Is there a way I can request the older items? If I have some time I might be able to figure out an API call myself but if you know of something that would be better.

@gilesknap
Copy link
Owner

This seems to be a bug in Google's API and one that is not yet reported. I have had other people report similar things but have yet to determine what the common factor is so its not easy to describe a bug to google. See #89 - in that case the users had uploaded all their photos into newly created albums and so the cause does not seem to be the same as for you. Your case seems worrying since it is new photos uploaded in the most standard way.

Note that using the API Explorer you will only get the first page of results. You can set the pageSize to 100 which is the maximum. Then you can cut and paste the nextPageToken from the end of the results into the pageToken input field to get the next page.

I'm not sure if I fully understand the status of your photos please could you answer the following.
(a) what range of dates are the photos which you have uploaded?
(b) can you see all of the files using Google Photos Web?
(c) which can you not see using gphotos-sync?
(d) which can you not see using the API explorer (is it the same as gphotos-sync)

I believe we can do a workaround for the missing files if there are not too many but this will be a pain if the API continues to skip newly uploaded files. Simply create an album for the missing files, gphotos-sync should then be able to find them.

Thanks,
giles.

@matthewmmorrow
Copy link
Author

Here are the answers:
a. I started using Photos in 2012 and also uploaded some older ones, I believe all in Original size.
b. I can see all of them in the Web. Google dashboard (https://myaccount.google.com/dashboard) reports and 28921 photos in 1672 albums and ~190GB
c. I only get ~1700 from gphotos-sync. Anything older than this month doesn't seem to be coming back unless it is in an album. It's only about ~8GB of files.
d. With the API explorer I can only get 76 results back, as early as 2019-08-02. If I put in the next page result I get blank pages.

So yeah, thinking about it I would agree that there seems to be a bug in the API that isn't letting me get anything older than the current month and that's why I don't have all my files.

This does seem to be the opposite of #89 since I think your fix for that is why I'm getting any older files in albums at all :-P

@gilesknap
Copy link
Owner

gilesknap commented Aug 24, 2019 via email

@gilesknap
Copy link
Owner

I just tried uploading an original quality file and was able to sync it with gphotos-sync.

@matthewmmorrow
Copy link
Author

Oh! I figured something out. So in the API I only get 76 items on the first "page" and the next page is blank. But if I continue putting in nextPageToken repeatedly, I eventually get more results items!

To test this, I pulled down the repository and removed the break when media_json is empty and it goes on to grab the next page until nextPageToken is empty. When I ran it again I got 7660 items this time which is 5x what I got before. So maybe the code should only rely on nextPageToken to stop?

@gilesknap
Copy link
Owner

gilesknap commented Aug 25, 2019 via email

@matthewmmorrow
Copy link
Author

I'm still curious why I get 7k/32k photos but I feel like this issue is closed when that change get's added.

On a side note, when it was available, I used Google's Backup and Sync with "upload to Google Photos" for some photos and those all seem to be coming back fine now too. Those empty pages are bizarre.

@gilesknap
Copy link
Owner

OK, I have added the change to the branch 'feature' please try it out.

In testing this I did note some weird behaviour with low pageSize numbers and was able to get similar behaviour to you with pageSize=2.

@gilesknap
Copy link
Owner

Would you mind reporting the bug you have found to Google?

To do so click on New Issue on this page https://issuetracker.google.com/issues?q=componentid:385336%20status:open

When I reported https://issuetracker.google.com/issues/116842164 they asked for permission to access my library for testing and then did eventually fix the issue. Since your library is showing the problem it would be easiest for you to do the report if you are comfortable with that.

@gilesknap gilesknap added this to the Next Issues to Address milestone Aug 27, 2019
@gilesknap gilesknap self-assigned this Aug 27, 2019
@gilesknap
Copy link
Owner

@matthewmmorrow did you get a chance to see if feature branch fixed your issue?
Thanks.

@gilesknap
Copy link
Owner

no news from @matthewmmorrow. I'm pretty sure this will fix the issue and seems to be a benign change anyway.

Todo - merge into master for next release.

@gilesknap gilesknap added the bug label Sep 10, 2019
@gilesknap
Copy link
Owner

merged to master

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

No branches or pull requests

2 participants