Skip to content

Commit

Permalink
fixes bug introduced in the increment logic for file naming
Browse files Browse the repository at this point in the history
  • Loading branch information
beaufour committed Nov 9, 2022
1 parent 80c2b43 commit 55ba6ce
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion flickr_download/filename_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def title_increment(pset: Optional[Photoset], photo: Photo, suffix: Optional[str
index = pset.id if pset else "1"
photo_index = INCREMENT_INDEX[index][photo.title]
if photo_index:
extra = f"({photo.index})"
extra = f"({photo_index})"
INCREMENT_INDEX[index][photo.title] += 1
return get_filename(f"{photo.title}{suffix}{extra}")

Expand Down
2 changes: 1 addition & 1 deletion tests/test_filename_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class TestFilenameHandlers:
def setup_method(self) -> None:
self._pset = Mock(Photoset, title="Some Set", id=999)
self._photo = Mock(Photo, title="Some Photo", id=123, index=1)
self._photo = Mock(Photo, title="Some Photo", id=123)
self._suffix = ""

def teardown_method(self) -> None:
Expand Down

0 comments on commit 55ba6ce

Please sign in to comment.