Skip to content

Commit

Permalink
Fix empty merge list
Browse files Browse the repository at this point in the history
  • Loading branch information
kiliczsh committed Jul 6, 2023
1 parent 60d3e72 commit 61ea7ed
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
14 changes: 11 additions & 3 deletions gokyuzu/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -857,11 +857,19 @@ def get_relavants_of(self, handle, debug=False):

def merge_unique_lists(self, first_list, second_list):
merged_list = {}
if len(first_list) == 0 and len(second_list) == 0:
return merged_list

if len(first_list) == 0:
return second_list
elif len(second_list) == 0:
return first_list

for item in first_list:
merged_list[item["handle"]] = item
merged_list[item] = item
for item in second_list:
if item["handle"] not in merged_list.keys():
merged_list[item["handle"]] = item
if item not in merged_list.keys():
merged_list[item] = item
return merged_list

def exclude_users(self, follow_list: dict, exluded_users):
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[tool.poetry]
name = "gokyuzu"
version = "2.0.6"
version = "2.0.7"
description = "bsky.social client library"
authors = ["Muhammed Kılıç <[email protected]>"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='gokyuzu',
version='2.0.6',
version='2.0.7',
description='bsky.social client library',
long_description=open('README.md', 'r', encoding='utf-8').read(),
long_description_content_type='text/markdown',
Expand Down

0 comments on commit 61ea7ed

Please sign in to comment.