Coder Social home page Coder Social logo

Comments (6)

LjaPb avatar LjaPb commented on August 19, 2024 1

Everything was exactly like that, it works! Thank you;)

from immich-folder-album-creator.

nothing2obvi avatar nothing2obvi commented on August 19, 2024

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!

from immich-folder-album-creator.

LjaPb avatar LjaPb commented on August 19, 2024

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)

from immich-folder-album-creator.

Salvoxia avatar Salvoxia commented on August 19, 2024

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?

from immich-folder-album-creator.

LjaPb avatar LjaPb commented on August 19, 2024

Of cource,

Снимок экрана 2024-06-21 в 13 28 52
 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

from immich-folder-album-creator.

Salvoxia avatar Salvoxia commented on August 19, 2024

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.

from immich-folder-album-creator.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.