Skip to content

Commit

Permalink
make sure to search tags in lower case (as they are in Joplin)
Browse files Browse the repository at this point in the history
  • Loading branch information
marph91 committed Jun 23, 2024
1 parent 0cec9da commit 498740a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ def add_tag(self, tag: imf.Tag) -> str | None:
self.tag_map[tag.reference_id] = tag_id
return tag_id
except requests.exceptions.HTTPError:
# Tag exists already. Search for it.
title = tag.data["title"]
# Tag exists already. Search for it. Joplin only supports lower case
# tags. If not converted to lower case, this can cause some trouble.
# See: https://github.com/marph91/jimmy/issues/6#issuecomment-2184981456
title = tag.data["title"].lower()
result = self.api.search(query=title, type="tag")
matching_tags = [
joplin_tag
for joplin_tag in result.items
if joplin_tag.title == title.lower()
joplin_tag for joplin_tag in result.items if joplin_tag.title == title
]
if len(matching_tags) == 0:
LOGGER.warning(
Expand Down

0 comments on commit 498740a

Please sign in to comment.