sentriz / gonic

music streaming server / free-software subsonic server API implementation
ircs://irc.libera.chat/#gonic
GNU General Public License v3.0
1.49k stars 105 forks source link

Added code to trigger rescan of entire tree upon file removal to clea… #496

Closed brian-doherty closed 2 months ago

brian-doherty commented 2 months ago

…n as needed.

brian-doherty commented 2 months ago

@sentriz FYI the linter failed with a bunch of tar errors that I don't think have anything to do with my change. Do you have any idea what happened?

sentriz commented 2 months ago

ooh nice one , looks good 👍

also think we can just ScanAndClean(ScanOptions{}) since IsFull will be initialised to false anyway

@sentriz FYI the linter failed with a bunch of tar errors that I don't think have anything to do with my change. Do you have any idea what happened?

yeah musttag, would you mind excluding that rule/linter from the .golangci lint config? I'm only on my phone atm

sentriz commented 2 months ago

this guy can go https://github.com/sentriz/gonic/blob/38ab0b0929660e76959b973eb5941f7104ee77dd/.golangci.yml#L48

brian-doherty commented 2 months ago

I made the change but lint is still failing with a ton of "Cannot open: File exists" errors. Here's how it starts:

Checking for go.mod: go.mod Received 237012410 of 241206714 (98.3%), 225.8 MBs/sec Cache Size: ~230 MB (241206714 B) /usr/bin/tar -xf /home/runner/work/_temp/1e007a1e-b75a-464f-8a56-96a109222e67/cache.tzst -P -C /home/runner/work/gonic/gonic --use-compress-program unzstd Received 241206714 of 241206714 (100.0%), 114.9 MBs/sec /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.28.0/LICENSE: Cannot open: File exists /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.28.0/.github/workflows/test.yml: Cannot open: File exists /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.28.0/README.md: Cannot open: File exists Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.28.0/cmd/protoc-gen-go/annotation_test.go: Cannot open: File exists Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.28.0/cmd/protoc-gen-go/main.go: Cannot open: File exists Error: /usr/bin/tar: ../../../go/pkg/mod/google.golang.org/protobuf@v1.28.0/cmd/protoc-gen-go/testdata/imports/fmt/m.pb.go: Cannot open: File exists

brian-doherty commented 2 months ago

And here is the final error:

Running [/home/runner/go/bin/golangci-lint run --out-format=github-actions --timeout=5m] in [] ... Error: File is not gofmt-ed with -s (gofmt)

Error: issues found Ran golangci-lint in 3437ms

sentriz commented 2 months ago

yeah it always prints those errors not sure why. I think you just need to rum gofmt

brian-doherty commented 2 months ago

Excuse my ignorance, but run gofmt where?

sentriz commented 2 months ago

try $ gofmt -w scanner/scanner.go

brian-doherty commented 2 months ago

That did it! Thanks!

sentriz commented 2 months ago

thanks!