From 5c127a5648c5ee9fbff8044a55b29f746a9083be Mon Sep 17 00:00:00 2001 From: Quentin Duchemin Date: Mon, 18 Mar 2024 23:26:49 +0100 Subject: [PATCH] [FW] Add filter for existant Deezer albums --- roles/music/tasks/download_music.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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