feat: overwrite storefront to download other region's songs

This commit is contained in:
WorldObservationLog
2024-05-09 14:11:51 +08:00
parent 075bc789bd
commit fee042fd6f

View File

@@ -159,7 +159,10 @@ class NewInteractiveShell:
async def _get_available_device(self, storefront: str):
devices = self.storefront_device_mapping.get(storefront)
if not devices:
logger.error(f"No device is available to decrypt the specified region: {storefront}")
logger.warning(f"No device is available to decrypt the specified region: {storefront}. "
f"Overwriting storefront to {self.config.region.defaultStorefront}")
storefront = self.config.region.defaultStorefront
devices = self.storefront_device_mapping.get(storefront)
available_devices = [device for device in devices if not device.decryptLock.locked()]
if not available_devices:
available_device: Device = random.choice(devices)