Compare commits

..

11 Commits

Author SHA1 Message Date
shenlong-tanwen
82a4c28606 fix: fetch origin name before upload 2025-09-13 04:04:05 +05:30
bo0tzz
23aa661324 fix: use mdq image with jq (#21860) 2025-09-12 21:46:39 +02:00
Min Idzelis
a10a946d1a fix: let dev docker compose service runs as root (#21579) 2025-09-12 16:20:41 +01:00
Stewart Rand
04c9531624 fix: format point count numbers on map view (#21848)
Format numbers on map view
2025-09-12 07:20:05 +00:00
Alex
d84cc450f1 chore: post release tasks (#21834) 2025-09-11 15:15:10 -05:00
github-actions
4153848c68 chore: version v1.142.0 2025-09-11 19:39:05 +00:00
Jason Rasmussen
f29230c8a6 fix(web): handle buckets before year 1000 (#21832) 2025-09-11 14:36:16 -05:00
Weblate (bot)
03af60e8eb chore(web): update translations (#21814)
Translate-URL: https://hosted.weblate.org/projects/immich/immich/ja/
Translate-URL: https://hosted.weblate.org/projects/immich/immich/ru/
Translation: Immich/immich

Co-authored-by: DevServs <bonov@mail.ru>
Co-authored-by: Taiki M <vexingly-many-mace@duck.com>
2025-09-11 19:34:40 +00:00
bo0tzz
ae827e1406 fix: define call secrets in merge-translations (#21831) 2025-09-11 19:29:58 +00:00
shenlong
7893ac25fb fix: always use en locale for parsing timeline datetime (#21796)
Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
2025-09-11 14:20:39 -05:00
Alex
42a03f2556 fix: concurrency issue (#21830) 2025-09-11 19:02:03 +00:00
44 changed files with 288 additions and 472 deletions

View File

@@ -26,7 +26,7 @@ services:
env_file: !reset [] env_file: !reset []
init: init:
env_file: !reset [] env_file: !reset []
command: sh -c 'find /data -maxdepth 1 ! -path "/data/postgres" -type d -exec chown ${UID:-1000}:${GID:-1000} {} + 2>/dev/null || true; for path in /usr/src/app/.pnpm-store /usr/src/app/server/node_modules /usr/src/app/server/dist /usr/src/app/.github/node_modules /usr/src/app/cli/node_modules /usr/src/app/docs/node_modules /usr/src/app/e2e/node_modules /usr/src/app/open-api/typescript-sdk/node_modules /usr/src/app/web/.svelte-kit /usr/src/app/web/coverage /usr/src/app/node_modules /usr/src/app/web/node_modules; do [ -e "$$path" ] && chown -R ${UID:-1000}:${GID:-1000} "$$path" || true; done' command: sh -c 'find /data -maxdepth 1 ! -path "/data/postgres" -type d -exec chown ${UID:-0}:${GID:-0} {} + 2>/dev/null || true; for path in /usr/src/app/.pnpm-store /usr/src/app/server/node_modules /usr/src/app/server/dist /usr/src/app/.github/node_modules /usr/src/app/cli/node_modules /usr/src/app/docs/node_modules /usr/src/app/e2e/node_modules /usr/src/app/open-api/typescript-sdk/node_modules /usr/src/app/web/.svelte-kit /usr/src/app/web/coverage /usr/src/app/node_modules /usr/src/app/web/node_modules; do [ -e "$$path" ] && chown -R ${UID:-0}:${GID:-0} "$$path" || true; done'
immich-machine-learning: immich-machine-learning:
env_file: !reset [] env_file: !reset []
database: database:

View File

@@ -35,7 +35,7 @@ jobs:
needs: [get_body, should_run] needs: [get_body, should_run]
if: ${{ needs.should_run.outputs.should_run == 'true' }} if: ${{ needs.should_run.outputs.should_run == 'true' }}
container: container:
image: yshavit/mdq:0.9.0@sha256:4399483ca857fb1a7ed28a596f754c7373e358647de31ce14b79a27c91e1e35e image: ghcr.io/immich-app/mdq:main@sha256:1669c75a5542333ff6b03c13d5fd259ea8d798188b84d5d99093d62e4542eb05
outputs: outputs:
checked: ${{ steps.get_checkbox.outputs.checked }} checked: ${{ steps.get_checkbox.outputs.checked }}
steps: steps:

View File

@@ -1,8 +1,15 @@
name: Merge translations name: Merge translations
on: on:
workflow_call:
workflow_dispatch: workflow_dispatch:
workflow_call:
secrets:
PUSH_O_MATIC_APP_ID:
required: true
PUSH_O_MATIC_APP_KEY:
required: true
WEBLATE_TOKEN:
required: true
permissions: {} permissions: {}

View File

@@ -70,11 +70,9 @@ VOLUME_DIRS = \
# Helper function to chown, on error suggest remediation and exit # Helper function to chown, on error suggest remediation and exit
define safe_chown define safe_chown
if chown $(2) $(or $(UID),1000):$(or $(GID),1000) "$(1)" 2>/dev/null; then \ CURRENT_OWNER=$$(stat -c '%u:%g' "$(1)" 2>/dev/null || echo "none"); \
true; \ DESIRED_OWNER="$(or $(UID),0):$(or $(GID),0)"; \
else \ if [ "$$CURRENT_OWNER" != "$$DESIRED_OWNER" ] && ! chown -v $(2) $$DESIRED_OWNER "$(1)" 2>/dev/null; then \
STATUS=$$?; echo "Exit code: $$STATUS $(1)"; \
echo "$$STATUS $(1)"; \
echo "Permission denied when changing owner of volumes and upload location. Try running 'sudo make prepare-volumes' first."; \ echo "Permission denied when changing owner of volumes and upload location. Try running 'sudo make prepare-volumes' first."; \
exit 1; \ exit 1; \
fi; fi;

View File

@@ -1,6 +1,6 @@
{ {
"name": "@immich/cli", "name": "@immich/cli",
"version": "2.2.88", "version": "2.2.89",
"description": "Command Line Interface (CLI) for Immich", "description": "Command Line Interface (CLI) for Immich",
"type": "module", "type": "module",
"exports": "./dist/index.js", "exports": "./dist/index.js",

View File

@@ -21,7 +21,7 @@ services:
# extends: # extends:
# file: hwaccel.transcoding.yml # file: hwaccel.transcoding.yml
# service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding # service: cpu # set to one of [nvenc, quicksync, rkmpp, vaapi, vaapi-wsl] for accelerated transcoding
user: '${UID:-1000}:${GID:-1000}' user: '${UID:-0}:${GID:-0}'
build: build:
context: ../ context: ../
dockerfile: server/Dockerfile dockerfile: server/Dockerfile
@@ -82,7 +82,7 @@ services:
image: immich-web-dev:latest image: immich-web-dev:latest
# Needed for rootless docker setup, see https://github.com/moby/moby/issues/45919 # Needed for rootless docker setup, see https://github.com/moby/moby/issues/45919
# user: 0:0 # user: 0:0
user: '${UID:-1000}:${GID:-1000}' user: '${UID:-0}:${GID:-0}'
build: build:
context: ../ context: ../
dockerfile: server/Dockerfile dockerfile: server/Dockerfile
@@ -189,7 +189,7 @@ services:
env_file: env_file:
- .env - .env
user: 0:0 user: 0:0
command: sh -c 'find /data -maxdepth 1 -type d -exec chown ${UID:-1000}:${GID:-1000} {} + 2>/dev/null || true; for path in /usr/src/app/.pnpm-store /usr/src/app/server/node_modules /usr/src/app/server/dist /usr/src/app/.github/node_modules /usr/src/app/cli/node_modules /usr/src/app/docs/node_modules /usr/src/app/e2e/node_modules /usr/src/app/open-api/typescript-sdk/node_modules /usr/src/app/web/.svelte-kit /usr/src/app/web/coverage /usr/src/app/node_modules /usr/src/app/web/node_modules; do [ -e "$$path" ] && chown -R ${UID:-1000}:${GID:-1000} "$$path" || true; done' command: sh -c 'find /data -maxdepth 1 -type d -exec chown ${UID:-0}:${GID:-0} {} + 2>/dev/null || true; for path in /usr/src/app/.pnpm-store /usr/src/app/server/node_modules /usr/src/app/server/dist /usr/src/app/.github/node_modules /usr/src/app/cli/node_modules /usr/src/app/docs/node_modules /usr/src/app/e2e/node_modules /usr/src/app/open-api/typescript-sdk/node_modules /usr/src/app/web/.svelte-kit /usr/src/app/web/coverage /usr/src/app/node_modules /usr/src/app/web/node_modules; do [ -e "$$path" ] && chown -R ${UID:-0}:${GID:-0} "$$path" || true; done'
volumes: volumes:
- pnpm-store:/usr/src/app/.pnpm-store - pnpm-store:/usr/src/app/.pnpm-store
- server-node_modules:/usr/src/app/server/node_modules - server-node_modules:/usr/src/app/server/node_modules

View File

@@ -1,4 +1,8 @@
[ [
{
"label": "v1.142.0",
"url": "https://v1.142.0.archive.immich.app"
},
{ {
"label": "v1.141.1", "label": "v1.141.1",
"url": "https://v1.141.1.archive.immich.app" "url": "https://v1.141.1.archive.immich.app"

View File

@@ -1,6 +1,6 @@
{ {
"name": "immich-e2e", "name": "immich-e2e",
"version": "1.141.1", "version": "1.142.0",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"type": "module", "type": "module",

View File

@@ -1473,9 +1473,9 @@
"permission_onboarding_permission_limited": "写真へのアクセスが制限されています。Immichが写真のバックアップと管理を行うには、システム設定から写真と動画のアクセス権限を変更してください。", "permission_onboarding_permission_limited": "写真へのアクセスが制限されています。Immichが写真のバックアップと管理を行うには、システム設定から写真と動画のアクセス権限を変更してください。",
"permission_onboarding_request": "Immichは写真へのアクセス許可が必要です", "permission_onboarding_request": "Immichは写真へのアクセス許可が必要です",
"person": "人物", "person": "人物",
"person_age_months": "{months, plural, one {# ヶ月} other {# ヶ月}}", "person_age_months": "生後 {months, plural, one {# ヶ月} other {# ヶ月}}",
"person_age_year_months": "1 , {months, plural, one {# ヶ月} other {# ヶ月}}", "person_age_year_months": "1 歳と, {months, plural, one {# ヶ月} other {# ヶ月}}",
"person_age_years": "{years, plural, other {# }}", "person_age_years": "{years, plural, other {# }}",
"person_birthdate": "{date}生まれ", "person_birthdate": "{date}生まれ",
"person_hidden": "{name}{hidden, select, true { (非表示)} other {}}", "person_hidden": "{name}{hidden, select, true { (非表示)} other {}}",
"photo_shared_all_users": "写真をすべてのユーザーと共有したか、共有するユーザーがいないようです。", "photo_shared_all_users": "写真をすべてのユーザーと共有したか、共有するユーザーがいないようです。",
@@ -2024,7 +2024,7 @@
"upload_success": "アップロード成功、新しくアップロードされたアセットを見るにはページを更新してください。", "upload_success": "アップロード成功、新しくアップロードされたアセットを見るにはページを更新してください。",
"upload_to_immich": "Immichにアップロード ({count})", "upload_to_immich": "Immichにアップロード ({count})",
"uploading": "アップロード中", "uploading": "アップロード中",
"uploading_media": "メディアをアップロード", "uploading_media": "メディアをアップロード",
"url": "URL", "url": "URL",
"usage": "使用容量", "usage": "使用容量",
"use_biometric": "生体認証をご利用ください", "use_biometric": "生体認証をご利用ください",

View File

@@ -35,7 +35,7 @@
"add_url": "Добавить URL", "add_url": "Добавить URL",
"added_to_archive": "Добавлено в архив", "added_to_archive": "Добавлено в архив",
"added_to_favorites": "Добавлено в избранное", "added_to_favorites": "Добавлено в избранное",
"added_to_favorites_count": "Добавлено{count, number} в избранное", "added_to_favorites_count": "{count, plural, one {# объект добавлен} many {# объектов добавлено} other {# объекта добавлено}} в избранное",
"admin": { "admin": {
"add_exclusion_pattern_description": "Добавьте шаблоны исключений. Поддерживаются символы подстановки *, ** и ?. Чтобы игнорировать все файлы в любом каталоге с именем \"Raw\", укажите \"**/Raw/**\". Чтобы игнорировать все файлы, заканчивающиеся на \".tif\", используйте \"**/*.tif\". Чтобы игнорировать путь целиком, укажите \"/path/to/ignore/**\".", "add_exclusion_pattern_description": "Добавьте шаблоны исключений. Поддерживаются символы подстановки *, ** и ?. Чтобы игнорировать все файлы в любом каталоге с именем \"Raw\", укажите \"**/Raw/**\". Чтобы игнорировать все файлы, заканчивающиеся на \".tif\", используйте \"**/*.tif\". Чтобы игнорировать путь целиком, укажите \"/path/to/ignore/**\".",
"admin_user": "Администратор", "admin_user": "Администратор",
@@ -448,7 +448,7 @@
"all_albums": "Все альбомы", "all_albums": "Все альбомы",
"all_people": "Все люди", "all_people": "Все люди",
"all_videos": "Все видео", "all_videos": "Все видео",
"allow_dark_mode": "Разрешить темный режим", "allow_dark_mode": "Разрешить тёмный режим",
"allow_edits": "Разрешить редактирование", "allow_edits": "Разрешить редактирование",
"allow_public_user_to_download": "Разрешить скачивание", "allow_public_user_to_download": "Разрешить скачивание",
"allow_public_user_to_upload": "Разрешить добавление файлов", "allow_public_user_to_upload": "Разрешить добавление файлов",
@@ -1112,14 +1112,14 @@
"home_page_add_to_album_conflicts": "Добавлено {added} медиа в альбом {album}. {failed} медиа уже в альбоме.", "home_page_add_to_album_conflicts": "Добавлено {added} медиа в альбом {album}. {failed} медиа уже в альбоме.",
"home_page_add_to_album_err_local": "Пока нельзя добавлять локальные объекты в альбомы, пропуск", "home_page_add_to_album_err_local": "Пока нельзя добавлять локальные объекты в альбомы, пропуск",
"home_page_add_to_album_success": "Добавлено {added} медиа в альбом {album}.", "home_page_add_to_album_success": "Добавлено {added} медиа в альбом {album}.",
"home_page_album_err_partner": "Пока нельзя добавить медиа партнера в альбом, пропуск", "home_page_album_err_partner": "Невозможно добавить объекты партнёра в альбом, пропуск",
"home_page_archive_err_local": "Пока нельзя добавить локальные файлы в архив, пропуск", "home_page_archive_err_local": "Пока нельзя добавить локальные файлы в архив, пропуск",
"home_page_archive_err_partner": "Невозможно архивировать медиа партнера, пропуск", "home_page_archive_err_partner": "Невозможно добавить объекты партнёра в архив, пропуск",
"home_page_building_timeline": "Построение хронологии", "home_page_building_timeline": "Построение хронологии",
"home_page_delete_err_partner": "Невозможно удалить медиа партнера, пропуск", "home_page_delete_err_partner": "Невозможно удалить объекты партнёра, пропуск",
"home_page_delete_remote_err_local": "Невозможно удалить локальные файлы с сервера, пропуск", "home_page_delete_remote_err_local": "Невозможно удалить локальные файлы с сервера, пропуск",
"home_page_favorite_err_local": "Пока нельзя добавить в избранное локальные файлы, пропуск", "home_page_favorite_err_local": "Пока нельзя добавить в избранное локальные файлы, пропуск",
"home_page_favorite_err_partner": "Пока нельзя добавить в избранное медиа партнера, пропуск", "home_page_favorite_err_partner": "Невозможно добавить объекты партнёра в избранное, пропуск",
"home_page_first_time_notice": "Перед началом использования приложения выберите альбом с объектами для резервного копирования, чтобы они отобразились на временной шкале", "home_page_first_time_notice": "Перед началом использования приложения выберите альбом с объектами для резервного копирования, чтобы они отобразились на временной шкале",
"home_page_locked_error_local": "Невозможно переместить локальные объекты в личную папку, пропуск", "home_page_locked_error_local": "Невозможно переместить локальные объекты в личную папку, пропуск",
"home_page_locked_error_partner": "Невозможно переместить объекты партнёра в личную папку, пропуск", "home_page_locked_error_partner": "Невозможно переместить объекты партнёра в личную папку, пропуск",
@@ -1154,8 +1154,8 @@
"in_albums": "В {count, plural, one {# альбоме} other {# альбомах}}", "in_albums": "В {count, plural, one {# альбоме} other {# альбомах}}",
"in_archive": "В архиве", "in_archive": "В архиве",
"include_archived": "Отображать архив", "include_archived": "Отображать архив",
"include_shared_albums": "Включать общие альбомы", "include_shared_albums": "Включать объекты общих альбомов",
"include_shared_partner_assets": "Включать общие ресурсы партнера", "include_shared_partner_assets": "Включать объекты партнёров",
"individual_share": "Индивидуальная подборка", "individual_share": "Индивидуальная подборка",
"individual_shares": "Подборки", "individual_shares": "Подборки",
"info": "Информация", "info": "Информация",
@@ -1367,7 +1367,7 @@
"no_duplicates_found": "Дубликатов не обнаружено.", "no_duplicates_found": "Дубликатов не обнаружено.",
"no_exif_info_available": "Нет доступной информации exif", "no_exif_info_available": "Нет доступной информации exif",
"no_explore_results_message": "Загружайте больше фотографий, чтобы наслаждаться вашей коллекцией.", "no_explore_results_message": "Загружайте больше фотографий, чтобы наслаждаться вашей коллекцией.",
"no_favorites_message": "Добавляйте в избранное, чтобы быстро найти свои лучшие фотографии и видео", "no_favorites_message": "Добавляйте объекты в избранное, чтобы быстрее находить свои лучшие фото и видео",
"no_libraries_message": "Создайте внешнюю библиотеку для просмотра в Immich сторонних фотографий и видео", "no_libraries_message": "Создайте внешнюю библиотеку для просмотра в Immich сторонних фотографий и видео",
"no_locked_photos_message": "Фото и видео, перемещенные в личную папку, скрыты и не отображаются при просмотре библиотеки.", "no_locked_photos_message": "Фото и видео, перемещенные в личную папку, скрыты и не отображаются при просмотре библиотеки.",
"no_name": "Нет имени", "no_name": "Нет имени",
@@ -1422,18 +1422,18 @@
"other_variables": "Другие переменные", "other_variables": "Другие переменные",
"owned": "Мои", "owned": "Мои",
"owner": "Владелец", "owner": "Владелец",
"partner": "Партнер", "partner": "Партнёр",
"partner_can_access": "{partner} имеет доступ", "partner_can_access": "Пользователю {partner} доступны",
"partner_can_access_assets": "Все ваши фотографии и видеозаписи, кроме тех, которые находятся в Архиве и Корзине", "partner_can_access_assets": "Все ваши фото и видео, кроме тех, что находятся в архиве и корзине",
"partner_can_access_location": "Местоположение, где были сделаны ваши фотографии", "partner_can_access_location": "Места, где были сделаны ваши фото и видео",
"partner_list_user_photos": "Фотографии пользователя {user}", "partner_list_user_photos": "Фото и видео пользователя {user}",
"partner_list_view_all": "Посмотреть все", "partner_list_view_all": "Посмотреть все",
"partner_page_empty_message": "У вашего партнёра еще нет доступа к вашим фото.", "partner_page_empty_message": "Вы пока никому из партнёров не предоставили доступ к своим фото и видео.",
"partner_page_no_more_users": "Выбраны все доступные пользователи", "partner_page_no_more_users": "Выбраны все доступные пользователи",
"partner_page_partner_add_failed": "Не удалось добавить партнёра", "partner_page_partner_add_failed": "Не удалось добавить партнёра",
"partner_page_select_partner": "Выбрать партнёра", "partner_page_select_partner": "Выбрать партнёра",
"partner_page_shared_to_title": "Поделиться с...", "partner_page_shared_to_title": "Поделиться с...",
"partner_page_stop_sharing_content": "Пользователь {partner} больше не сможет получить доступ к вашим фото.", "partner_page_stop_sharing_content": "Пользователь {partner} больше не будет иметь доступ к вашим фото и видео.",
"partner_sharing": "Совместное использование", "partner_sharing": "Совместное использование",
"partners": "Партнёры", "partners": "Партнёры",
"password": "Пароль", "password": "Пароль",
@@ -1796,7 +1796,7 @@
"shared_by": "Поделился", "shared_by": "Поделился",
"shared_by_user": "Владелец: {user}", "shared_by_user": "Владелец: {user}",
"shared_by_you": "Вы поделились", "shared_by_you": "Вы поделились",
"shared_from_partner": "Фото и видео пользователя {partner}", "shared_from_partner": "Пользователь {partner} предоставил вам доступ",
"shared_intent_upload_button_progress_text": "{current} / {total} Загружено", "shared_intent_upload_button_progress_text": "{current} / {total} Загружено",
"shared_link_app_bar_title": "Публичные ссылки", "shared_link_app_bar_title": "Публичные ссылки",
"shared_link_clipboard_copied_massage": "Скопировано в буфер обмена", "shared_link_clipboard_copied_massage": "Скопировано в буфер обмена",
@@ -1833,7 +1833,7 @@
"shared_links_description": "Делитесь фотографиями и видео по ссылке", "shared_links_description": "Делитесь фотографиями и видео по ссылке",
"shared_photos_and_videos_count": "{assetCount, plural, other {# фото и видео.}}", "shared_photos_and_videos_count": "{assetCount, plural, other {# фото и видео.}}",
"shared_with_me": "Доступные мне", "shared_with_me": "Доступные мне",
"shared_with_partner": "Совместно с {partner}", "shared_with_partner": "Вы предоставили доступ пользователю {partner}",
"sharing": "Общие", "sharing": "Общие",
"sharing_enter_password": "Пожалуйста, введите пароль для просмотра этой страницы.", "sharing_enter_password": "Пожалуйста, введите пароль для просмотра этой страницы.",
"sharing_page_album": "Общие альбомы", "sharing_page_album": "Общие альбомы",
@@ -1851,7 +1851,7 @@
"show_gallery": "Показать галерею", "show_gallery": "Показать галерею",
"show_hidden_people": "Показать скрытых людей", "show_hidden_people": "Показать скрытых людей",
"show_in_timeline": "Показать на временной шкале", "show_in_timeline": "Показать на временной шкале",
"show_in_timeline_setting_description": "Отображать фото и видео этого пользователя в своей ленте", "show_in_timeline_setting_description": "Отображать фото и видео этого пользователя на своей временной шкале",
"show_keyboard_shortcuts": "Показать сочетания клавиш", "show_keyboard_shortcuts": "Показать сочетания клавиш",
"show_metadata": "Показывать метаданные", "show_metadata": "Показывать метаданные",
"show_or_hide_info": "Показать или скрыть информацию", "show_or_hide_info": "Показать или скрыть информацию",
@@ -1897,9 +1897,9 @@
"status": "Состояние", "status": "Состояние",
"stop_casting": "Остановить трансляцию", "stop_casting": "Остановить трансляцию",
"stop_motion_photo": "Покадровая анимация", "stop_motion_photo": "Покадровая анимация",
"stop_photo_sharing": "Закрыть доступ партнёра к вашим фото?", "stop_photo_sharing": "Закрыть доступ партнёру?",
"stop_photo_sharing_description": "Пользователь {partner} больше не имеет доступа к вашим фотографиям.", "stop_photo_sharing_description": "Пользователь {partner} больше не имеет доступа к вашим фотографиям.",
"stop_sharing_photos_with_user": "Прекратить делиться своими фотографиями с этим пользователем", "stop_sharing_photos_with_user": "Прекратить делиться своими фото и видео с этим пользователем",
"storage": "Хранилище", "storage": "Хранилище",
"storage_label": "Метка хранилища", "storage_label": "Метка хранилища",
"storage_quota": "Квота хранилища", "storage_quota": "Квота хранилища",

View File

@@ -35,8 +35,8 @@ platform :android do
task: 'bundle', task: 'bundle',
build_type: 'Release', build_type: 'Release',
properties: { properties: {
"android.injected.version.code" => 3013, "android.injected.version.code" => 3014,
"android.injected.version.name" => "1.141.1", "android.injected.version.name" => "1.142.0",
} }
) )
upload_to_play_store(skip_upload_apk: true, skip_upload_images: true, skip_upload_screenshots: true, aab: '../build/app/outputs/bundle/release/app-release.aab') upload_to_play_store(skip_upload_apk: true, skip_upload_images: true, skip_upload_screenshots: true, aab: '../build/app/outputs/bundle/release/app-release.aab')

View File

@@ -3,7 +3,7 @@
archiveVersion = 1; archiveVersion = 1;
classes = { classes = {
}; };
objectVersion = 77; objectVersion = 54;
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
@@ -133,6 +133,8 @@
/* Begin PBXFileSystemSynchronizedRootGroup section */ /* Begin PBXFileSystemSynchronizedRootGroup section */
B2CF7F8C2DDE4EBB00744BF6 /* Sync */ = { B2CF7F8C2DDE4EBB00744BF6 /* Sync */ = {
isa = PBXFileSystemSynchronizedRootGroup; isa = PBXFileSystemSynchronizedRootGroup;
exceptions = (
);
path = Sync; path = Sync;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
@@ -519,14 +521,10 @@
inputFileListPaths = ( inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist", "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-input-files.xcfilelist",
); );
inputPaths = (
);
name = "[CP] Copy Pods Resources"; name = "[CP] Copy Pods Resources";
outputFileListPaths = ( outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist", "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources-${CONFIGURATION}-output-files.xcfilelist",
); );
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n"; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-resources.sh\"\n";
@@ -555,14 +553,10 @@
inputFileListPaths = ( inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
); );
inputPaths = (
);
name = "[CP] Embed Pods Frameworks"; name = "[CP] Embed Pods Frameworks";
outputFileListPaths = ( outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
); );
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
@@ -711,7 +705,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/RunnerProfile.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 219; CURRENT_PROJECT_VERSION = 223;
CUSTOM_GROUP_ID = group.app.immich.share; CUSTOM_GROUP_ID = group.app.immich.share;
DEVELOPMENT_TEAM = 2F67MQ8R79; DEVELOPMENT_TEAM = 2F67MQ8R79;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
@@ -855,7 +849,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 219; CURRENT_PROJECT_VERSION = 223;
CUSTOM_GROUP_ID = group.app.immich.share; CUSTOM_GROUP_ID = group.app.immich.share;
DEVELOPMENT_TEAM = 2F67MQ8R79; DEVELOPMENT_TEAM = 2F67MQ8R79;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
@@ -885,7 +879,7 @@
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 219; CURRENT_PROJECT_VERSION = 223;
CUSTOM_GROUP_ID = group.app.immich.share; CUSTOM_GROUP_ID = group.app.immich.share;
DEVELOPMENT_TEAM = 2F67MQ8R79; DEVELOPMENT_TEAM = 2F67MQ8R79;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
@@ -919,7 +913,7 @@
CODE_SIGN_ENTITLEMENTS = WidgetExtension/WidgetExtension.entitlements; CODE_SIGN_ENTITLEMENTS = WidgetExtension/WidgetExtension.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 219; CURRENT_PROJECT_VERSION = 223;
DEVELOPMENT_TEAM = 2F67MQ8R79; DEVELOPMENT_TEAM = 2F67MQ8R79;
ENABLE_USER_SCRIPT_SANDBOXING = YES; ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17; GCC_C_LANGUAGE_STANDARD = gnu17;
@@ -962,7 +956,7 @@
CODE_SIGN_ENTITLEMENTS = WidgetExtension/WidgetExtension.entitlements; CODE_SIGN_ENTITLEMENTS = WidgetExtension/WidgetExtension.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 219; CURRENT_PROJECT_VERSION = 223;
DEVELOPMENT_TEAM = 2F67MQ8R79; DEVELOPMENT_TEAM = 2F67MQ8R79;
ENABLE_USER_SCRIPT_SANDBOXING = YES; ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17; GCC_C_LANGUAGE_STANDARD = gnu17;
@@ -1002,7 +996,7 @@
CODE_SIGN_ENTITLEMENTS = WidgetExtension/WidgetExtension.entitlements; CODE_SIGN_ENTITLEMENTS = WidgetExtension/WidgetExtension.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 219; CURRENT_PROJECT_VERSION = 223;
DEVELOPMENT_TEAM = 2F67MQ8R79; DEVELOPMENT_TEAM = 2F67MQ8R79;
ENABLE_USER_SCRIPT_SANDBOXING = YES; ENABLE_USER_SCRIPT_SANDBOXING = YES;
GCC_C_LANGUAGE_STANDARD = gnu17; GCC_C_LANGUAGE_STANDARD = gnu17;
@@ -1041,7 +1035,7 @@
CODE_SIGN_ENTITLEMENTS = ShareExtension/ShareExtension.entitlements; CODE_SIGN_ENTITLEMENTS = ShareExtension/ShareExtension.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 219; CURRENT_PROJECT_VERSION = 223;
CUSTOM_GROUP_ID = group.app.immich.share; CUSTOM_GROUP_ID = group.app.immich.share;
DEVELOPMENT_TEAM = 2F67MQ8R79; DEVELOPMENT_TEAM = 2F67MQ8R79;
ENABLE_USER_SCRIPT_SANDBOXING = YES; ENABLE_USER_SCRIPT_SANDBOXING = YES;
@@ -1085,7 +1079,7 @@
CODE_SIGN_ENTITLEMENTS = ShareExtension/ShareExtension.entitlements; CODE_SIGN_ENTITLEMENTS = ShareExtension/ShareExtension.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 219; CURRENT_PROJECT_VERSION = 223;
CUSTOM_GROUP_ID = group.app.immich.share; CUSTOM_GROUP_ID = group.app.immich.share;
DEVELOPMENT_TEAM = 2F67MQ8R79; DEVELOPMENT_TEAM = 2F67MQ8R79;
ENABLE_USER_SCRIPT_SANDBOXING = YES; ENABLE_USER_SCRIPT_SANDBOXING = YES;
@@ -1126,7 +1120,7 @@
CODE_SIGN_ENTITLEMENTS = ShareExtension/ShareExtension.entitlements; CODE_SIGN_ENTITLEMENTS = ShareExtension/ShareExtension.entitlements;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 219; CURRENT_PROJECT_VERSION = 223;
CUSTOM_GROUP_ID = group.app.immich.share; CUSTOM_GROUP_ID = group.app.immich.share;
DEVELOPMENT_TEAM = 2F67MQ8R79; DEVELOPMENT_TEAM = 2F67MQ8R79;
ENABLE_USER_SCRIPT_SANDBOXING = YES; ENABLE_USER_SCRIPT_SANDBOXING = YES;

View File

@@ -80,7 +80,7 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.140.0</string> <string>1.142.0</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>????</string> <string>????</string>
<key>CFBundleURLTypes</key> <key>CFBundleURLTypes</key>
@@ -107,7 +107,7 @@
</dict> </dict>
</array> </array>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>219</string> <string>223</string>
<key>FLTEnableImpeller</key> <key>FLTEnableImpeller</key>
<true/> <true/>
<key>ITSAppUsesNonExemptEncryption</key> <key>ITSAppUsesNonExemptEncryption</key>

View File

@@ -22,7 +22,7 @@ platform :ios do
path: "./Runner.xcodeproj", path: "./Runner.xcodeproj",
) )
increment_version_number( increment_version_number(
version_number: "1.141.1" version_number: "1.142.0"
) )
increment_build_number( increment_build_number(
build_number: latest_testflight_build_number + 1, build_number: latest_testflight_build_number + 1,

View File

@@ -169,7 +169,10 @@ class BackgroundWorkerBgService extends BackgroundWorkerFlutterApi {
} }
try { try {
final backgroundSyncManager = _ref.read(backgroundSyncProvider);
_isCleanedUp = true; _isCleanedUp = true;
_ref.dispose();
_cancellationToken.cancel(); _cancellationToken.cancel();
_logger.info("Cleaning up background worker"); _logger.info("Cleaning up background worker");
final cleanupFutures = [ final cleanupFutures = [
@@ -179,14 +182,13 @@ class BackgroundWorkerBgService extends BackgroundWorkerFlutterApi {
}), }),
_drift.close(), _drift.close(),
_driftLogger.close(), _driftLogger.close(),
_ref.read(backgroundSyncProvider).cancel(), backgroundSyncManager.cancel(),
_ref.read(backgroundSyncProvider).cancelLocal(), backgroundSyncManager.cancelLocal(),
]; ];
if (_isar.isOpen) { if (_isar.isOpen) {
cleanupFutures.add(_isar.close()); cleanupFutures.add(_isar.close());
} }
_ref.dispose();
await Future.wait(cleanupFutures); await Future.wait(cleanupFutures);
_logger.info("Background worker resources cleaned up"); _logger.info("Background worker resources cleaned up");
} catch (error, stack) { } catch (error, stack) {
@@ -195,35 +197,42 @@ class BackgroundWorkerBgService extends BackgroundWorkerFlutterApi {
} }
Future<void> _handleBackup() async { Future<void> _handleBackup() async {
if (!_isBackupEnabled || _isCleanedUp) { await runZonedGuarded(
_logger.info("[_handleBackup 1] Backup is disabled. Skipping backup routine"); () async {
return; if (!_isBackupEnabled || _isCleanedUp) {
} _logger.info("[_handleBackup 1] Backup is disabled. Skipping backup routine");
return;
}
_logger.info("[_handleBackup 2] Enqueuing assets for backup from the background service"); _logger.info("[_handleBackup 2] Enqueuing assets for backup from the background service");
final currentUser = _ref.read(currentUserProvider); final currentUser = _ref.read(currentUserProvider);
if (currentUser == null) { if (currentUser == null) {
_logger.warning("[_handleBackup 3] No current user found. Skipping backup from background"); _logger.warning("[_handleBackup 3] No current user found. Skipping backup from background");
return; return;
} }
_logger.info("[_handleBackup 4] Resume backup from background"); _logger.info("[_handleBackup 4] Resume backup from background");
if (Platform.isIOS) { if (Platform.isIOS) {
return _ref.read(driftBackupProvider.notifier).handleBackupResume(currentUser.id); return _ref.read(driftBackupProvider.notifier).handleBackupResume(currentUser.id);
} }
final canPing = await _ref.read(serverInfoServiceProvider).ping(); final canPing = await _ref.read(serverInfoServiceProvider).ping();
if (!canPing) { if (!canPing) {
_logger.warning("[_handleBackup 5] Server is not reachable. Skipping backup from background"); _logger.warning("[_handleBackup 5] Server is not reachable. Skipping backup from background");
return; return;
} }
final networkCapabilities = await _ref.read(connectivityApiProvider).getCapabilities(); final networkCapabilities = await _ref.read(connectivityApiProvider).getCapabilities();
return _ref return _ref
.read(uploadServiceProvider) .read(uploadServiceProvider)
.startBackupWithHttpClient(currentUser.id, networkCapabilities.hasWifi, _cancellationToken); .startBackupWithHttpClient(currentUser.id, networkCapabilities.hasWifi, _cancellationToken);
},
(error, stack) {
debugPrint("Error in backup zone $error, $stack");
},
);
} }
Future<void> _syncAssets({Duration? hashTimeout}) async { Future<void> _syncAssets({Duration? hashTimeout}) async {

View File

@@ -1,9 +1,10 @@
import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:immich_mobile/domain/models/store.model.dart';
import 'package:immich_mobile/domain/services/sync_linked_album.service.dart'; import 'package:immich_mobile/domain/services/sync_linked_album.service.dart';
import 'package:immich_mobile/providers/user.provider.dart'; import 'package:immich_mobile/entities/store.entity.dart';
Future<void> syncLinkedAlbumsIsolated(ProviderContainer ref) { Future<void> syncLinkedAlbumsIsolated(ProviderContainer ref) {
final user = ref.read(currentUserProvider); final user = Store.tryGet(StoreKey.currentUser);
if (user == null) { if (user == null) {
return Future.value(); return Future.value();
} }

View File

@@ -595,7 +595,7 @@ extension on String {
GroupAssetsBy.none => throw ArgumentError("GroupAssetsBy.none is not supported for date formatting"), GroupAssetsBy.none => throw ArgumentError("GroupAssetsBy.none is not supported for date formatting"),
}; };
try { try {
return DateFormat(format).parse(this); return DateFormat(format, 'en').parse(this);
} catch (e) { } catch (e) {
throw FormatException("Invalid date format: $this", e); throw FormatException("Invalid date format: $this", e);
} }

View File

@@ -46,7 +46,7 @@ void main() async {
await Bootstrap.initDomain(isar, drift, logDb); await Bootstrap.initDomain(isar, drift, logDb);
await initApp(); await initApp();
// Warm-up isolate pool for worker manager // Warm-up isolate pool for worker manager
await workerManager.init(dynamicSpawning: false); await workerManager.init(dynamicSpawning: true);
await migrateDatabaseIfNeeded(isar, drift); await migrateDatabaseIfNeeded(isar, drift);
HttpSSLOptions.apply(); HttpSSLOptions.apply();

View File

@@ -17,6 +17,7 @@ import 'package:immich_mobile/providers/app_settings.provider.dart';
import 'package:immich_mobile/providers/backup/drift_backup.provider.dart'; import 'package:immich_mobile/providers/backup/drift_backup.provider.dart';
import 'package:immich_mobile/providers/infrastructure/asset.provider.dart'; import 'package:immich_mobile/providers/infrastructure/asset.provider.dart';
import 'package:immich_mobile/providers/infrastructure/storage.provider.dart'; import 'package:immich_mobile/providers/infrastructure/storage.provider.dart';
import 'package:immich_mobile/repositories/asset_media.repository.dart';
import 'package:immich_mobile/repositories/upload.repository.dart'; import 'package:immich_mobile/repositories/upload.repository.dart';
import 'package:immich_mobile/services/api.service.dart'; import 'package:immich_mobile/services/api.service.dart';
import 'package:immich_mobile/services/app_settings.service.dart'; import 'package:immich_mobile/services/app_settings.service.dart';
@@ -30,6 +31,7 @@ final uploadServiceProvider = Provider((ref) {
ref.watch(storageRepositoryProvider), ref.watch(storageRepositoryProvider),
ref.watch(localAssetRepository), ref.watch(localAssetRepository),
ref.watch(appSettingsServiceProvider), ref.watch(appSettingsServiceProvider),
ref.watch(assetMediaRepositoryProvider),
); );
ref.onDispose(service.dispose); ref.onDispose(service.dispose);
@@ -43,6 +45,7 @@ class UploadService {
this._storageRepository, this._storageRepository,
this._localAssetRepository, this._localAssetRepository,
this._appSettingsService, this._appSettingsService,
this._assetMediaRepository,
) { ) {
_uploadRepository.onUploadStatus = _onUploadCallback; _uploadRepository.onUploadStatus = _onUploadCallback;
_uploadRepository.onTaskProgress = _onTaskProgressCallback; _uploadRepository.onTaskProgress = _onTaskProgressCallback;
@@ -53,6 +56,7 @@ class UploadService {
final StorageRepository _storageRepository; final StorageRepository _storageRepository;
final DriftLocalAssetRepository _localAssetRepository; final DriftLocalAssetRepository _localAssetRepository;
final AppSettingsService _appSettingsService; final AppSettingsService _appSettingsService;
final AssetMediaRepository _assetMediaRepository;
final Logger _logger = Logger('UploadService'); final Logger _logger = Logger('UploadService');
final StreamController<TaskStatusUpdate> _taskStatusController = StreamController<TaskStatusUpdate>.broadcast(); final StreamController<TaskStatusUpdate> _taskStatusController = StreamController<TaskStatusUpdate>.broadcast();
@@ -321,7 +325,8 @@ class UploadService {
return null; return null;
} }
final originalFileName = entity.isLivePhoto ? p.setExtension(asset.name, p.extension(file.path)) : asset.name; final fileName = await _assetMediaRepository.getOriginalFilename(asset.id) ?? asset.name;
final originalFileName = entity.isLivePhoto ? p.setExtension(fileName, p.extension(file.path)) : fileName;
String metadata = UploadTaskMetadata( String metadata = UploadTaskMetadata(
localAssetId: asset.id, localAssetId: asset.id,
@@ -359,12 +364,13 @@ class UploadService {
final fields = {'livePhotoVideoId': livePhotoVideoId}; final fields = {'livePhotoVideoId': livePhotoVideoId};
final requiresWiFi = _shouldRequireWiFi(asset); final requiresWiFi = _shouldRequireWiFi(asset);
final originalFileName = await _assetMediaRepository.getOriginalFilename(asset.id) ?? asset.name;
return buildUploadTask( return buildUploadTask(
file, file,
createdAt: asset.createdAt, createdAt: asset.createdAt,
modifiedAt: asset.updatedAt, modifiedAt: asset.updatedAt,
originalFileName: asset.name, originalFileName: originalFileName,
deviceAssetId: asset.id, deviceAssetId: asset.id,
fields: fields, fields: fields,
group: kBackupLivePhotoGroup, group: kBackupLivePhotoGroup,

View File

@@ -31,55 +31,62 @@ Cancelable<T?> runInIsolateGentle<T>({
} }
return workerManager.executeGentle((cancelledChecker) async { return workerManager.executeGentle((cancelledChecker) async {
BackgroundIsolateBinaryMessenger.ensureInitialized(token); await runZonedGuarded(
DartPluginRegistrant.ensureInitialized(); () async {
BackgroundIsolateBinaryMessenger.ensureInitialized(token);
DartPluginRegistrant.ensureInitialized();
final (isar, drift, logDb) = await Bootstrap.initDB(); final (isar, drift, logDb) = await Bootstrap.initDB();
await Bootstrap.initDomain(isar, drift, logDb, shouldBufferLogs: false); await Bootstrap.initDomain(isar, drift, logDb, shouldBufferLogs: false);
final ref = ProviderContainer( final ref = ProviderContainer(
overrides: [ overrides: [
// TODO: Remove once isar is removed // TODO: Remove once isar is removed
dbProvider.overrideWithValue(isar), dbProvider.overrideWithValue(isar),
isarProvider.overrideWithValue(isar), isarProvider.overrideWithValue(isar),
cancellationProvider.overrideWithValue(cancelledChecker), cancellationProvider.overrideWithValue(cancelledChecker),
driftProvider.overrideWith(driftOverride(drift)), driftProvider.overrideWith(driftOverride(drift)),
], ],
); );
Logger log = Logger("IsolateLogger"); Logger log = Logger("IsolateLogger");
try {
HttpSSLOptions.apply(applyNative: false);
return await computation(ref);
} on CanceledError {
log.warning("Computation cancelled ${debugLabel == null ? '' : ' for $debugLabel'}");
} catch (error, stack) {
log.severe("Error in runInIsolateGentle ${debugLabel == null ? '' : ' for $debugLabel'}", error, stack);
} finally {
try {
await LogService.I.dispose();
await logDb.close();
await ref.read(driftProvider).close();
// Close Isar safely
try { try {
final isar = ref.read(isarProvider); HttpSSLOptions.apply(applyNative: false);
if (isar.isOpen) { return await computation(ref);
await isar.close(); } on CanceledError {
} log.warning("Computation cancelled ${debugLabel == null ? '' : ' for $debugLabel'}");
} catch (e) { } catch (error, stack) {
debugPrint("Error closing Isar: $e"); log.severe("Error in runInIsolateGentle ${debugLabel == null ? '' : ' for $debugLabel'}", error, stack);
} } finally {
try {
ref.dispose();
ref.dispose(); await LogService.I.dispose();
} catch (error, stack) { await logDb.close();
debugPrint("Error closing resources in isolate: $error, $stack"); await drift.close();
} finally {
ref.dispose(); // Close Isar safely
// Delay to ensure all resources are released try {
await Future.delayed(const Duration(seconds: 2)); if (isar.isOpen) {
} await isar.close();
} }
} catch (e) {
debugPrint("Error closing Isar: $e");
}
} catch (error, stack) {
debugPrint("Error closing resources in isolate: $error, $stack");
} finally {
ref.dispose();
// Delay to ensure all resources are released
await Future.delayed(const Duration(seconds: 2));
}
}
return null;
},
(error, stack) {
debugPrint("Error in isolate zone: $error, $stack");
},
);
return null; return null;
}); });
} }

View File

@@ -3,7 +3,7 @@ Immich API
This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: This Dart package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
- API version: 1.141.1 - API version: 1.142.0
- Generator version: 7.8.0 - Generator version: 7.8.0
- Build package: org.openapitools.codegen.languages.DartClientCodegen - Build package: org.openapitools.codegen.languages.DartClientCodegen
@@ -297,7 +297,6 @@ Class | Method | HTTP request | Description
- [APIKeyCreateResponseDto](doc//APIKeyCreateResponseDto.md) - [APIKeyCreateResponseDto](doc//APIKeyCreateResponseDto.md)
- [APIKeyResponseDto](doc//APIKeyResponseDto.md) - [APIKeyResponseDto](doc//APIKeyResponseDto.md)
- [APIKeyUpdateDto](doc//APIKeyUpdateDto.md) - [APIKeyUpdateDto](doc//APIKeyUpdateDto.md)
- [AccessHint](doc//AccessHint.md)
- [ActivityCreateDto](doc//ActivityCreateDto.md) - [ActivityCreateDto](doc//ActivityCreateDto.md)
- [ActivityResponseDto](doc//ActivityResponseDto.md) - [ActivityResponseDto](doc//ActivityResponseDto.md)
- [ActivityStatisticsResponseDto](doc//ActivityStatisticsResponseDto.md) - [ActivityStatisticsResponseDto](doc//ActivityStatisticsResponseDto.md)

View File

@@ -68,7 +68,6 @@ part 'model/api_key_create_dto.dart';
part 'model/api_key_create_response_dto.dart'; part 'model/api_key_create_response_dto.dart';
part 'model/api_key_response_dto.dart'; part 'model/api_key_response_dto.dart';
part 'model/api_key_update_dto.dart'; part 'model/api_key_update_dto.dart';
part 'model/access_hint.dart';
part 'model/activity_create_dto.dart'; part 'model/activity_create_dto.dart';
part 'model/activity_response_dto.dart'; part 'model/activity_response_dto.dart';
part 'model/activity_statistics_response_dto.dart'; part 'model/activity_statistics_response_dto.dart';

View File

@@ -1247,14 +1247,12 @@ class AssetsApi {
/// ///
/// * [String] id (required): /// * [String] id (required):
/// ///
/// * [AccessHint] hint:
///
/// * [String] key: /// * [String] key:
/// ///
/// * [AssetMediaSize] size: /// * [AssetMediaSize] size:
/// ///
/// * [String] slug: /// * [String] slug:
Future<Response> viewAssetWithHttpInfo(String id, { AccessHint? hint, String? key, AssetMediaSize? size, String? slug, }) async { Future<Response> viewAssetWithHttpInfo(String id, { String? key, AssetMediaSize? size, String? slug, }) async {
// ignore: prefer_const_declarations // ignore: prefer_const_declarations
final apiPath = r'/assets/{id}/thumbnail' final apiPath = r'/assets/{id}/thumbnail'
.replaceAll('{id}', id); .replaceAll('{id}', id);
@@ -1266,9 +1264,6 @@ class AssetsApi {
final headerParams = <String, String>{}; final headerParams = <String, String>{};
final formParams = <String, String>{}; final formParams = <String, String>{};
if (hint != null) {
queryParams.addAll(_queryParams('', 'hint', hint));
}
if (key != null) { if (key != null) {
queryParams.addAll(_queryParams('', 'key', key)); queryParams.addAll(_queryParams('', 'key', key));
} }
@@ -1299,15 +1294,13 @@ class AssetsApi {
/// ///
/// * [String] id (required): /// * [String] id (required):
/// ///
/// * [AccessHint] hint:
///
/// * [String] key: /// * [String] key:
/// ///
/// * [AssetMediaSize] size: /// * [AssetMediaSize] size:
/// ///
/// * [String] slug: /// * [String] slug:
Future<MultipartFile?> viewAsset(String id, { AccessHint? hint, String? key, AssetMediaSize? size, String? slug, }) async { Future<MultipartFile?> viewAsset(String id, { String? key, AssetMediaSize? size, String? slug, }) async {
final response = await viewAssetWithHttpInfo(id, hint: hint, key: key, size: size, slug: slug, ); final response = await viewAssetWithHttpInfo(id, key: key, size: size, slug: slug, );
if (response.statusCode >= HttpStatus.badRequest) { if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response)); throw ApiException(response.statusCode, await _decodeBodyBytes(response));
} }

View File

@@ -190,8 +190,6 @@ class ApiClient {
return APIKeyResponseDto.fromJson(value); return APIKeyResponseDto.fromJson(value);
case 'APIKeyUpdateDto': case 'APIKeyUpdateDto':
return APIKeyUpdateDto.fromJson(value); return APIKeyUpdateDto.fromJson(value);
case 'AccessHint':
return AccessHintTypeTransformer().decode(value);
case 'ActivityCreateDto': case 'ActivityCreateDto':
return ActivityCreateDto.fromJson(value); return ActivityCreateDto.fromJson(value);
case 'ActivityResponseDto': case 'ActivityResponseDto':

View File

@@ -55,9 +55,6 @@ String parameterToString(dynamic value) {
if (value is DateTime) { if (value is DateTime) {
return value.toUtc().toIso8601String(); return value.toUtc().toIso8601String();
} }
if (value is AccessHint) {
return AccessHintTypeTransformer().encode(value).toString();
}
if (value is AlbumUserRole) { if (value is AlbumUserRole) {
return AlbumUserRoleTypeTransformer().encode(value).toString(); return AlbumUserRoleTypeTransformer().encode(value).toString();
} }

View File

@@ -1,91 +0,0 @@
//
// AUTO-GENERATED FILE, DO NOT MODIFY!
//
// @dart=2.18
// ignore_for_file: unused_element, unused_import
// ignore_for_file: always_put_required_named_parameters_first
// ignore_for_file: constant_identifier_names
// ignore_for_file: lines_longer_than_80_chars
part of openapi.api;
class AccessHint {
/// Instantiate a new enum with the provided [value].
const AccessHint._(this.value);
/// The underlying value of this enum member.
final String value;
@override
String toString() => value;
String toJson() => value;
static const owner = AccessHint._(r'owner');
static const album = AccessHint._(r'album');
static const partner = AccessHint._(r'partner');
static const sharedLink = AccessHint._(r'sharedLink');
/// List of all possible values in this [enum][AccessHint].
static const values = <AccessHint>[
owner,
album,
partner,
sharedLink,
];
static AccessHint? fromJson(dynamic value) => AccessHintTypeTransformer().decode(value);
static List<AccessHint> listFromJson(dynamic json, {bool growable = false,}) {
final result = <AccessHint>[];
if (json is List && json.isNotEmpty) {
for (final row in json) {
final value = AccessHint.fromJson(row);
if (value != null) {
result.add(value);
}
}
}
return result.toList(growable: growable);
}
}
/// Transformation class that can [encode] an instance of [AccessHint] to String,
/// and [decode] dynamic data back to [AccessHint].
class AccessHintTypeTransformer {
factory AccessHintTypeTransformer() => _instance ??= const AccessHintTypeTransformer._();
const AccessHintTypeTransformer._();
String encode(AccessHint data) => data.value;
/// Decodes a [dynamic value][data] to a AccessHint.
///
/// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully,
/// then null is returned. However, if [allowNull] is false and the [dynamic value][data]
/// cannot be decoded successfully, then an [UnimplementedError] is thrown.
///
/// The [allowNull] is very handy when an API changes and a new enum value is added or removed,
/// and users are still using an old app with the old code.
AccessHint? decode(dynamic data, {bool allowNull = true}) {
if (data != null) {
switch (data) {
case r'owner': return AccessHint.owner;
case r'album': return AccessHint.album;
case r'partner': return AccessHint.partner;
case r'sharedLink': return AccessHint.sharedLink;
default:
if (!allowNull) {
throw ArgumentError('Unknown enum value to decode: $data');
}
}
}
return null;
}
/// Singleton [AccessHintTypeTransformer] instance.
static AccessHintTypeTransformer? _instance;
}

View File

@@ -2,7 +2,7 @@ name: immich_mobile
description: Immich - selfhosted backup media file on mobile phone description: Immich - selfhosted backup media file on mobile phone
publish_to: 'none' publish_to: 'none'
version: 1.141.1+3013 version: 1.142.0+3014
environment: environment:
sdk: '>=3.8.0 <4.0.0' sdk: '>=3.8.0 <4.0.0'

View File

@@ -2583,14 +2583,6 @@
"get": { "get": {
"operationId": "viewAsset", "operationId": "viewAsset",
"parameters": [ "parameters": [
{
"name": "hint",
"required": false,
"in": "query",
"schema": {
"$ref": "#/components/schemas/AccessHint"
}
},
{ {
"name": "id", "name": "id",
"required": true, "required": true,
@@ -9866,7 +9858,7 @@
"info": { "info": {
"title": "Immich", "title": "Immich",
"description": "Immich API", "description": "Immich API",
"version": "1.141.1", "version": "1.142.0",
"contact": {} "contact": {}
}, },
"tags": [], "tags": [],
@@ -9975,15 +9967,6 @@
}, },
"type": "object" "type": "object"
}, },
"AccessHint": {
"enum": [
"owner",
"album",
"partner",
"sharedLink"
],
"type": "string"
},
"ActivityCreateDto": { "ActivityCreateDto": {
"properties": { "properties": {
"albumId": { "albumId": {

View File

@@ -1,6 +1,6 @@
{ {
"name": "@immich/sdk", "name": "@immich/sdk",
"version": "1.141.1", "version": "1.142.0",
"description": "Auto-generated TypeScript SDK for the Immich API", "description": "Auto-generated TypeScript SDK for the Immich API",
"type": "module", "type": "module",
"main": "./build/index.js", "main": "./build/index.js",

View File

@@ -1,6 +1,6 @@
/** /**
* Immich * Immich
* 1.141.1 * 1.142.0
* DO NOT MODIFY - This file has been generated using oazapfts. * DO NOT MODIFY - This file has been generated using oazapfts.
* See https://www.npmjs.com/package/oazapfts * See https://www.npmjs.com/package/oazapfts
*/ */
@@ -2391,8 +2391,7 @@ export function replaceAsset({ id, key, slug, assetMediaReplaceDto }: {
/** /**
* This endpoint requires the `asset.view` permission. * This endpoint requires the `asset.view` permission.
*/ */
export function viewAsset({ hint, id, key, size, slug }: { export function viewAsset({ id, key, size, slug }: {
hint?: AccessHint;
id: string; id: string;
key?: string; key?: string;
size?: AssetMediaSize; size?: AssetMediaSize;
@@ -2402,7 +2401,6 @@ export function viewAsset({ hint, id, key, size, slug }: {
status: 200; status: 200;
data: Blob; data: Blob;
}>(`/assets/${encodeURIComponent(id)}/thumbnail${QS.query(QS.explode({ }>(`/assets/${encodeURIComponent(id)}/thumbnail${QS.query(QS.explode({
hint,
key, key,
size, size,
slug slug
@@ -4844,12 +4842,6 @@ export enum AssetJobName {
RegenerateThumbnail = "regenerate-thumbnail", RegenerateThumbnail = "regenerate-thumbnail",
TranscodeVideo = "transcode-video" TranscodeVideo = "transcode-video"
} }
export enum AccessHint {
Owner = "owner",
Album = "album",
Partner = "partner",
SharedLink = "sharedLink"
}
export enum AssetMediaSize { export enum AssetMediaSize {
Fullsize = "fullsize", Fullsize = "fullsize",
Preview = "preview", Preview = "preview",

View File

@@ -1,6 +1,6 @@
{ {
"name": "immich", "name": "immich",
"version": "1.141.1", "version": "1.142.0",
"description": "", "description": "",
"author": "", "author": "",
"private": true, "private": true,

View File

@@ -3,7 +3,7 @@ import { ApiProperty } from '@nestjs/swagger';
import { plainToInstance, Transform, Type } from 'class-transformer'; import { plainToInstance, Transform, Type } from 'class-transformer';
import { ArrayNotEmpty, IsArray, IsNotEmpty, IsString, ValidateNested } from 'class-validator'; import { ArrayNotEmpty, IsArray, IsNotEmpty, IsString, ValidateNested } from 'class-validator';
import { AssetMetadataUpsertItemDto } from 'src/dtos/asset.dto'; import { AssetMetadataUpsertItemDto } from 'src/dtos/asset.dto';
import { AccessHint, AssetVisibility } from 'src/enum'; import { AssetVisibility } from 'src/enum';
import { Optional, ValidateBoolean, ValidateDate, ValidateEnum, ValidateUUID } from 'src/validation'; import { Optional, ValidateBoolean, ValidateDate, ValidateEnum, ValidateUUID } from 'src/validation';
export enum AssetMediaSize { export enum AssetMediaSize {
@@ -19,9 +19,6 @@ export enum AssetMediaSize {
export class AssetMediaOptionsDto { export class AssetMediaOptionsDto {
@ValidateEnum({ enum: AssetMediaSize, name: 'AssetMediaSize', optional: true }) @ValidateEnum({ enum: AssetMediaSize, name: 'AssetMediaSize', optional: true })
size?: AssetMediaSize; size?: AssetMediaSize;
@ValidateEnum({ enum: AccessHint, name: 'AccessHint', optional: true })
hint?: AccessHint;
} }
export enum UploadFieldName { export enum UploadFieldName {

View File

@@ -753,10 +753,3 @@ export enum CronJob {
LibraryScan = 'LibraryScan', LibraryScan = 'LibraryScan',
NightlyJobs = 'NightlyJobs', NightlyJobs = 'NightlyJobs',
} }
export enum AccessHint {
Owner = 'owner',
Album = 'album',
Partner = 'partner',
SharedLink = 'sharedLink',
}

View File

@@ -1,7 +1,7 @@
import { BadRequestException, UnauthorizedException } from '@nestjs/common'; import { BadRequestException, UnauthorizedException } from '@nestjs/common';
import { AuthSharedLink } from 'src/database'; import { AuthSharedLink } from 'src/database';
import { AuthDto } from 'src/dtos/auth.dto'; import { AuthDto } from 'src/dtos/auth.dto';
import { AccessHint, AlbumUserRole, Permission } from 'src/enum'; import { AlbumUserRole, Permission } from 'src/enum';
import { AccessRepository } from 'src/repositories/access.repository'; import { AccessRepository } from 'src/repositories/access.repository';
import { setDifference, setIsEqual, setIsSuperset, setUnion } from 'src/utils/set'; import { setDifference, setIsEqual, setIsSuperset, setUnion } from 'src/utils/set';
@@ -22,11 +22,10 @@ export type AccessRequest = {
auth: AuthDto; auth: AuthDto;
permission: Permission; permission: Permission;
ids: Set<string> | string[]; ids: Set<string> | string[];
hint?: AccessHint;
}; };
type SharedLinkAccessRequest = { sharedLink: AuthSharedLink; permission: Permission; ids: Set<string> }; type SharedLinkAccessRequest = { sharedLink: AuthSharedLink; permission: Permission; ids: Set<string> };
type OtherAccessRequest = { auth: AuthDto; permission: Permission; ids: Set<string>; hint?: AccessHint }; type OtherAccessRequest = { auth: AuthDto; permission: Permission; ids: Set<string> };
export const requireUploadAccess = (auth: AuthDto | null): AuthDto => { export const requireUploadAccess = (auth: AuthDto | null): AuthDto => {
if (!auth || (auth.sharedLink && !auth.sharedLink.allowUpload)) { if (!auth || (auth.sharedLink && !auth.sharedLink.allowUpload)) {
@@ -44,7 +43,7 @@ export const requireAccess = async (access: AccessRepository, request: AccessReq
export const checkAccess = async ( export const checkAccess = async (
access: AccessRepository, access: AccessRepository,
{ ids, auth, permission, hint }: AccessRequest, { ids, auth, permission }: AccessRequest,
): Promise<Set<string>> => { ): Promise<Set<string>> => {
const idSet = Array.isArray(ids) ? new Set(ids) : ids; const idSet = Array.isArray(ids) ? new Set(ids) : ids;
if (idSet.size === 0) { if (idSet.size === 0) {
@@ -53,7 +52,7 @@ export const checkAccess = async (
return auth.sharedLink return auth.sharedLink
? checkSharedLinkAccess(access, { sharedLink: auth.sharedLink, permission, ids: idSet }) ? checkSharedLinkAccess(access, { sharedLink: auth.sharedLink, permission, ids: idSet })
: checkOtherAccess(access, { auth, permission, ids: idSet, hint }); : checkOtherAccess(access, { auth, permission, ids: idSet });
}; };
const checkSharedLinkAccess = async ( const checkSharedLinkAccess = async (
@@ -103,38 +102,8 @@ const checkSharedLinkAccess = async (
} }
}; };
const safeMoveToFront = <T>(array: T[], index: number) => {
if (index <= 0 || index >= array.length) {
return;
}
const [item] = array.splice(index, 1);
array.unshift(item);
};
type CheckFn = (ids: Set<string>) => Promise<Set<string>>;
const checkAll = async (ids: Set<string>, checks: Partial<Record<AccessHint, CheckFn>>, hint?: AccessHint) => {
let grantedIds = new Set<string>();
const items = Object.values(checks);
if (hint && checks[hint]) {
safeMoveToFront(items, items.indexOf(checks[hint]));
}
for (const check of items) {
if (ids.size === 0) {
break;
}
const approvedIds = await check(ids);
grantedIds = setUnion(grantedIds, approvedIds);
ids = setDifference(ids, approvedIds);
}
return grantedIds;
};
const checkOtherAccess = async (access: AccessRepository, request: OtherAccessRequest): Promise<Set<string>> => { const checkOtherAccess = async (access: AccessRepository, request: OtherAccessRequest): Promise<Set<string>> => {
const { auth, permission, ids, hint } = request; const { auth, permission, ids } = request;
switch (permission) { switch (permission) {
// uses album id // uses album id
@@ -144,118 +113,96 @@ const checkOtherAccess = async (access: AccessRepository, request: OtherAccessRe
// uses activity id // uses activity id
case Permission.ActivityDelete: { case Permission.ActivityDelete: {
return checkAll( const isOwner = await access.activity.checkOwnerAccess(auth.user.id, ids);
ids, const isAlbumOwner = await access.activity.checkAlbumOwnerAccess(auth.user.id, setDifference(ids, isOwner));
{ return setUnion(isOwner, isAlbumOwner);
[AccessHint.Owner]: (ids) => access.activity.checkOwnerAccess(auth.user.id, ids),
[AccessHint.Album]: (ids) => access.activity.checkAlbumOwnerAccess(auth.user.id, ids),
},
hint,
);
} }
case Permission.AssetRead: { case Permission.AssetRead: {
return checkAll( const isOwner = await access.asset.checkOwnerAccess(auth.user.id, ids, auth.session?.hasElevatedPermission);
ids, const isAlbum = await access.asset.checkAlbumAccess(auth.user.id, setDifference(ids, isOwner));
{ const isPartner = await access.asset.checkPartnerAccess(auth.user.id, setDifference(ids, isOwner, isAlbum));
[AccessHint.Owner]: (ids) => return setUnion(isOwner, isAlbum, isPartner);
access.asset.checkOwnerAccess(auth.user.id, ids, auth.session?.hasElevatedPermission),
[AccessHint.Album]: (ids) => access.asset.checkAlbumAccess(auth.user.id, ids),
[AccessHint.Partner]: (ids) => access.asset.checkPartnerAccess(auth.user.id, ids),
},
hint,
);
} }
case Permission.AssetShare: { case Permission.AssetShare: {
return checkAll(ids, { const isOwner = await access.asset.checkOwnerAccess(auth.user.id, ids, false);
[AccessHint.Owner]: (ids) => access.asset.checkOwnerAccess(auth.user.id, ids, false), const isPartner = await access.asset.checkPartnerAccess(auth.user.id, setDifference(ids, isOwner));
[AccessHint.Partner]: (ids) => access.asset.checkPartnerAccess(auth.user.id, ids), return setUnion(isOwner, isPartner);
});
} }
case Permission.AssetView: { case Permission.AssetView: {
return checkAll(ids, { const isOwner = await access.asset.checkOwnerAccess(auth.user.id, ids, auth.session?.hasElevatedPermission);
[AccessHint.Owner]: (ids) => const isAlbum = await access.asset.checkAlbumAccess(auth.user.id, setDifference(ids, isOwner));
access.asset.checkOwnerAccess(auth.user.id, ids, auth.session?.hasElevatedPermission), const isPartner = await access.asset.checkPartnerAccess(auth.user.id, setDifference(ids, isOwner, isAlbum));
[AccessHint.Album]: (ids) => access.asset.checkAlbumAccess(auth.user.id, ids), return setUnion(isOwner, isAlbum, isPartner);
[AccessHint.Partner]: (ids) => access.asset.checkPartnerAccess(auth.user.id, ids),
});
} }
case Permission.AssetDownload: { case Permission.AssetDownload: {
return checkAll(ids, { const isOwner = await access.asset.checkOwnerAccess(auth.user.id, ids, auth.session?.hasElevatedPermission);
[AccessHint.Owner]: (ids) => const isAlbum = await access.asset.checkAlbumAccess(auth.user.id, setDifference(ids, isOwner));
access.asset.checkOwnerAccess(auth.user.id, ids, auth.session?.hasElevatedPermission), const isPartner = await access.asset.checkPartnerAccess(auth.user.id, setDifference(ids, isOwner, isAlbum));
[AccessHint.Album]: (ids) => access.asset.checkAlbumAccess(auth.user.id, ids), return setUnion(isOwner, isAlbum, isPartner);
[AccessHint.Partner]: (ids) => access.asset.checkPartnerAccess(auth.user.id, ids),
});
} }
case Permission.AssetUpdate: { case Permission.AssetUpdate: {
return checkAll(ids, { return await access.asset.checkOwnerAccess(auth.user.id, ids, auth.session?.hasElevatedPermission);
[AccessHint.Owner]: (ids) =>
access.asset.checkOwnerAccess(auth.user.id, ids, auth.session?.hasElevatedPermission),
});
} }
case Permission.AssetDelete: { case Permission.AssetDelete: {
return checkAll(ids, { return await access.asset.checkOwnerAccess(auth.user.id, ids, auth.session?.hasElevatedPermission);
[AccessHint.Owner]: (ids) =>
access.asset.checkOwnerAccess(auth.user.id, ids, auth.session?.hasElevatedPermission),
});
} }
case Permission.AlbumRead: { case Permission.AlbumRead: {
return checkAll( const isOwner = await access.album.checkOwnerAccess(auth.user.id, ids);
ids, const isShared = await access.album.checkSharedAlbumAccess(
{ auth.user.id,
[AccessHint.Owner]: (ids) => access.album.checkOwnerAccess(auth.user.id, ids), setDifference(ids, isOwner),
[AccessHint.Album]: (ids) => access.album.checkSharedAlbumAccess(auth.user.id, ids, AlbumUserRole.Viewer), AlbumUserRole.Viewer,
},
hint,
); );
return setUnion(isOwner, isShared);
} }
case Permission.AlbumAssetCreate: { case Permission.AlbumAssetCreate: {
return checkAll(ids, { const isOwner = await access.album.checkOwnerAccess(auth.user.id, ids);
[AccessHint.Owner]: (ids) => access.album.checkOwnerAccess(auth.user.id, ids), const isShared = await access.album.checkSharedAlbumAccess(
[AccessHint.Album]: (ids) => access.album.checkSharedAlbumAccess(auth.user.id, ids, AlbumUserRole.Editor), auth.user.id,
}); setDifference(ids, isOwner),
AlbumUserRole.Editor,
);
return setUnion(isOwner, isShared);
}
case Permission.AlbumUpdate: {
return await access.album.checkOwnerAccess(auth.user.id, ids);
} }
case Permission.AlbumShare:
case Permission.AlbumUpdate:
case Permission.AlbumDelete: { case Permission.AlbumDelete: {
return checkAll( return await access.album.checkOwnerAccess(auth.user.id, ids);
ids, }
{
[AccessHint.Owner]: (ids) => access.album.checkOwnerAccess(auth.user.id, ids), case Permission.AlbumShare: {
}, return await access.album.checkOwnerAccess(auth.user.id, ids);
hint,
);
} }
case Permission.AlbumDownload: { case Permission.AlbumDownload: {
return checkAll( const isOwner = await access.album.checkOwnerAccess(auth.user.id, ids);
ids, const isShared = await access.album.checkSharedAlbumAccess(
{ auth.user.id,
[AccessHint.Owner]: (ids) => access.album.checkOwnerAccess(auth.user.id, ids), setDifference(ids, isOwner),
[AccessHint.Album]: (ids) => access.album.checkSharedAlbumAccess(auth.user.id, ids, AlbumUserRole.Viewer), AlbumUserRole.Viewer,
},
hint,
); );
return setUnion(isOwner, isShared);
} }
case Permission.AlbumAssetDelete: { case Permission.AlbumAssetDelete: {
return checkAll( const isOwner = await access.album.checkOwnerAccess(auth.user.id, ids);
ids, const isShared = await access.album.checkSharedAlbumAccess(
{ auth.user.id,
[AccessHint.Owner]: (ids) => access.album.checkOwnerAccess(auth.user.id, ids), setDifference(ids, isOwner),
[AccessHint.Album]: (ids) => access.album.checkSharedAlbumAccess(auth.user.id, ids, AlbumUserRole.Editor), AlbumUserRole.Editor,
},
hint,
); );
return setUnion(isOwner, isShared);
} }
case Permission.AssetUpload: { case Permission.AssetUpload: {
@@ -267,36 +214,24 @@ const checkOtherAccess = async (access: AccessRepository, request: OtherAccessRe
} }
case Permission.AuthDeviceDelete: { case Permission.AuthDeviceDelete: {
return checkAll( return await access.authDevice.checkOwnerAccess(auth.user.id, ids);
ids,
{
[AccessHint.Owner]: (ids) => access.authDevice.checkOwnerAccess(auth.user.id, ids),
},
hint,
);
} }
case Permission.FaceDelete: { case Permission.FaceDelete: {
return checkAll(ids, { return access.person.checkFaceOwnerAccess(auth.user.id, ids);
[AccessHint.Owner]: (ids) => access.person.checkFaceOwnerAccess(auth.user.id, ids),
});
} }
case Permission.NotificationRead: case Permission.NotificationRead:
case Permission.NotificationUpdate: case Permission.NotificationUpdate:
case Permission.NotificationDelete: { case Permission.NotificationDelete: {
return checkAll(ids, { return access.notification.checkOwnerAccess(auth.user.id, ids);
[AccessHint.Owner]: (ids) => access.notification.checkOwnerAccess(auth.user.id, ids),
});
} }
case Permission.TagAsset: case Permission.TagAsset:
case Permission.TagRead: case Permission.TagRead:
case Permission.TagUpdate: case Permission.TagUpdate:
case Permission.TagDelete: { case Permission.TagDelete: {
return checkAll(ids, { return await access.tag.checkOwnerAccess(auth.user.id, ids);
[AccessHint.Owner]: (ids) => access.tag.checkOwnerAccess(auth.user.id, ids),
});
} }
case Permission.TimelineRead: { case Permission.TimelineRead: {
@@ -309,56 +244,54 @@ const checkOtherAccess = async (access: AccessRepository, request: OtherAccessRe
return ids.has(auth.user.id) ? new Set([auth.user.id]) : new Set(); return ids.has(auth.user.id) ? new Set([auth.user.id]) : new Set();
} }
case Permission.MemoryRead: case Permission.MemoryRead: {
case Permission.MemoryUpdate: return access.memory.checkOwnerAccess(auth.user.id, ids);
}
case Permission.MemoryUpdate: {
return access.memory.checkOwnerAccess(auth.user.id, ids);
}
case Permission.MemoryDelete: { case Permission.MemoryDelete: {
return checkAll(ids, { return access.memory.checkOwnerAccess(auth.user.id, ids);
[AccessHint.Owner]: (ids) => access.memory.checkOwnerAccess(auth.user.id, ids),
});
} }
case Permission.PersonCreate: { case Permission.PersonCreate: {
return checkAll(ids, { return access.person.checkFaceOwnerAccess(auth.user.id, ids);
[AccessHint.Owner]: (ids) => access.person.checkFaceOwnerAccess(auth.user.id, ids),
});
} }
case Permission.PersonRead: case Permission.PersonRead:
case Permission.PersonUpdate: case Permission.PersonUpdate:
case Permission.PersonDelete: case Permission.PersonDelete:
case Permission.PersonMerge: { case Permission.PersonMerge: {
return checkAll(ids, { return await access.person.checkOwnerAccess(auth.user.id, ids);
[AccessHint.Owner]: (ids) => access.person.checkOwnerAccess(auth.user.id, ids),
});
} }
case Permission.PersonReassign: { case Permission.PersonReassign: {
return checkAll(ids, { return access.person.checkFaceOwnerAccess(auth.user.id, ids);
[AccessHint.Owner]: (ids) => access.person.checkFaceOwnerAccess(auth.user.id, ids),
});
} }
case Permission.PartnerUpdate: { case Permission.PartnerUpdate: {
return checkAll(ids, { return await access.partner.checkUpdateAccess(auth.user.id, ids);
[AccessHint.Owner]: (ids) => access.partner.checkUpdateAccess(auth.user.id, ids),
});
} }
case Permission.SessionRead: case Permission.SessionRead:
case Permission.SessionUpdate: case Permission.SessionUpdate:
case Permission.SessionDelete: case Permission.SessionDelete:
case Permission.SessionLock: { case Permission.SessionLock: {
return checkAll(ids, { return access.session.checkOwnerAccess(auth.user.id, ids);
[AccessHint.Owner]: (ids) => access.session.checkOwnerAccess(auth.user.id, ids), }
});
case Permission.StackRead: {
return access.stack.checkOwnerAccess(auth.user.id, ids);
}
case Permission.StackUpdate: {
return access.stack.checkOwnerAccess(auth.user.id, ids);
} }
case Permission.StackRead:
case Permission.StackUpdate:
case Permission.StackDelete: { case Permission.StackDelete: {
return checkAll(ids, { return access.stack.checkOwnerAccess(auth.user.id, ids);
[AccessHint.Owner]: (ids) => access.stack.checkOwnerAccess(auth.user.id, ids),
});
} }
default: { default: {

View File

@@ -1,6 +1,6 @@
{ {
"name": "immich-web", "name": "immich-web",
"version": "1.141.1", "version": "1.142.0",
"license": "GNU Affero General Public License version 3", "license": "GNU Affero General Public License version 3",
"type": "module", "type": "module",
"scripts": { "scripts": {

View File

@@ -5,7 +5,7 @@
import { getAssetPlaybackUrl, getAssetThumbnailUrl } from '$lib/utils'; import { getAssetPlaybackUrl, getAssetThumbnailUrl } from '$lib/utils';
import { timeToSeconds } from '$lib/utils/date-time'; import { timeToSeconds } from '$lib/utils/date-time';
import { getAltText } from '$lib/utils/thumbnail-util'; import { getAltText } from '$lib/utils/thumbnail-util';
import { AccessHint, AssetMediaSize, AssetVisibility } from '@immich/sdk'; import { AssetMediaSize, AssetVisibility } from '@immich/sdk';
import { import {
mdiArchiveArrowDownOutline, mdiArchiveArrowDownOutline,
mdiCameraBurst, mdiCameraBurst,
@@ -20,7 +20,6 @@
import { authManager } from '$lib/managers/auth-manager.svelte'; import { authManager } from '$lib/managers/auth-manager.svelte';
import type { TimelineAsset } from '$lib/managers/timeline-manager/types'; import type { TimelineAsset } from '$lib/managers/timeline-manager/types';
import { mobileDevice } from '$lib/stores/mobile-device.svelte'; import { mobileDevice } from '$lib/stores/mobile-device.svelte';
import { user } from '$lib/stores/user.store';
import { moveFocus } from '$lib/utils/focus-util'; import { moveFocus } from '$lib/utils/focus-util';
import { currentUrlReplaceAssetId } from '$lib/utils/navigation'; import { currentUrlReplaceAssetId } from '$lib/utils/navigation';
import { TUNABLES } from '$lib/utils/tunables'; import { TUNABLES } from '$lib/utils/tunables';
@@ -46,7 +45,6 @@
imageClass?: ClassValue; imageClass?: ClassValue;
brokenAssetClass?: ClassValue; brokenAssetClass?: ClassValue;
dimmed?: boolean; dimmed?: boolean;
hint?: AccessHint;
onClick?: (asset: TimelineAsset) => void; onClick?: (asset: TimelineAsset) => void;
onSelect?: (asset: TimelineAsset) => void; onSelect?: (asset: TimelineAsset) => void;
onMouseEvent?: (event: { isMouseOver: boolean; selectedGroupIndex: number }) => void; onMouseEvent?: (event: { isMouseOver: boolean; selectedGroupIndex: number }) => void;
@@ -71,7 +69,6 @@
imageClass = '', imageClass = '',
brokenAssetClass = '', brokenAssetClass = '',
dimmed = false, dimmed = false,
hint,
}: Props = $props(); }: Props = $props();
let { let {
@@ -316,12 +313,7 @@
<ImageThumbnail <ImageThumbnail
class={imageClass} class={imageClass}
{brokenAssetClass} {brokenAssetClass}
url={getAssetThumbnailUrl({ url={getAssetThumbnailUrl({ id: asset.id, size: AssetMediaSize.Thumbnail, cacheKey: asset.thumbhash })}
id: asset.id,
size: AssetMediaSize.Thumbnail,
cacheKey: asset.thumbhash,
hint: asset.ownerId === $user.id ? undefined : hint,
})}
altText={$getAltText(asset)} altText={$getAltText(asset)}
widthStyle="{width}px" widthStyle="{width}px"
heightStyle="{height}px" heightStyle="{height}px"

View File

@@ -232,7 +232,6 @@
disabled={dayGroup.monthGroup.timelineManager.albumAssets.has(asset.id)} disabled={dayGroup.monthGroup.timelineManager.albumAssets.has(asset.id)}
thumbnailWidth={position.width} thumbnailWidth={position.width}
thumbnailHeight={position.height} thumbnailHeight={position.height}
hint={timelineManager.hint}
/> />
{#if customLayout} {#if customLayout}
{@render customLayout(asset)} {@render customLayout(asset)}

View File

@@ -353,7 +353,7 @@
<div <div
class="rounded-full w-[40px] h-[40px] bg-immich-primary text-white flex justify-center items-center font-mono font-bold shadow-lg hover:bg-immich-dark-primary transition-all duration-200 hover:text-immich-dark-bg opacity-90" class="rounded-full w-[40px] h-[40px] bg-immich-primary text-white flex justify-center items-center font-mono font-bold shadow-lg hover:bg-immich-dark-primary transition-all duration-200 hover:text-immich-dark-bg opacity-90"
> >
{feature.properties?.point_count} {feature.properties?.point_count?.toLocaleString()}
</div> </div>
{/snippet} {/snippet}
</MarkerLayer> </MarkerLayer>

View File

@@ -1,4 +1,4 @@
import { AccessHint, AssetOrder, getAssetInfo, getTimeBuckets } from '@immich/sdk'; import { AssetOrder, getAssetInfo, getTimeBuckets } from '@immich/sdk';
import { authManager } from '$lib/managers/auth-manager.svelte'; import { authManager } from '$lib/managers/auth-manager.svelte';
@@ -38,7 +38,6 @@ import type {
} from './types'; } from './types';
export class TimelineManager { export class TimelineManager {
hint?: AccessHint;
isInitialized = $state(false); isInitialized = $state(false);
months: MonthGroup[] = $state([]); months: MonthGroup[] = $state([]);
topSectionHeight = $state(0); topSectionHeight = $state(0);
@@ -98,9 +97,7 @@ export class TimelineManager {
monthGroup: undefined, monthGroup: undefined,
}); });
constructor(options?: { hint?: AccessHint }) { constructor() {}
this.hint = options?.hint;
}
setLayoutOptions({ headerHeight = 48, rowHeight = 235, gap = 12 }: TimelineManagerLayoutOptions) { setLayoutOptions({ headerHeight = 48, rowHeight = 235, gap = 12 }: TimelineManagerLayoutOptions) {
let changed = false; let changed = false;

View File

@@ -5,7 +5,6 @@ import { lang } from '$lib/stores/preferences.store';
import { serverConfig } from '$lib/stores/server-config.store'; import { serverConfig } from '$lib/stores/server-config.store';
import { handleError } from '$lib/utils/handle-error'; import { handleError } from '$lib/utils/handle-error';
import { import {
AccessHint,
AssetJobName, AssetJobName,
AssetMediaSize, AssetMediaSize,
JobName, JobName,
@@ -198,14 +197,12 @@ export const getAssetOriginalUrl = (options: string | AssetUrlOptions) => {
return createUrl(getAssetOriginalPath(id), { ...authManager.params, c: cacheKey }); return createUrl(getAssetOriginalPath(id), { ...authManager.params, c: cacheKey });
}; };
export const getAssetThumbnailUrl = ( export const getAssetThumbnailUrl = (options: string | (AssetUrlOptions & { size?: AssetMediaSize })) => {
options: string | (AssetUrlOptions & { size?: AssetMediaSize; hint?: AccessHint }),
) => {
if (typeof options === 'string') { if (typeof options === 'string') {
options = { id: options }; options = { id: options };
} }
const { id, size, cacheKey, hint } = options; const { id, size, cacheKey } = options;
return createUrl(getAssetThumbnailPath(id), { ...authManager.params, size, c: cacheKey, hint }); return createUrl(getAssetThumbnailPath(id), { ...authManager.params, size, c: cacheKey });
}; };
export const getAssetPlaybackUrl = (options: string | AssetUrlOptions) => { export const getAssetPlaybackUrl = (options: string | AssetUrlOptions) => {

View File

@@ -1,6 +1,6 @@
import { locale } from '$lib/stores/preferences.store'; import { locale } from '$lib/stores/preferences.store';
import { parseUtcDate } from '$lib/utils/date-time'; import { parseUtcDate } from '$lib/utils/date-time';
import { formatGroupTitle } from '$lib/utils/timeline-util'; import { formatGroupTitle, toISOYearMonthUTC } from '$lib/utils/timeline-util';
import { DateTime } from 'luxon'; import { DateTime } from 'luxon';
describe('formatGroupTitle', () => { describe('formatGroupTitle', () => {
@@ -77,3 +77,13 @@ describe('formatGroupTitle', () => {
expect(formatGroupTitle(date)).toBe('Invalid DateTime'); expect(formatGroupTitle(date)).toBe('Invalid DateTime');
}); });
}); });
describe('toISOYearMonthUTC', () => {
it('should prefix year with 0s', () => {
expect(toISOYearMonthUTC({ year: 28, month: 1 })).toBe('0028-01-01T00:00:00.000Z');
});
it('should prefix month with 0s', () => {
expect(toISOYearMonthUTC({ year: 2025, month: 1 })).toBe('2025-01-01T00:00:00.000Z');
});
});

View File

@@ -94,8 +94,11 @@ export const fromTimelinePlainYearMonth = (timelineYearMonth: TimelineYearMonth)
{ zone: 'local', locale: get(locale) }, { zone: 'local', locale: get(locale) },
) as DateTime<true>; ) as DateTime<true>;
export const toISOYearMonthUTC = ({ year, month }: TimelineYearMonth): string => export const toISOYearMonthUTC = ({ year, month }: TimelineYearMonth): string => {
`${year}-${month.toString().padStart(2, '0')}-01T00:00:00.000Z`; const yearFull = `${year}`.padStart(4, '0');
const monthFull = `${month}`.padStart(2, '0');
return `${yearFull}-${monthFull}-01T00:00:00.000Z`;
};
export function formatMonthGroupTitle(_date: DateTime): string { export function formatMonthGroupTitle(_date: DateTime): string {
if (!_date.isValid) { if (!_date.isValid) {

View File

@@ -59,7 +59,6 @@
type AssetGridRouteSearchParams, type AssetGridRouteSearchParams,
} from '$lib/utils/navigation'; } from '$lib/utils/navigation';
import { import {
AccessHint,
AlbumUserRole, AlbumUserRole,
AssetOrder, AssetOrder,
AssetVisibility, AssetVisibility,
@@ -329,7 +328,7 @@
} }
}); });
let timelineManager = new TimelineManager({ hint: AccessHint.Album }); let timelineManager = new TimelineManager();
$effect(() => { $effect(() => {
if (viewMode === AlbumPageViewMode.VIEW) { if (viewMode === AlbumPageViewMode.VIEW) {

View File

@@ -10,7 +10,7 @@
import { AppRoute } from '$lib/constants'; import { AppRoute } from '$lib/constants';
import { TimelineManager } from '$lib/managers/timeline-manager/timeline-manager.svelte'; import { TimelineManager } from '$lib/managers/timeline-manager/timeline-manager.svelte';
import { AssetInteraction } from '$lib/stores/asset-interaction.svelte'; import { AssetInteraction } from '$lib/stores/asset-interaction.svelte';
import { AccessHint, AssetVisibility } from '@immich/sdk'; import { AssetVisibility } from '@immich/sdk';
import { mdiArrowLeft, mdiPlus } from '@mdi/js'; import { mdiArrowLeft, mdiPlus } from '@mdi/js';
import { onDestroy } from 'svelte'; import { onDestroy } from 'svelte';
import { t } from 'svelte-i18n'; import { t } from 'svelte-i18n';
@@ -22,7 +22,7 @@
let { data }: Props = $props(); let { data }: Props = $props();
const timelineManager = new TimelineManager({ hint: AccessHint.Partner }); const timelineManager = new TimelineManager();
$effect( $effect(
() => () =>
void timelineManager.updateOptions({ void timelineManager.updateOptions({