-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from nsg/sync-python
Re-implement sync service in pure python
- Loading branch information
Showing
11 changed files
with
309 additions
and
321 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,24 @@ | ||
#!/bin/bash | ||
|
||
if [ -z $SNAP ]; then | ||
. src/bin/sync | ||
else | ||
. $SNAP/bin/sync | ||
fi | ||
|
||
if [ -z $SNAP ]; then | ||
echo "Abort: Only run this inside the snap" | ||
exit 0 | ||
fi | ||
. $SNAP/bin/load-env | ||
|
||
if ! sync_enabled; then | ||
echo "Folder sync disabled" | ||
exit 0 | ||
fi | ||
|
||
block_immich_server_ready | ||
while ! immich_server_ready; do | ||
sleep 2 | ||
done | ||
|
||
for KEY in $(get_keys); do | ||
for KEY in $(snapctl get sync); do | ||
USER_ID="$(user_id $KEY)" | ||
|
||
if [ ! -z "$USER_ID" ]; then | ||
USER_PATH="$SNAP_COMMON/sync/$USER_ID" | ||
mkdir -p "$USER_PATH" | ||
|
||
echo "Full import of $USER_PATH for user $USER_ID" | ||
upload "$KEY" --recursive "$USER_PATH" | ||
$SNAP/bin/immich-cli upload --recursive --key "$KEY" --yes "$USER_PATH" | ||
fi | ||
done |
Oops, something went wrong.