mirror of
https://github.com/beetbox/beets.git
synced 2026-02-28 02:03:05 +01:00
Remove duplicate code
This commit is contained in:
parent
24ffd0982e
commit
759a26a109
1 changed files with 2 additions and 6 deletions
|
|
@ -693,16 +693,12 @@ def user_query(session):
|
|||
|
||||
# As albums: group items by albums and create task for each album
|
||||
if choice is action.ALBUMS:
|
||||
def group(item):
|
||||
return (item.albumartist or item.artist, item.album)
|
||||
|
||||
def emitter(task):
|
||||
for _, items in itertools.groupby(task.items, group):
|
||||
yield ImportTask(items=list(items))
|
||||
yield ImportTask.progress_sentinel(task.toppath, task.paths)
|
||||
yield task
|
||||
|
||||
ipl = pipeline.Pipeline([
|
||||
emitter(task),
|
||||
group_albums(session),
|
||||
initial_lookup(session),
|
||||
user_query(session)
|
||||
])
|
||||
|
|
|
|||
Loading…
Reference in a new issue