Closed nothing2obvi closed 4 months ago
Nvm I figured it out. I was using the root path on the host instead of the root path for Immich. Thanks, it works really well!
I have a similar error. The point is that the script sees all photos (not limited to the specified folder). I can’t limit his search to only a specific folder. The path to the external library is correct (copied directly from the application itself)
Hi, could you please share the arguments/environment variables you're using, the log the script produces and how your folder structure within the Immich container looks like?
Of cource,
python3 ./immich_auto_album.py root_path="/mnt/main_pool/archive/Photos/Travel/" [9:17:23]
time=2024-06-21T09:18:21.569-03:00 level=INFO msg=Detected Immich server version 1.106.4
time=2024-06-21T09:18:21.569-03:00 level=INFO msg=Requesting all assets
time=2024-06-21T09:20:03.904-03:00 level=INFO msg=41465 photos found
time=2024-06-21T09:20:03.904-03:00 level=INFO msg=Sorting assets to corresponding albums using folder name
time=2024-06-21T09:20:03.930-03:00 level=INFO msg=0 albums identified
time=2024-06-21T09:20:03.930-03:00 level=INFO msg=Album list: []
Press Enter to continue, Ctrl+C to abort
^CTraceback (most recent call last):
File "./immich_auto_album.py", line 336, in <module>
input()
KeyboardInterrupt
Variables api_url
and api_key
added in the script itself.
if I add a variable to the script
root_paths = '/mnt/main_pool/archive/Photos/Travel'
I get another error:
python3 ./immich_auto_album.py [12:49:40]
time=2024-06-21T13:07:05.585-03:00 level=INFO msg=Detected Immich server version 1.106.4
time=2024-06-21T13:07:05.586-03:00 level=INFO msg=Requesting all assets
time=2024-06-21T13:08:48.933-03:00 level=INFO msg=41465 photos found
time=2024-06-21T13:08:48.933-03:00 level=INFO msg=Sorting assets to corresponding albums using folder name
time=2024-06-21T13:08:48.933-03:00 level=WARNING msg=Got empty album name for asset path /mnt/main_pool/archive/Photos/Travel/qwe/IMG_2914.JPG, check your album_level settings!
-------
**there are a lot of lines like this + I see folders one level higher (where he shouldn’t go)**
------
time=2024-06-21T13:09:38.312-03:00 level=INFO msg=5 albums identified
time=2024-06-21T13:09:38.312-03:00 level=INFO msg=Album list: ['uload', 'uplad', 'upload', 'uplod', 'upoad']
-------
**strange albums о_0**
------
Press Enter to continue, Ctrl+C to abort
^CTraceback (most recent call last):
File "./immich_auto_album.py", line 336, in <module>
input()
KeyboardInterrupt
maybe this is important, I use the official immich app in TrueNAS tell me if there is anything else I can show
Ok, I think I know what's going on. The call
python3 ./immich_auto_album.py root_path="/mnt/main_pool/archive/Photos/Travel/"
is not actually correct.
By default, the script expects three positional arguments in a very specific order: root_path
, api_url
, and api_key
.
Now you say you added api_url
and api_key
to the script itself, that's fine. Now the script stills expect one positional argument root_path
.
The option -r
or --root-path
is only intended to be used if you have multiple import paths or multiple external libraries the script should work with. The positional argument for root_path
must always be supplied, --root-path
is optional.
Since the script expects one positional argument, it interprets the whole string you provide as the root_path
, meaning your root_path
is currently set to root_path="/mnt/main_pool/archive/Photos/Travel/"
.
Adding -l DEBUG
(setting log level to DEBUG) and running it again should confirm this by showing the following output:
time=2024-06-21T18:58:36.399+02:00 level=DEBUG msg=root_path = ['root_path=/mnt/main_pool/archive/Photos/Travel/']
So the correct call for a single root_path
(taking your modifications into consideration) would be
python3 ./immich_auto_album.py /mnt/main_pool/archive/Photos/Travel/
Please let me know if that fixes your issue.
Everything was exactly like that, it works! Thank you;)
Am I doing something wrong? I tried it with
-a '3'
and-a '4'
but get the same result.