mirror of
https://github.com/THIS-IS-NOT-A-BACKUP/zspotify.git
synced 2024-12-02 04:23:57 +01:00
Merge pull request #184 from thomaslty/main
artist name based on user's language preference
This commit is contained in:
commit
6dbe5e8940
@ -18,6 +18,8 @@ ARTIST = 'artist'
|
|||||||
|
|
||||||
ARTISTS = 'artists'
|
ARTISTS = 'artists'
|
||||||
|
|
||||||
|
ALBUMARTIST = 'albumartist'
|
||||||
|
|
||||||
ARTWORK = 'artwork'
|
ARTWORK = 'artwork'
|
||||||
|
|
||||||
TRACKS = 'tracks'
|
TRACKS = 'tracks'
|
||||||
@ -132,5 +134,6 @@ CONFIG_DEFAULT_SETTINGS = {
|
|||||||
'OVERRIDE_AUTO_WAIT': False,
|
'OVERRIDE_AUTO_WAIT': False,
|
||||||
'CHUNK_SIZE': 50000,
|
'CHUNK_SIZE': 50000,
|
||||||
'SPLIT_ALBUM_DISCS': False,
|
'SPLIT_ALBUM_DISCS': False,
|
||||||
'DOWNLOAD_REAL_TIME': False
|
'DOWNLOAD_REAL_TIME': False,
|
||||||
|
'LANGUAGE': 'en'
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ import music_tag
|
|||||||
import requests
|
import requests
|
||||||
|
|
||||||
from const import ARTIST, TRACKTITLE, ALBUM, YEAR, DISCNUMBER, TRACKNUMBER, ARTWORK, \
|
from const import ARTIST, TRACKTITLE, ALBUM, YEAR, DISCNUMBER, TRACKNUMBER, ARTWORK, \
|
||||||
WINDOWS_SYSTEM
|
WINDOWS_SYSTEM, ALBUMARTIST
|
||||||
|
|
||||||
|
|
||||||
class MusicFormat(str, Enum):
|
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:
|
def set_audio_tags(filename, artists, name, album_name, release_year, disc_number, track_number) -> None:
|
||||||
""" sets music_tag metadata """
|
""" sets music_tag metadata """
|
||||||
tags = music_tag.load_file(filename)
|
tags = music_tag.load_file(filename)
|
||||||
|
tags[ALBUMARTIST] = artists[0]
|
||||||
tags[ARTIST] = conv_artist_format(artists)
|
tags[ARTIST] = conv_artist_format(artists)
|
||||||
tags[TRACKTITLE] = name
|
tags[TRACKTITLE] = name
|
||||||
tags[ALBUM] = album_name
|
tags[ALBUM] = album_name
|
||||||
|
@ -79,11 +79,16 @@ class ZSpotify:
|
|||||||
@classmethod
|
@classmethod
|
||||||
def get_auth_header(cls):
|
def get_auth_header(cls):
|
||||||
return {
|
return {
|
||||||
AUTHORIZATION: f'Bearer {cls.__get_auth_token()}'}
|
'Authorization': f'Bearer {cls.__get_auth_token()}',
|
||||||
|
'Accept-Language': f'{cls.CONFIG.get("LANGUAGE")}'
|
||||||
|
}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def get_auth_header_and_params(cls, limit, offset):
|
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
|
@classmethod
|
||||||
def invoke_url_with_params(cls, url, limit, offset, **kwargs):
|
def invoke_url_with_params(cls, url, limit, offset, **kwargs):
|
||||||
|
Loading…
Reference in New Issue
Block a user