Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: filter_tracks access track_type bug #8

Merged
merged 2 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/nendo/library/sqlalchemy_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -1200,7 +1200,7 @@ def filter_tracks(
# apply track type filter if applicable
if track_type is not None:
if isinstance(track_type, list):
query = query.filter(model.NendoTrackDB.value.in_(track_type))
query = query.filter(model.NendoTrackDB.track_type.in_(track_type))
else:
query = query.filter(model.NendoTrackDB.track_type == track_type)

Expand Down
2 changes: 2 additions & 0 deletions tests/test_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ def test_filter_by_track_type(self):
result = nd.library.filter_tracks(track_type="stem")
self.assertEqual(len(result), 1)
self.assertEqual(result[0].id, test_track_1.id)
result = nd.library.filter_tracks(track_type=["stem", "track"])
self.assertEqual(len(result), 2)

def test_get_tracks_filtered_by_collection(self):
"""Test filtering of tracks by collection."""
Expand Down