Skip to content

Commit af7357a

Browse files
committed
updated other changes
1 parent 7c4c61e commit af7357a

File tree

7 files changed

+16
-16
lines changed

7 files changed

+16
-16
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ All notable changes to this project will be documented in this file. For commit
1515
- better support for running with disabled index.
1616
- small indexing behavior tweaks.
1717
- markdown viewer hides sidebar https://github.com/gtsteffaniak/filebrowser/issues/744
18+
- quick download only applies to files
1819

1920
**BugFixes**:
2021
- subtitles filename issue https://github.com/gtsteffaniak/filebrowser/issues/678

_docker/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ COPY --from=ffmpeg [ "/ffmpeg", "/ffprobe", "/usr/local/bin/" ]
2424
ENV FILEBROWSER_FFMPEG_PATH="/usr/local/bin/"
2525
ENV FILEBROWSER_CONFIG="/home/filebrowser/data/config.yaml"
2626
ENV FILEBROWSER_DATABASE="/home/filebrowser/data/database.db"
27-
ENV FILEBROWSER_CONFIG_DOCKER_COMPAT="true"
2827
ENV FILEBROWSER_NO_EMBEDED="true"
2928
ENV PATH="$PATH:/home/filebrowser"
3029
RUN apk --no-cache add ca-certificates mailcap tzdata

_docker/Dockerfile.slim

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ FROM alpine:latest
2121
ENV FILEBROWSER_NO_EMBEDED="true"
2222
ENV FILEBROWSER_CONFIG="/home/filebrowser/data/config.yaml"
2323
ENV FILEBROWSER_DATABASE="/home/filebrowser/data/database.db"
24-
ENV FILEBROWSER_CONFIG_DOCKER_COMPAT="true"
2524
ENV PATH="$PATH:/home/filebrowser"
2625
RUN apk --no-cache add ca-certificates mailcap tzdata
2726
RUN adduser -D -s /bin/true -u 1000 filebrowser

backend/adapters/fs/files/files.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,13 @@ func FileInfoFaster(opts iteminfo.FileOptions) (iteminfo.ExtendedFileInfo, error
4545
var exists bool
4646
err = index.RefreshFileInfo(opts)
4747
if err != nil {
48-
if err == errors.ErrNotIndexed {
48+
if err == errors.ErrNotIndexed && index.Config.DisableIndexing {
4949
info, err = index.GetFsDirInfo(opts.Path)
5050
if err != nil {
5151
return response, err
5252
}
53+
} else {
54+
return response, fmt.Errorf("could not refresh file info: %v", err)
5355
}
5456
} else {
5557
info, exists = index.GetReducedMetadata(opts.Path, opts.IsDir)

backend/cmd/cli.go

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,15 @@ func runCLI() bool {
3636

3737
if configPath == "" {
3838
configPath = os.Getenv("FILEBROWSER_CONFIG")
39-
compatibility := os.Getenv("FILEBROWSER_CONFIG_DOCKER_COMPAT") == "true"
4039
// backwards compatibility in docker, prefer config.yaml if it exists
41-
if configPath != "" && compatibility {
42-
_, err := os.Stat("config.yaml")
43-
if err == nil {
44-
logger.Warning("config.yaml exists, using that instead of FILEBROWSER_CONFIG due to compatibility mode, if you want to use FILEBROWSER_CONFIG, don't mount /home/filebrowser/config.yaml")
45-
configPath = "config.yaml"
40+
if configPath != "" {
41+
_, err := os.Stat(configPath)
42+
if err != nil {
43+
logger.Fatalf("config file %v does not exist, please create it or set the FILEBROWSER_CONFIG environment variable to a valid config file path", configPath)
4644
}
45+
} else {
46+
configPath = "config.yaml"
4747
}
48-
49-
}
50-
51-
if configPath == "" {
52-
configPath = "config.yaml"
5348
}
5449

5550
// Parse global flags (before subcommands)

backend/indexing/indexingFiles.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ func (idx *Index) indexDirectory(adjustedPath string, quick, recursive bool) err
109109

110110
// check if excluded from indexing
111111
hidden := isHidden(dirInfo, idx.Path+adjustedPath)
112-
if !recursive && idx.shouldSkip(true, hidden, adjustedPath) {
112+
if idx.shouldSkip(dirInfo.IsDir(), hidden, adjustedPath) {
113+
logger.Debugf("skipping directory %s due to exclusion rules", adjustedPath)
113114
return errors.ErrNotIndexed
114115
}
115116

@@ -368,6 +369,9 @@ func isHidden(file os.FileInfo, srcPath string) bool {
368369
}
369370

370371
func (idx *Index) shouldSkip(isDir bool, isHidden bool, fullCombined string) bool {
372+
if idx.Config.DisableIndexing {
373+
return true
374+
}
371375
// check inclusions first
372376
if isDir && len(idx.Config.Include.Folders) > 0 {
373377
if !slices.Contains(idx.Config.Include.Folders, fullCombined) {

frontend/src/components/files/ListingItem.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export default {
101101
return state.user.viewMode === "gallery";
102102
},
103103
quickDownloadEnabled() {
104-
return state.user?.quickDownload;
104+
return state.user?.quickDownload && !this.galleryView && !this.isDir;
105105
},
106106
isHiddenNotSelected() {
107107
return !this.isSelected && this.reducedOpacity;

0 commit comments

Comments
 (0)