lens @ 1dea35b9bcb3d37d61e554a99488626da9795331

feat: Remove unecessary param from repo
diff --git a/Makefile b/Makefile
index 39c579c0bb9e29d7a7407c5f2178d1e6178f32ee..5731808468bf7f1964698229f3399874c8ec2bab 100644
--- a/Makefile
+++ b/Makefile
@@ -13,9 +13,11 @@ 	$(GO_BUILD) -o $(OUT) $(SERVER)
 
 run: sass
 	$(GO_RUN) $(SERVER) \
-		--log-level error \
+		--db-type psql \
+		--db-con "host=localhost user=gabrielgio password=diablo123 dbname=img port=5432 sslmode=disable" \
+		--log-level trace \
 		--aes-key=6368616e676520746869732070617373 \
-		--root=${HOME} \
+		--root=${HOME}
 
 sass:
 	@mkdir -p static
diff --git a/README.md b/README.md
index 817ba0e9711bb18d0e309d69e1764762ed2ecae9..9f05e5fae430a2cb5a909ea86d48170021e97028 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,13 @@
 # IMG
 
 A read only file explorer with media capabilities.
+
+# TODO 
+
+* Thumbnail system
+* Initial setup process
+    * Also allow setup user config file
+* Single binary output
+* Better worker pool. Allow cron job and ui config
+* Alpine package and demo site
+* Single image viewer and show exif info (not sure how yet)
diff --git a/cmd/server/main.go b/cmd/server/main.go
index e9314ec813338fb63cf8b4e536eab2ce20a8a446..0abdc09c74554ffe96c2e8d04b63a68923f41f12 100644
--- a/cmd/server/main.go
+++ b/cmd/server/main.go
@@ -112,7 +112,7 @@ 	// worker
 	var (
 		serverWorker = worker.NewServerWorker(&fasthttp.Server{Handler: r.Handler})
 		fileScanner  = worker.NewFileScanner(*root, mediaRepository)
-		exifScanner  = worker.NewEXIFScanner(*root, mediaRepository)
+		exifScanner  = worker.NewEXIFScanner(mediaRepository)
 	)
 
 	pool := worker.NewWorkerPool()
diff --git a/golangci.yml b/golangci.yml
index 25b47fd54de1addbcb04a64dd6eaf8a9d4305cf1..1ad6f9c8e4bdc1c983bb2f69ea2550f692625b4e 100644
--- a/golangci.yml
+++ b/golangci.yml
@@ -13,6 +13,8 @@     - unparam
     - gci
     - bodyclose
     - makezero
+    - govet
+    - contextcheck
 
 linters-settings:
   gci:
@@ -31,6 +33,11 @@         severity: error
         disabled: false
       - name: package-comments
         disabled: true
+  govet:
+    enable-all: true
+    disable:
+      - fieldalignment
+      - shadow
 
 issues:
   exclude-use-default: false
diff --git a/main b/main
deleted file mode 100644
index c2b077f19312c3a1e7db65c962d89510cd2e1a3e..0000000000000000000000000000000000000000
Binary files a/main and /dev/null differ
diff --git a/pkg/database/sql/media.go b/pkg/database/sql/media.go
index 835e262efe59ac90d2cdb27604caabfcd9e27fa4..59a4b83cd13b57b64e643a2b8a87f7f2c18fd9be 100644
--- a/pkg/database/sql/media.go
+++ b/pkg/database/sql/media.go
@@ -223,7 +223,7 @@ 		Joins("left join media_exifs on media.id = media_exifs.media_id").
 		Where("media_exifs.media_id IS NULL").
 		Offset(pagination.Page * pagination.Size).
 		Limit(pagination.Size).
-		Order("created_at DESC").
+		Order("media.created_at DESC").
 		Find(&medias)
 
 	if result.Error != nil {
diff --git a/pkg/worker/exif_scanner.go b/pkg/worker/exif_scanner.go
index 66091cd33ff93ebc6dbfda28a74bddef860ab6d3..6d40dbd7435830a06fee5974cda18f20e73f67c0 100644
--- a/pkg/worker/exif_scanner.go
+++ b/pkg/worker/exif_scanner.go
@@ -15,7 +15,7 @@ )
 
 var _ ListProcessor[*media.Media] = &EXIFScanner{}
 
-func NewEXIFScanner(root string, repository media.Repository) *EXIFScanner {
+func NewEXIFScanner(repository media.Repository) *EXIFScanner {
 	return &EXIFScanner{
 		repository: repository,
 	}
diff --git a/pkg/worker/file_scanner.go b/pkg/worker/file_scanner.go
index 321fbcac11e422ea6221e8a476ac2f7704b06143..0dc2eb2d4ec01556a88a96ac284a0cd695b68f93 100644
--- a/pkg/worker/file_scanner.go
+++ b/pkg/worker/file_scanner.go
@@ -33,6 +33,12 @@ 	c := make(chan string)
 	go func() {
 		defer close(c)
 		_ = filepath.Walk(f.root, func(path string, info fs.FileInfo, err error) error {
+			select {
+			case <-ctx.Done():
+				return filepath.SkipAll
+			default:
+			}
+
 			if info.IsDir() && filepath.Base(info.Name())[0] == '.' {
 				return filepath.SkipDir
 			}
diff --git a/pkg/worker/list_processor_test.go b/pkg/worker/list_processor_test.go
index b7373d183eed5685a26c30a4097a84cd0f36ea42..1e4ed2d7793632a996cb6b828fd21677dcedbb55 100644
--- a/pkg/worker/list_processor_test.go
+++ b/pkg/worker/list_processor_test.go
@@ -1,4 +1,4 @@
-// go:build unit
+//go:build unit
 
 package worker
 
diff --git a/pkg/worker/worker.go b/pkg/worker/worker.go
index c52f0becef3a84c09caa841e402977c9858e7fb3..18cc0e25c15a57d778a806275f6fa354b637d8c0 100644
--- a/pkg/worker/worker.go
+++ b/pkg/worker/worker.go
@@ -36,12 +36,12 @@ 	})
 }
 
 func (self *WorkerPool) Start(ctx context.Context) {
+	self.wg.Add(len(self.workers))
 	for _, w := range self.workers {
-		self.wg.Add(1)
 		go func(w *Work) {
 			defer self.wg.Done()
 			if err := w.Worker.Start(ctx); err != nil && !errors.Is(err, context.Canceled) {
-				fmt.Println("Error ", w.Name, err.Error())
+				fmt.Println("Processes finished, error", w.Name, err.Error())
 			} else {
 				fmt.Println(w.Name, "done")
 			}
diff --git a/scss/main.scss b/scss/main.scss
index bf6b3d8dda08d6916c9bae414816f95c84239261..faad1caee8041b36f946b89d7f8b309d042426c2 100644
--- a/scss/main.scss
+++ b/scss/main.scss
@@ -13,6 +13,7 @@ $panel-shadow: 0;
 
 $card-shadow: 0;
 $card-radius: 0;
+$card-content-padding: 0;
 
 @import "bulma/sass/base/_all.sass";
 @import "bulma/sass/utilities/_all.sass";
@@ -38,7 +39,6 @@ }
 
 nav {
     border-bottom: 1px solid;
-    max-width: 1024px;
     margin: auto;
 }
 
diff --git a/templates/layout.html b/templates/layout.html
index 56d02f80858fd73559659118b4352bb342f12188..e21ec5e8b6f8c4d9f66356eca18052a829dc7cc4 100644
--- a/templates/layout.html
+++ b/templates/layout.html
@@ -21,7 +21,7 @@                     settings
                 </a>
             </div>
         </nav>
-        <div class="container is-max-desktop">
+        <div class="container">
             {{block "content" .}}noop{{end}}
         </div>
     </body>