Merge pull request #184 from thomaslty/main

artist name based on user's language preference
This commit is contained in:
Logykk 2021-11-08 12:26:01 +13:00 committed by GitHub
commit 6dbe5e8940
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 4 deletions

View File

@ -18,6 +18,8 @@ ARTIST = 'artist'
ARTISTS = 'artists'
ALBUMARTIST = 'albumartist'
ARTWORK = 'artwork'
TRACKS = 'tracks'
@ -132,5 +134,6 @@ CONFIG_DEFAULT_SETTINGS = {
'OVERRIDE_AUTO_WAIT': False,
'CHUNK_SIZE': 50000,
'SPLIT_ALBUM_DISCS': False,
'DOWNLOAD_REAL_TIME': False
'DOWNLOAD_REAL_TIME': False,
'LANGUAGE': 'en'
}

View File

@ -10,7 +10,7 @@ import music_tag
import requests
from const import ARTIST, TRACKTITLE, ALBUM, YEAR, DISCNUMBER, TRACKNUMBER, ARTWORK, \
WINDOWS_SYSTEM
WINDOWS_SYSTEM, ALBUMARTIST
class MusicFormat(str, Enum):
@ -102,6 +102,7 @@ def clear() -> None:
def set_audio_tags(filename, artists, name, album_name, release_year, disc_number, track_number) -> None:
""" sets music_tag metadata """
tags = music_tag.load_file(filename)
tags[ALBUMARTIST] = artists[0]
tags[ARTIST] = conv_artist_format(artists)
tags[TRACKTITLE] = name
tags[ALBUM] = album_name

View File

@ -79,11 +79,16 @@ class ZSpotify:
@classmethod
def get_auth_header(cls):
return {
AUTHORIZATION: f'Bearer {cls.__get_auth_token()}'}
'Authorization': f'Bearer {cls.__get_auth_token()}',
'Accept-Language': f'{cls.CONFIG.get("LANGUAGE")}'
}
@classmethod
def get_auth_header_and_params(cls, limit, offset):
return {AUTHORIZATION: f'Bearer {cls.__get_auth_token()}'}, {LIMIT: limit, OFFSET: offset}
return {
'Authorization': f'Bearer {cls.__get_auth_token()}',
'Accept-Language': f'{cls.CONFIG.get("LANGUAGE")}'
}, {LIMIT: limit, OFFSET: offset}
@classmethod
def invoke_url_with_params(cls, url, limit, offset, **kwargs):