2021-10-13 17:53:07 +02:00
|
|
|
- name: Update deemix configuration file
|
2021-05-12 17:13:33 +02:00
|
|
|
template:
|
2021-10-13 17:53:07 +02:00
|
|
|
src: deemix_config.json.j2
|
|
|
|
dest: "{{ deemix_folder_path }}/config/config.json"
|
|
|
|
owner: "{{ base_user_name }}"
|
|
|
|
group: "{{ base_user_name }}"
|
|
|
|
mode: 0644
|
|
|
|
|
|
|
|
- name: Update ARL token file
|
|
|
|
template:
|
|
|
|
src: arl.j2
|
|
|
|
dest: "{{ deemix_folder_path }}/config/.arl"
|
2021-05-12 17:13:33 +02:00
|
|
|
owner: "{{ base_user_name }}"
|
|
|
|
group: "{{ base_user_name }}"
|
|
|
|
mode: 0644
|
|
|
|
|
2024-03-18 23:26:49 +01:00
|
|
|
- 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
|
|
|
|
|
2021-05-11 13:56:51 +02:00
|
|
|
- name: Download required albums
|
2021-05-12 18:45:18 +02:00
|
|
|
# So that files are written with base user perms
|
2024-03-18 23:26:49 +01:00
|
|
|
become: true
|
2021-05-12 18:45:18 +02:00
|
|
|
become_user: "{{ base_user_name }}"
|
2021-05-11 13:56:51 +02:00
|
|
|
shell:
|
2021-10-13 17:53:07 +02:00
|
|
|
cmd: "deemix --portable -p {{ deemix_songs_path }} {{ item }}"
|
|
|
|
chdir: "{{ deemix_folder_path }}"
|
2024-03-18 23:26:49 +01:00
|
|
|
with_items: "{{ lookup('file', '/tmp/unique_albums.txt').splitlines() }}"
|
2021-10-13 17:53:07 +02:00
|
|
|
register: output_deemix
|
2021-05-11 13:56:51 +02:00
|
|
|
|
|
|
|
- name: Show download state
|
|
|
|
debug:
|
2021-10-13 17:53:07 +02:00
|
|
|
msg: "{{ output_deemix }}"
|