Skip to content

Commit

Permalink
v2.0.4
Browse files Browse the repository at this point in the history
Former-commit-id: c359641
Former-commit-id: b7c80e916a8944343f3aabc549de7eea232e5a46
  • Loading branch information
NicholasDawson committed Aug 10, 2021
1 parent 0068189 commit c179e3a
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 89 deletions.
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ google-auth-oauthlib = "*"
isort = "*"
cx-freeze = "*"
colorama = "*"
sanitize-filename = "*"

[dev-packages]

Expand Down
163 changes: 74 additions & 89 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions gparch.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import piexif.helper
import requests
from google.auth.transport.requests import Request
from sanitize_filename import sanitize
from google_auth_oauthlib.flow import InstalledAppFlow
from googleapiclient.discovery import build
from PIL import Image
Expand Down Expand Up @@ -270,6 +271,7 @@ def process_media_items(self, media_items, save_directory, album_uuid=None):
# -> if it already exists then just pull the item_path from the existing db entry
item_db_entry = self.select_media_item(item["id"])
if not item_db_entry:
item["filename"] = sanitize(item["filename"])
item_path = auto_filename(f'{save_directory}/{item["filename"]}')
self.insert_media_item(
item["id"],
Expand Down Expand Up @@ -323,6 +325,9 @@ def download_all_shared_albums(self):
self.download_single_album(album, True)

def download_single_album(self, album, shared=False):
# Sanitize album title
album["title"] = sanitize(album["title"])

# Return if the album has no mediaItems to download
# Unsure of how this occurs, but there are album entries that exist
# where there I don't have permission, weird bug...
Expand Down

0 comments on commit c179e3a

Please sign in to comment.