Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/release-builder-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: api-feature
ref: search-filter-fix

- name: Set up Python
uses: actions/setup-python@v4
Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: api-feature
ref: search-filter-fix

- name: Run macOS Build Script
run: scripts/build_mac.sh
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: api-feature
ref: search-filter-fix

- name: Run macOS Build Script
run: scripts/build_mac.sh
Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: api-feature
ref: search-filter-fix

- name: Install Dependencies
run: |
Expand Down Expand Up @@ -138,7 +138,7 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: api-feature
ref: search-filter-fix

- name: Install Dependencies
run: |
Expand Down
1 change: 1 addition & 0 deletions src/onthespot/api/apple_music.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ def apple_music_get_track_metadata(session, item_id):
info['image_url'] = image_url.replace("{w}", str(max_width)).replace("{h}", str(max_height))

info['writer'] = track_data.get('data', [])[0].get('attributes', {}).get('composerName')
info['composer'] = info['writer']
info['language'] = track_data.get('data', [])[0].get('attributes', {}).get('audioLocale')
info['item_url'] = track_data.get('data', [])[0].get('attributes', {}).get('url')
info['is_playable'] = True if track_data.get('data', [])[0].get('attributes', {}).get('playParams') else False
Expand Down
1 change: 1 addition & 0 deletions src/onthespot/api/spotify.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@ def spotify_get_track_metadata(token, item_id):
info['performers'] = conv_list_format([item for item in credits.get('performers', []) if isinstance(item, str)])
info['producers'] = conv_list_format([item for item in credits.get('producers', []) if isinstance(item, str)])
info['writers'] = conv_list_format([item for item in credits.get('writers', []) if isinstance(item, str)])
info['composer'] = info['writers']

if track_audio_data:
key_mapping = {
Expand Down
1 change: 1 addition & 0 deletions src/onthespot/otsconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ def __init__(self, cfg_path=None):
"embed_performers": True,
"embed_producers": True,
"embed_writers": True,
"embed_composer": True,
"embed_label": True,
"embed_copyright": True,
"embed_description": True,
Expand Down
14 changes: 14 additions & 0 deletions src/onthespot/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import json
import os
import platform
import re
import requests
import ssl
import subprocess
Expand Down Expand Up @@ -148,6 +149,10 @@ def format_item_path(item, item_metadata):
elif item['item_type'] == 'episode':
path = config.get("show_path_formatter")

# Split composer
composer_full = item_metadata.get('composer', '')
composer_first = re.split(r' [,&;] | & |,|;', composer_full)[0].strip() if composer_full else ''

item_path = path.format(
# Universal
service=sanitize_data(item.get('item_service')).title(),
Expand All @@ -156,8 +161,10 @@ def format_item_path(item, item_metadata):
year=sanitize_data(item_metadata.get('release_year')),
explicit=sanitize_data(str(config.get('explicit_label')) if item_metadata.get('explicit') else ''),


# Audio
artist=sanitize_data(item_metadata.get('artists')),
composer=sanitize_data(composer_first),
album=sanitize_data(album),
album_artist=sanitize_data(item_metadata.get('album_artists')),
album_type=item_metadata.get('album_type', 'single').title(),
Expand Down Expand Up @@ -401,6 +408,12 @@ def embed_metadata(item, metadata):
else:
command += ['-metadata', 'author={}'.format(value)]

elif key == 'composer' and config.get("embed_composer"):
if filetype == '.mp3':
command += ['-metadata', 'TCOM={}'.format(value)]
else:
command += ['-metadata', 'composer={}'.format(value)]

elif key == 'label' and config.get("embed_label"):
if filetype in ['.flac', '.ogg', '.opus']:
command += ['-metadata', 'label={}'.format(value)]
Expand Down Expand Up @@ -663,6 +676,7 @@ def add_to_m3u_file(item, item_metadata):
service=item.get('item_service').title(),
service_id=str(item.get('item_id')),
artist=item_metadata.get('artists'),
composer=item_metadata.get('composer'),
album=item_metadata.get('album_name'),
album_artist=item_metadata.get('album_artists'),
album_type=item_metadata.get('album_type', 'single').title(),
Expand Down