Add external domain support for URLs
All checks were successful
Validate / Hassfest (push) Successful in 4s
All checks were successful
Validate / Hassfest (push) Successful in 4s
- Fetch externalDomain from Immich server config on startup - Use external domain for user-facing URLs (share links, asset URLs) - Keep internal connection URL for API calls - Add get_internal_download_url() to convert external URLs back to internal for faster local network downloads (Telegram notifications) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -535,9 +535,10 @@ class ImmichAlbumBaseSensor(CoordinatorEntity[ImmichAlbumWatcherCoordinator], Se
|
||||
_LOGGER.debug("Cached file_id request failed: %s", err)
|
||||
|
||||
try:
|
||||
# Download the photo
|
||||
_LOGGER.debug("Downloading photo from %s", url[:80])
|
||||
async with session.get(url) as resp:
|
||||
# Download the photo using internal URL for faster local network transfer
|
||||
download_url = self.coordinator.get_internal_download_url(url)
|
||||
_LOGGER.debug("Downloading photo from %s", download_url[:80])
|
||||
async with session.get(download_url) as resp:
|
||||
if resp.status != 200:
|
||||
return {
|
||||
"success": False,
|
||||
@@ -680,9 +681,10 @@ class ImmichAlbumBaseSensor(CoordinatorEntity[ImmichAlbumWatcherCoordinator], Se
|
||||
_LOGGER.debug("Cached file_id request failed: %s", err)
|
||||
|
||||
try:
|
||||
# Download the video
|
||||
_LOGGER.debug("Downloading video from %s", url[:80])
|
||||
async with session.get(url) as resp:
|
||||
# Download the video using internal URL for faster local network transfer
|
||||
download_url = self.coordinator.get_internal_download_url(url)
|
||||
_LOGGER.debug("Downloading video from %s", download_url[:80])
|
||||
async with session.get(download_url) as resp:
|
||||
if resp.status != 200:
|
||||
return {
|
||||
"success": False,
|
||||
@@ -958,8 +960,10 @@ class ImmichAlbumBaseSensor(CoordinatorEntity[ImmichAlbumWatcherCoordinator], Se
|
||||
continue
|
||||
|
||||
try:
|
||||
_LOGGER.debug("Downloading media %d from %s", chunk_idx * max_group_size + i, url[:80])
|
||||
async with session.get(url) as resp:
|
||||
# Download using internal URL for faster local network transfer
|
||||
download_url = self.coordinator.get_internal_download_url(url)
|
||||
_LOGGER.debug("Downloading media %d from %s", chunk_idx * max_group_size + i, download_url[:80])
|
||||
async with session.get(download_url) as resp:
|
||||
if resp.status != 200:
|
||||
return {
|
||||
"success": False,
|
||||
|
||||
Reference in New Issue
Block a user