From 3e6b2d1d3ce914b73c654a9dc282d5cd31fb964a Mon Sep 17 00:00:00 2001 From: uh wot Date: Thu, 4 Jan 2024 13:34:38 +0100 Subject: [PATCH 1/2] rework spatial codec handling --- interface.py | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/interface.py b/interface.py index 52f9dfa..f8e4103 100644 --- a/interface.py +++ b/interface.py @@ -26,7 +26,6 @@ module_information = ModuleInformation( 'mobile_atmos_hires_token': 'km8T1xS355y7dd3H', 'mobile_hires_token': '6BDSRdpK9hqEBTgU', 'enable_mobile': True, - 'force_non_spatial': False, 'prefer_ac4': False, 'fix_mqa': True }, @@ -460,15 +459,16 @@ class ModuleInterface: media_tags = track_data['mediaMetadata']['tags'] format = None - if 'HIRES_LOSSLESS' in media_tags and quality_tier is QualityEnum.HIFI: + if codec_options.spatial_codecs: + if 'SONY_360RA' in media_tags: + format = '360ra' + elif 'DOLBY_ATMOS' in media_tags: + if self.settings['prefer_ac4']: + format = 'ac4' + else: + format = 'ac3' + if 'HIRES_LOSSLESS' in media_tags and not format and quality_tier is QualityEnum.HIFI: format = 'flac_hires' - if 'SONY_360RA' in media_tags and not format and not self.settings['force_non_spatial']: - format = '360ra' - if 'DOLBY_ATMOS' in media_tags and not format and not self.settings['force_non_spatial']: - if self.settings['prefer_ac4']: - format = 'ac4' - else: - format = 'ac3' session = { 'flac_hires': SessionType.MOBILE_DEFAULT, @@ -607,10 +607,6 @@ class ModuleInterface: credits_extra_kwargs={'data': {track_id: track_data['credits']} if 'credits' in track_data else {}} ) - if not codec_options.spatial_codecs and codec_data[track_codec].spatial: - track_info.error = 'Info: Spatial codecs are disabled, if you want to download it, set "spatial_codecs": ' \ - 'true ' - if error is not None: track_info.error = f'Error: {error}' From ffff53f4276c1e701edbeb6b3fd8a290175c3d02 Mon Sep 17 00:00:00 2001 From: uh wot Date: Thu, 4 Jan 2024 13:52:26 +0100 Subject: [PATCH 2/2] remove 'force_non_spatial' setting from README --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index dc8ece8..14d844e 100644 --- a/README.md +++ b/README.md @@ -142,7 +142,6 @@ loaded module. You'll find the configuration file here: `config/settings.json` "mobile_atmos_token": "dN2N95wCyEBTllu4", "mobile_default_token": "WAU9gXp3tHhK4Nns", "enable_mobile": true, - "force_non_spatial": false, "prefer_ac4": false, "fix_mqa": true } @@ -154,7 +153,6 @@ loaded module. You'll find the configuration file here: `config/settings.json` | tv_secret | Enter a valid TV client secret for the `tv_token` | | mobile_* | Enter a valid MOBILE client token for the desired session | | enable_mobile | Enables a second MOBILE session which needs a `username` and `password` (can be the same "TV" account) to archive Sony 360RA and Dolby AC-4 if available or allows `force_non_spatial` to work properly | -| force_non_spatial | Forces a default Mobile session (`mobile_default_token` without support for Dolby Atmos at all, Sony 360RA will still be available) to get FLAC/AAC tracks | | prefer_ac4 | If enabled and a mobile session is available (`enable_mobile` is set to `true`) this will ensure to get Dolby AC-4 on Dolby Atmos tracks | | fix_mqa | If enabled it will download the MQA file before the actual track and analyze the FLAC file to extract the bitDepth and originalSampleRate. The tags `MQAENCODER`, `ENCODER` and `ORIGINALSAMPLERATE` are than added to the FLAC file in order to get properly detected by MQA enabled software such as Roon, UAPP or Audirvana. |