jim-easterbrook / Photini

An easy to use digital photograph metadata (Exif, IPTC, XMP) editing application.
https://photini.readthedocs.io/
GNU General Public License v3.0
156 stars 24 forks source link

Google Photo Crash #50

Closed HydrelioxGitHub closed 3 years ago

HydrelioxGitHub commented 3 years ago

I've just installed Photini and signin my Google account to upload some photos. But when I go to the Google photo tab, I can see my Google profile picture but nothing else is clickable except "Log in" and I have a window with this log :

18:05:22: ERROR: photini.pyqt: 'title'
Traceback (most recent call last):
  File "C:\Program Files (x86)\Photini\msys2\mingw64\lib\python3.7\site-packages\photini\pyqt.py", line 113, in wrapper
    return func(*args, **kwds)
  File "C:\Program Files (x86)\Photini\msys2\mingw64\lib\python3.7\site-packages\photini\uploader.py", line 274, in connection_changed
    self.show_album_list(self.session.get_albums())
  File "C:\Program Files (x86)\Photini\msys2\mingw64\lib\python3.7\site-packages\photini\googlephotos.py", line 323, in show_album_list
    self.upload_config.add_album(album)
  File "C:\Program Files (x86)\Photini\msys2\mingw64\lib\python3.7\site-packages\photini\googlephotos.py", line 267, in add_album
    widget = QtWidgets.QCheckBox(album['title'].replace('&', '&&'))
KeyError: 'title'
18:07:56: ERROR: photini.pyqt: 'title'
Traceback (most recent call last):
  File "C:\Program Files (x86)\Photini\msys2\mingw64\lib\python3.7\site-packages\photini\pyqt.py", line 113, in wrapper
    return func(*args, **kwds)
  File "C:\Program Files (x86)\Photini\msys2\mingw64\lib\python3.7\site-packages\photini\uploader.py", line 274, in connection_changed
    self.show_album_list(self.session.get_albums())
  File "C:\Program Files (x86)\Photini\msys2\mingw64\lib\python3.7\site-packages\photini\googlephotos.py", line 323, in show_album_list
    self.upload_config.add_album(album)
  File "C:\Program Files (x86)\Photini\msys2\mingw64\lib\python3.7\site-packages\photini\googlephotos.py", line 267, in add_album
    widget = QtWidgets.QCheckBox(album['title'].replace('&', '&&'))
KeyError: 'title'
18:08:05: ERROR: photini.pyqt: 'title'
Traceback (most recent call last):
  File "C:\Program Files (x86)\Photini\msys2\mingw64\lib\python3.7\site-packages\photini\pyqt.py", line 113, in wrapper
    return func(*args, **kwds)
  File "C:\Program Files (x86)\Photini\msys2\mingw64\lib\python3.7\site-packages\photini\uploader.py", line 274, in connection_changed
    self.show_album_list(self.session.get_albums())
  File "C:\Program Files (x86)\Photini\msys2\mingw64\lib\python3.7\site-packages\photini\googlephotos.py", line 323, in show_album_list
    self.upload_config.add_album(album)
  File "C:\Program Files (x86)\Photini\msys2\mingw64\lib\python3.7\site-packages\photini\googlephotos.py", line 267, in add_album
    widget = QtWidgets.QCheckBox(album['title'].replace('&', '&&'))
KeyError: 'title'

I use the last all in one windows installer version (2019.10.0)

jim-easterbrook commented 3 years ago

Thanks for reporting the problem - I'll start investigating it now.

jim-easterbrook commented 3 years ago

Hmm, it appears that one or more of your existing albums on Google Photos doesn't have a title. I didn't know that could happen - when I create one and don't specify a title it gets "Untitled".

HydrelioxGitHub commented 3 years ago

I've tried a few month ago a docker container to sync local folders and album in Google Photo. Maybe it had some bug in it and created in some way albums with empty title... 🤔

jim-easterbrook commented 3 years ago

It's still something I need to allow for though. I hope I can do a new release within the next few days.

HydrelioxGitHub commented 3 years ago

For now, I'll check for theses albums and try to add a title to get the software works. Thank you for your help and your time.

jim-easterbrook commented 3 years ago

If possible I'd like you to edit the file googlephotos.py that's part of your Photini installation so we can find out what else is missing from these albums (and should I ignore them or substitute default values?).

If you can edit the file, go to line 151 and change

            for album in rsp['albums']:
                yield album

to

            for album in rsp['albums']:
                if 'title' not in album:
                    album['title'] = ''
                yield album
HydrelioxGitHub commented 3 years ago

Ok, I'll report what the change do as soon as I can.

jim-easterbrook commented 3 years ago

Now I've started up my Windows virtual machine I can tell you the file is probably in C:\Program Files (x86)\Photini\msys2\mingw64\lib\python3.7\site-packages\photini.

HydrelioxGitHub commented 3 years ago

Well, with the little chunk of code there is no more error logging. I have the list of all my albums on Google Photo. One of them has title empty. I suppose it's normal that I can't upload files to albums not created with Photini (API limitation) but only on albums created with the software.

jim-easterbrook commented 3 years ago

Thanks for that - I wanted reassurance that there was nothing else odd about the album list.

The very restricted API Google introduced a while ago makes the uploader far less useful than it once was I'm afraid. I don't understand why they did it, but I'm not in their business.

jim-easterbrook commented 3 years ago

Releases 2020.10.0 and after include this fix.