|
@@ -4,13 +4,10 @@
|
|
import symuid
|
|
import symuid
|
|
|
|
|
|
|
|
|
|
-def walk_attr(root_path, path_ignore_regex):
|
|
|
|
- for track in symuid.Track.walk(root_path, path_ignore_regex):
|
|
|
|
- yield {'path': track.path, 'play_count': track.get_play_count_sum()}
|
|
|
|
-
|
|
|
|
-
|
|
|
|
def symuid_list(path, path_ignore_regex, filter_expression, sort_expression):
|
|
def symuid_list(path, path_ignore_regex, filter_expression, sort_expression):
|
|
- attr_it = walk_attr(path, path_ignore_regex)
|
|
|
|
|
|
+ # use generators until sort is required
|
|
|
|
+ attr_it = ({'path': track.path, 'play_count': track.get_play_count_sum()}
|
|
|
|
+ for track in symuid.Track.walk(path, path_ignore_regex))
|
|
if filter_expression:
|
|
if filter_expression:
|
|
attr_it = filter(lambda a: eval(filter_expression, a), attr_it)
|
|
attr_it = filter(lambda a: eval(filter_expression, a), attr_it)
|
|
if sort_expression:
|
|
if sort_expression:
|