Skip to content

Commit

Permalink
Added 3.1 changelog. Applied black formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
cmayespq committed Dec 31, 2022
1 parent 4509905 commit c7c63b0
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 21 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# (Unreleased)

# Version 0.3.1

## Added

- Implicit and explicit `all` filter
- Filters for any field containing the filter string
- `all:spotify` looks for "spotify" in any field
- `spotify` without the `all` qualifier is equivalent
- Added "spotify_id" field to results

# Version 0.3.0

## Added
Expand Down
33 changes: 17 additions & 16 deletions poetry.lock

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

10 changes: 6 additions & 4 deletions spotcrates/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ def __repr__(self):
def __eq__(self, other):
if isinstance(other, FieldFilter):
return (
self.field == other.field
and self.value == other.value
and self.filter_type == other.filter_type
self.field == other.field
and self.value == other.value
and self.filter_type == other.filter_type
)
return NotImplemented

Expand Down Expand Up @@ -246,7 +246,9 @@ def filter_list(items, filters):
if cur_filter.passes(item_field):
matching_items.append(cur_item)

filtered_items = list({v[FieldName.SPOTIFY_ID]: v for v in matching_items}.values())
filtered_items = list(
{v[FieldName.SPOTIFY_ID]: v for v in matching_items}.values()
)

return filtered_items

Expand Down
1 change: 0 additions & 1 deletion tests/test_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ def test_explicit_all(self):
first_filter,
)


def test_invalid_field(self):
with self.assertRaises(NotFoundException):
parse_filters("zzz:testuser")
Expand Down

0 comments on commit c7c63b0

Please # to comment.