diff --git a/roles/music/tasks/download_music.yml b/roles/music/tasks/download_music.yml index b8f3116..02792e8 100644 --- a/roles/music/tasks/download_music.yml +++ b/roles/music/tasks/download_music.yml @@ -14,14 +14,24 @@ group: "{{ base_user_name }}" mode: 0644 +- name: Filter non-existing albums + shell: + chdir: ~/documents/code/funkwhale-playlist-import + cmd: ./exclude-existing-albums.py -s deezer > /tmp/unique_albums.txt + stdin: "{{ lookup('file', 'files/albums.txt') }}" + register: unique_albums + delegate_to: localhost + become: false + +- pause: - name: Download required albums # So that files are written with base user perms - become: yes + become: true become_user: "{{ base_user_name }}" shell: cmd: "deemix --portable -p {{ deemix_songs_path }} {{ item }}" chdir: "{{ deemix_folder_path }}" - with_items: "{{ lookup('file', 'files/albums.txt').splitlines() }}" + with_items: "{{ lookup('file', '/tmp/unique_albums.txt').splitlines() }}" register: output_deemix - name: Show download state