From 87c1a69b49ce4d1a8e7f66d0518ae74071e11624 Mon Sep 17 00:00:00 2001 From: Timmy Welch Date: Sun, 13 Oct 2024 22:16:37 -0700 Subject: [PATCH] Remove unused Path attribute --- cmd/comic-hasher/main.go | 7 +++---- hashing.go | 1 - 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/cmd/comic-hasher/main.go b/cmd/comic-hasher/main.go index 4daeea2..f88d7a0 100644 --- a/cmd/comic-hasher/main.go +++ b/cmd/comic-hasher/main.go @@ -459,7 +459,7 @@ func (s *Server) addCover(w http.ResponseWriter, r *http.Request) { return default: } - s.hashingQueue <- ch.Im{Im: i, Format: format, ID: ch.ID{Domain: ch.Source(domain), ID: ID}, Path: ""} + s.hashingQueue <- ch.Im{Im: i, Format: format, ID: ch.ID{Domain: ch.Source(domain), ID: ID}} writeJson(w, http.StatusOK, result{Msg: "Success"}) } @@ -489,7 +489,7 @@ func (s *Server) hasher(workerID int, done func()) { } elapsed := time.Since(start) - log.Printf("Hashing took %v: worker: %v. path: %s %s: %064b id: %s\n", elapsed, workerID, image.Path, hash.Hashes[0].Kind, hash.Hashes[0].Hash, hash.ID) + log.Printf("Hashing took %v: worker: %v. %s: %064b id: %s\n", elapsed, workerID, hash.Hashes[0].Kind, hash.Hashes[0].Hash, hash.ID) } } @@ -508,8 +508,7 @@ func (s *Server) reader(workerID int, done func()) { im := ch.Im{ Im: i, Format: format, - ID: ch.ID{Domain: ch.Source(filepath.Base(filepath.Dir(filepath.Dir(path)))), ID: filepath.Base(filepath.Dir(path))}, - Path: path, + ID: ch.ID{Domain: ch.Source(filepath.Base(filepath.Dir(filepath.Dir(path)))), ID: filepath.Base(filepath.Dir(path))}, } select { case <-s.quit: diff --git a/hashing.go b/hashing.go index 2b96f05..f7c9775 100644 --- a/hashing.go +++ b/hashing.go @@ -63,7 +63,6 @@ type Result struct { type Im struct { Im image.Image Format string - Path string ID ID }