summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2023-12-10 10:44:17 +0100
committerPřemysl Eric Janouch <p@janouch.name>2023-12-10 10:44:17 +0100
commit1f571a903dcf9dee07a1b1c464ff4e472ccc7abe (patch)
tree29d2e9660dce79a5572e6b8e7c623cfe3798b2b9 /main.go
parentc71cf11fe495b250b6d057963fa0416e706e963b (diff)
downloadgallery-1f571a903dcf9dee07a1b1c464ff4e472ccc7abe.tar.gz
gallery-1f571a903dcf9dee07a1b1c464ff4e472ccc7abe.tar.xz
gallery-1f571a903dcf9dee07a1b1c464ff4e472ccc7abe.zip
Deep thought
Diffstat (limited to 'main.go')
-rw-r--r--main.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/main.go b/main.go
index 45a5b51..598c5c5 100644
--- a/main.go
+++ b/main.go
@@ -456,6 +456,8 @@ func (i *importer) Import(path string) error {
return err
}
+ // FIXME: This disallows any entries directly in the root.
+ // TODO: Turn this into an upsert statement.
_, err = tx.Exec(`INSERT INTO entry(parent, name, mtime, sha1)
VALUES (?, ?, ?, ?)`, dbParent, dbBasename, s.ModTime().Unix(), hexSHA1)
if err != nil {
@@ -705,6 +707,8 @@ func cmdDhash(args []string) error {
defer pb.Stop()
// TODO: Also run the hasher in parallel, once it becomes a problem.
+ // And/or run it in batches, since start-up time of the hasher
+ // poses considerable overhead with large amounts of images.
for _, sha1 := range hexSHA1 {
pathThumb := thumbPath(sha1)
hash, err := makeDhash(hasher, pathThumb)