PartyWifi / PartyWifi.Server

This is the central server of the PartyWifi ecosystem.
GNU General Public License v3.0
2 stars 1 forks source link

Filenaming and folder structure #23

Closed Toxantron closed 7 years ago

Toxantron commented 7 years ago

Currently @dbeuchler and I keep switching between timestamped files like 20170301-072931.jpg and GUIDs.

I am not a fan of guids and would personally prefer files names that have some use to the user later - e.g. for sorting a directory. There is a reason all cellphones use timestamps as names. If we decide to use non-time names may I suggest using hashvalues instead. They at least help remove duplicates and are mathematically equally distributed which could help us use the git file-system optimization of using the first two digits of the hash as a subdirectory and the rest as the name.

dbeuchler commented 7 years ago

I do not like this hash folder structure. That makes the saving and loading unnecessarily complicated. The format is not readable by any editor/explorer or something else. ´

I prefer to use a more human readable sturcture.

uploads id/name/datetime-original.ext id/name/datetime-thumb.ext id/name/datetime-slideshow.ext id/name/datetime-metadata.json

The json is human readable and is easy to handle in code.

Toxantron commented 7 years ago

I love it, it's fast, space saving and why does it have to be human readable? We need an export function anyway. It also allows us to put images and metadata on different partitions.

Most importantly it is fully wrapped in the imagemanager and hidden to the external API. They simply call /image/resized/(Id)

Toxantron commented 7 years ago

We could argue to use JSON for metadata.

Toxantron commented 7 years ago

We can even drop the fixed names and instead use resolution pointers like

{
    "Width": 1920,
    "Height": 1080,
    "Reference": "C4E667..."
}

The we only have the original and an array of preprocessed resolutions.

dbeuchler commented 7 years ago

Sounds good! Do you will implement that?

Toxantron commented 7 years ago

Yes

Toxantron commented 7 years ago

Closed by #25.