LycheeOrg / Lychee

A great looking and easy-to-use photo-management-system you can run on your server, to manage and share photos.

Home Page:https://lycheeorg.github.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Enhancement] Could you please remain folder structure and original file names for the backup purpose?

opened this issue · comments

As the title says, let's consider a situation, where one day Lychee will stop working. Then we are left with the one folder with all the files with random names. It will be very difficult to handle sorting them without processing data from database. I think it might be safer if we could recreate the subfolder structure based on the album names and leave files in that structure.

FYI, there is work ongoing on generalizing things such as the file structure on disk (see #1055), which should in principle make what you are asking for here easier. Having said that, there are practical difficulties to implementing things this way: for one, the titles of Lychee albums or photos don't need to be unique, and you are welcome to have characters such as / in the titles, which obviously wouldn't work with file names on disk.

Also keep in mind that Lychee already supports importing via symlinks -- you can retain whatever structure you want on disk and Lychee will create links to the files from its structure. That lets you avoid the "heap of random file names" problem.

A related issue is that Lychee doesn't really have an Export feature. I mean, you can download whole albums with their content, but that doesn't preserve metadata like, say, the Description fields or the sorting order. I don't know if there is some de facto standard format for that sort of things that we could support? I was thinking about this only yesterday when updating the gallery with the photos of my young kids. The gallery is primarily for our family members to view now, but how could I ensure that my kids will be able to access it when they are adults? Obviously, current version of PHP won't be supported in 15 or 20 years... Sure, I have all the image files elsewhere, but that's in a lot more raw form than a nicely curated gallery.

I'm glad, that you understand the problem. I think, that even renaming file to it's id in database and keeping it in a folder called the same as an album, where that file occurred first is still better than everything in one "bucket". There is no perfect solution for that, but I think, that you could consider setting some strict rules, like replacing every special char with "-" and lowercase every file and folder name.

I mean, you can download whole albums with their content, but that doesn't preserve metadata like, say, the Description fields or the sorting order. I don't know if there is some de facto standard format for that sort of things that we could support?

I think, that json file for each album might do the trick.

Am not sure what you are missing exactly. There is the "Download" option which allows you to download albums recursively as a ZIP file. If you download the root folder it will basically download the entire Lychee repository except for the built-in smart folders and tag albums. (I am not sure about the latter. The code is in App\Actions\Album\Archive but I haven't inspect it in detail.)

The code also takes care of duplicate titles for photos and sub-albums. If a title exists multiple times, the title is appended with increasing numbers, i.e. duplicate-01.jpg, duplicate-02.jpg.

What exactly do you need or would like to see which is not yet provided by this feature?