Closed tobi-dub closed 7 months ago
Thanks for the suggestion!
I think with minimal tweaking the script could accept negative album_levels
to achieve exactly that. Just played around with that and looks like it's working, but need to do proper validation first.
@tobi-dub I just pushed some modifications to the script that will make it accept negative album_level
values. By setting it to -1
you should be able to achieve the same result as with your modification.
Would you be willing to test the current script in main
in interactive mode?
Thanks @Salvoxia ! I just tested with two different libraries and it works pretty fine!
Here an example output for the year 2003. The pics are stored in a folder structure like: years/2003/2003-06/2003-06-04 years/2003/2003-06/2003-06-11 .....
The output shows all deepest folders as expected :)
$ python3 ./immich_auto_album_new_main.py -a -1 /usr/src/app/external/years http://127.0.0.1:2283/api xxxxxxxxxxx
time=2024-04-12T08:28:07.942+02:00 level=INFO msg=Requesting all assets
time=2024-04-12T08:28:16.981+02:00 level=INFO msg=69273 photos found
time=2024-04-12T08:28:16.981+02:00 level=INFO msg=Sorting assets to corresponding albums using folder name
time=2024-04-12T08:28:17.072+02:00 level=INFO msg=1016 albums identified
time=2024-04-12T08:28:17.072+02:00 level=INFO msg=Album list: ['2003-06-04', '2003-06-11', '2003-06-15', '2003-06-18', '2003-06-24', '2003-06-27', '2003-06-30', '2003-07-03', '2003-07-07', '2003-07-08', '2003-07-12', '2003-07-18', '2003-07-25', '2003-08-01', '2003-08-08', '2003-08-13', '2003-08-15', '2003-08-16', '2003-08-20', '2003-08-21', '2003-08-25', '2003-08-27', '2003-09-02', '2003-09-05']
Press Enter to continue, Ctrl+C to abort
Great, thanks for testing and your idea! I'll release a new version for this during the weekend.
Very nice script, saved me a lot of manual work :)
I modified it a little bit to name the albums only by the deepest folder name. My album structure is like: 2020/2020-01/2020-01-01 2020/2020-03/2020-03-27
Could be nicer but this works fine:
Could be integrated as second option to your already implemented album level naming.