Re: Breaking changes in file layout
Johannes Zarl-Zierl <[email protected]> Mon, 06 Apr 2020 23:35:09 +0200
| Newsgroups | gmane.comp.kde.kimdaba |
|---|---|
| Message-ID | <63457182.8Uebkm9nbj@mani> |
Am Montag, 6. April 2020, 15:57:03 CEST schrieb Robert Krawitz: > On Mon, 06 Apr 2020 08:58:36 +0200, Tobias Leupold wrote: > >> XDG_CACHE_DIR/kphotoalbum/<db>/.thumbnails/ > >> XDG_CACHE_DIR/kphotoalbum/<db>/.videoThumbnails/ > > > > Do you think the leading dot is needed (making the directory hidden)? > > We're > > already in "kphotoalbum/" one leven below, so why not "thumbnails/" and > > "videoThumbnails/"? > > Agreed. Yes, that was a copy/paste error of mine. > >> I get your point, but I'm not a big fan of constructs like "/home/ > >> johannes/.cache/kphotoalbum/home/johannes/Pictures" either. > > > > I personally would prefer the hash. Maybe we could add a file like > > "collection" or such containing the path to index.xml for easier user-side > > identification. I wouldn't add the whole path. If so, please at least > > don't > > use pipe symbols to mask the slashes, that also have to be masked when > > using the directory name ... > > I hate hashes when they aren't used to reduce the storage requirement > for something or are needed for cryptographic security (such as > passwords). Hashing the contents of a file to quickly determine > whether two files are identical is one thing. In this case, it makes > it hard to trace the origin without improving security (non-issue in > this case) or saving space. > > There's no perfect solution to the fact that slashes can't be filename > components, but I don't think this really has to be absolutely > perfect. Maybe a good middle ground would be to keep the full file name without escaping, but strip the home directory if applicable. Advantages: + short names on average (e.g. ~/.cache/kphotoalbum/Pictures) + no escaping involved Disadvantages: + still not 100% scriptable for unusual paths (i.e. paths outside $HOME) + potentially deep directory structure > > This one could actually be hidden by a leading dot imo, like > > "DBDIR/.CategoryImages/" > > Or moved to XDG_CACHE_DIR/kphotoalbum/<db>/CategoryImages? This is *not* a cache. It's user-created data. Quoting from a different part of the thread: > Should it be part of the index.xml file proper? I'm not a big fan of CDATA sections in XML files. Moving the files into index.xml would create more problems than it solves: I like my index.xml file easily editable by hand and diffable. Also, I don't want to deal with the files during database-load and keep them in memory for later.