Skip to content

Commit 052f39c

Browse files
committed
Merge branch 'feat_composite_fk' into fix_17475_2
2 parents f2da2cc + 11db8d8 commit 052f39c

File tree

9 files changed

+72
-39
lines changed

9 files changed

+72
-39
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"userEnvProbe": "loginInteractiveShell",
5656
"remoteEnv": {
5757
// The location where your uploaded files are stored
58-
"UPLOAD_LOCATION": "${localEnv:UPLOAD_LOCATION:./Library}",
58+
"UPLOAD_LOCATION": "${localEnv:UPLOAD_LOCATION:upload-devcontainer-volume}",
5959
// Connection secret for postgres. You should change it to a random password
6060
// Please use only the characters `A-Za-z0-9`, without special characters or spaces
6161
"DB_PASSWORD": "${localEnv:DB_PASSWORD:postgres}",

.devcontainer/server/container-common.sh

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,47 @@ export DEV_PORT="${DEV_PORT:-3000}"
77
# Devcontainer: Clone [repository|pull request] in container volumne
88
WORKSPACES_DIR="/workspaces"
99
IMMICH_DIR="$WORKSPACES_DIR/immich"
10+
IMMICH_DEVCONTAINER_LOG="$HOME/immich-devcontainer.log"
11+
12+
log() {
13+
# Display command on console, log with timestamp to file
14+
echo "$*"
15+
echo "[$(date '+%Y-%m-%d %H:%M:%S')] $*" >>"$IMMICH_DEVCONTAINER_LOG"
16+
}
17+
18+
run_cmd() {
19+
# Ensure log directory exists
20+
mkdir -p "$(dirname "$IMMICH_DEVCONTAINER_LOG")"
21+
22+
log "$@"
23+
24+
# Execute command: display normally on console, log with timestamps to file
25+
"$@" 2>&1 | tee >(while IFS= read -r line; do
26+
echo "[$(date '+%Y-%m-%d %H:%M:%S')] $line" >>"$IMMICH_DEVCONTAINER_LOG"
27+
done)
28+
29+
# Preserve exit status
30+
return "${PIPESTATUS[0]}"
31+
}
1032

1133
# Find directories excluding /workspaces/immich
1234
mapfile -t other_dirs < <(find "$WORKSPACES_DIR" -mindepth 1 -maxdepth 1 -type d ! -path "$IMMICH_DIR" ! -name ".*")
1335

1436
if [ ${#other_dirs[@]} -gt 1 ]; then
15-
echo "Error: More than one directory found in $WORKSPACES_DIR other than $IMMICH_DIR."
37+
log "Error: More than one directory found in $WORKSPACES_DIR other than $IMMICH_DIR."
1638
exit 1
1739
elif [ ${#other_dirs[@]} -eq 1 ]; then
1840
export IMMICH_WORKSPACE="${other_dirs[0]}"
1941
else
2042
export IMMICH_WORKSPACE="$IMMICH_DIR"
2143
fi
2244

23-
echo "Found immich workspace in $IMMICH_WORKSPACE"
24-
25-
run_cmd() {
26-
echo "$@"
27-
"$@"
28-
}
45+
log "Found immich workspace in $IMMICH_WORKSPACE"
46+
log ""
2947

3048
fix_permissions() {
3149

32-
echo "Fixing permissions for ${IMMICH_WORKSPACE}"
50+
log "Fixing permissions for ${IMMICH_WORKSPACE}"
3351

3452
run_cmd sudo find "${IMMICH_WORKSPACE}/server/upload" -not -path "${IMMICH_WORKSPACE}/server/upload/postgres/*" -not -path "${IMMICH_WORKSPACE}/server/upload/postgres" -exec chown node {} +
3553

@@ -41,17 +59,19 @@ fix_permissions() {
4159
"${IMMICH_WORKSPACE}/server/dist" \
4260
"${IMMICH_WORKSPACE}/web/node_modules" \
4361
"${IMMICH_WORKSPACE}/web/dist"
62+
63+
log ""
4464
}
4565

4666
install_dependencies() {
4767

48-
echo "Installing dependencies"
49-
68+
log "Installing dependencies"
5069
(
5170
cd "${IMMICH_WORKSPACE}" || exit 1
5271
run_cmd make install-server
53-
run_cmd make install-open-api
54-
run_cmd make build-open-api
72+
run_cmd make install-sdk
73+
run_cmd make build-sdk
5574
run_cmd make install-web
5675
)
57-
}
76+
log ""
77+
}

.devcontainer/server/container-compose-overrides.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,4 @@ volumes:
4242
open_api_node_modules:
4343
server_node_modules:
4444
web_node_modules:
45+
upload-devcontainer-volume:

.devcontainer/server/container-start-backend.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
# shellcheck disable=SC1091
44
source /immich-devcontainer/container-common.sh
55

6-
echo "Starting Nest API Server"
7-
6+
log "Starting Nest API Server"
7+
log ""
88
cd "${IMMICH_WORKSPACE}/server" || (
9-
echo workspace not found
9+
log "Immich workspace not found"
1010
exit 1
1111
)
1212

1313
while true; do
14-
node ./node_modules/.bin/nest start --debug "0.0.0.0:9230" --watch
15-
echo " Nest API Server crashed with exit code $?. Respawning in 3s ..."
14+
run_cmd node ./node_modules/.bin/nest start --debug "0.0.0.0:9230" --watch
15+
log "Nest API Server crashed with exit code $?. Respawning in 3s ..."
1616
sleep 3
1717
done

.devcontainer/server/container-start-frontend.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,20 @@
33
# shellcheck disable=SC1091
44
source /immich-devcontainer/container-common.sh
55

6-
echo "Starting Immich Web Frontend"
7-
6+
log "Starting Immich Web Frontend"
7+
log ""
88
cd "${IMMICH_WORKSPACE}/web" || (
9-
echo Workspace not found
9+
log "Immich Workspace not found"
1010
exit 1
1111
)
1212

1313
until curl --output /dev/null --silent --head --fail "http://127.0.0.1:${IMMICH_PORT}/api/server/config"; do
14-
echo 'waiting for api server...'
14+
log "Waiting for api server..."
1515
sleep 1
1616
done
1717

1818
while true; do
19-
node ./node_modules/.bin/vite dev --host 0.0.0.0 --port "${DEV_PORT}"
20-
echo "Web crashed with exit code $?. Respawning in 3s ..."
19+
run_cmd node ./node_modules/.bin/vite dev --host 0.0.0.0 --port "${DEV_PORT}"
20+
log "Web crashed with exit code $?. Respawning in 3s ..."
2121
sleep 3
2222
done

.devcontainer/server/container-start.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,18 @@
33
# shellcheck disable=SC1091
44
source /immich-devcontainer/container-common.sh
55

6+
log "Setting up Immich dev container..."
67
fix_permissions
8+
9+
log "Installing npm dependencies (node_modules)..."
710
install_dependencies
11+
12+
log "Setup complete, please wait while backend and frontend services automatically start"
13+
log
14+
log "If necessary, the services may be manually started using"
15+
log
16+
log "$ /immich-devcontainer/container-start-backend.sh"
17+
log "$ /immich-devcontainer/container-start-frontend.sh"
18+
log
19+
log "From different terminal windows, as these scripts automatically restart the server"
20+
log "on error, and will continuously run in a loop"

.github/workflows/test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ jobs:
101101
if: ${{ !cancelled() }}
102102

103103
- name: Run small tests & coverage
104-
run: npm run test:cov
104+
run: npm test
105105
if: ${{ !cancelled() }}
106106

107107
cli-unit-tests:
@@ -146,7 +146,7 @@ jobs:
146146
if: ${{ !cancelled() }}
147147

148148
- name: Run unit tests & coverage
149-
run: npm run test:cov
149+
run: npm run test
150150
if: ${{ !cancelled() }}
151151

152152
cli-unit-tests-win:
@@ -184,7 +184,7 @@ jobs:
184184
if: ${{ !cancelled() }}
185185

186186
- name: Run unit tests & coverage
187-
run: npm run test:cov
187+
run: npm run test
188188
if: ${{ !cancelled() }}
189189

190190
web-lint:
@@ -262,7 +262,7 @@ jobs:
262262
if: ${{ !cancelled() }}
263263

264264
- name: Run unit tests & coverage
265-
run: npm run test:cov
265+
run: npm run test
266266
if: ${{ !cancelled() }}
267267

268268
i18n-tests:

mobile/lib/services/share.service.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class ShareService {
3030
for (var asset in assets) {
3131
if (asset.isLocal) {
3232
// Prefer local assets to share
33-
File? f = await asset.local!.file;
33+
File? f = await asset.local!.originFile;
3434
downloadedXFiles.add(XFile(f!.path));
3535
} else if (asset.isRemote) {
3636
// Download remote asset otherwise

mobile/lib/widgets/asset_grid/control_bottom_app_bar.dart

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,14 @@ class ControlBottomAppBar extends HookConsumerWidget {
131131

132132
List<Widget> renderActionButtons() {
133133
return [
134-
if (hasRemote)
135-
ControlBoxButton(
136-
iconData: Platform.isAndroid
137-
? Icons.share_rounded
138-
: Icons.ios_share_rounded,
139-
label: "share".tr(),
140-
onPressed: enabled ? () => onShare(true) : null,
141-
),
142-
if (!isInLockedView)
134+
ControlBoxButton(
135+
iconData: Platform.isAndroid
136+
? Icons.share_rounded
137+
: Icons.ios_share_rounded,
138+
label: "share".tr(),
139+
onPressed: enabled ? () => onShare(true) : null,
140+
),
141+
if (!isInLockedView && hasRemote)
143142
ControlBoxButton(
144143
iconData: Icons.link_rounded,
145144
label: "share_link".tr(),

0 commit comments

Comments
 (0)