Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ghost opened this issue Sep 4, 2021 · 3 comments
Labels
enhancement New feature or request

Comments

@ghost
Copy link

ghost commented Sep 4, 2021

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.

@kamil4 kamil4 added the enhancement New feature or request label Sep 5, 2021
@kamil4
Copy link
Contributor

kamil4 commented Sep 5, 2021

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.

@ghost
Copy link
Author

ghost commented Sep 21, 2021

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.

@nagmat84
Copy link
Contributor

nagmat84 commented Sep 22, 2021

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants