Merge pull request #55 from uhwot/spatial-codec-rework

rework spatial codec handling
This commit is contained in:
Daniel
2024-01-04 14:02:11 +01:00
committed by GitHub
2 changed files with 9 additions and 15 deletions

View File

@@ -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. |

View File

@@ -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:
format = 'flac_hires'
if 'SONY_360RA' in media_tags and not format and not self.settings['force_non_spatial']:
if codec_options.spatial_codecs:
if 'SONY_360RA' in media_tags:
format = '360ra'
if 'DOLBY_ATMOS' in media_tags and not format and not self.settings['force_non_spatial']:
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'
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}'