Add new_photo_kwargs to the create_or_get call.
Due to the closure, it was already working just fine, but I want the explicitness of having it there.
This commit is contained in:
parent
57a9e0d4dc
commit
f06b0915ab
1 changed files with 7 additions and 3 deletions
|
@ -1083,9 +1083,13 @@ class PDBUtilMixin:
|
||||||
new_photo_ratelimit = ratelimiter.Ratelimiter(allowance=1, period=new_photo_ratelimit)
|
new_photo_ratelimit = ratelimiter.Ratelimiter(allowance=1, period=new_photo_ratelimit)
|
||||||
return new_photo_ratelimit
|
return new_photo_ratelimit
|
||||||
|
|
||||||
def create_or_fetch_photos(files):
|
def create_or_fetch_photos(filepaths, new_photo_kwargs):
|
||||||
|
'''
|
||||||
|
Given an iterable of filepaths, find the corresponding Photo object
|
||||||
|
if it exists, otherwise create it and then return it.
|
||||||
|
'''
|
||||||
photos = []
|
photos = []
|
||||||
for filepath in files:
|
for filepath in filepaths:
|
||||||
try:
|
try:
|
||||||
photo = self.get_photo_by_path(filepath)
|
photo = self.get_photo_by_path(filepath)
|
||||||
except exceptions.NoSuchPhoto:
|
except exceptions.NoSuchPhoto:
|
||||||
|
@ -1137,7 +1141,7 @@ class PDBUtilMixin:
|
||||||
)
|
)
|
||||||
|
|
||||||
for (current_directory, subdirectories, files) in walk_generator:
|
for (current_directory, subdirectories, files) in walk_generator:
|
||||||
photos = create_or_fetch_photos(files)
|
photos = create_or_fetch_photos(files, new_photo_kwargs=new_photo_kwargs)
|
||||||
|
|
||||||
if not make_albums:
|
if not make_albums:
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in a new issue