Skip to content

Commit

Permalink
Merge pull request #208 from rusq/i206
Browse files Browse the repository at this point in the history
#206 and use external fsadapter package
  • Loading branch information
rusq authored Apr 14, 2023
2 parents b8a369c + c9642d4 commit 57966d8
Show file tree
Hide file tree
Showing 26 changed files with 35 additions and 907 deletions.
6 changes: 5 additions & 1 deletion downloader/downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"github.com/slack-go/slack"
"golang.org/x/time/rate"

"github.com/rusq/slackdump/v2/fsadapter"
"github.com/rusq/fsadapter"
"github.com/rusq/slackdump/v2/internal/network"
"github.com/rusq/slackdump/v2/logger"
)
Expand Down Expand Up @@ -238,6 +238,10 @@ func (c *Client) saveFile(ctx context.Context, dir string, sf *slack.File) (int6
if c.fs == nil {
return 0, ErrNoFS
}
if mode := sf.Mode; mode == "hidden_by_limit" || mode == "external" || sf.IsExternal {
trace.Logf(ctx, "info", "file %q is not downloadable", sf.Name)
return 0, nil
}
filePath := filepath.Join(dir, c.nameFn(sf))

tf, err := os.CreateTemp("", "")
Expand Down
3 changes: 2 additions & 1 deletion downloader/downloader_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"context"
"fmt"

"github.com/rusq/fsadapter"
"github.com/rusq/slackdump/v2/downloader"
"github.com/rusq/slackdump/v2/fsadapter"
"github.com/slack-go/slack"
"golang.org/x/time/rate"
)
Expand Down Expand Up @@ -37,6 +37,7 @@ func ExampleNew_advanced() {
fmt.Println("failed to initialise the file system")
return
}
defer fs.Close()

dl := downloader.New(
client,
Expand Down
2 changes: 1 addition & 1 deletion downloader/downloader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"github.com/stretchr/testify/require"
"golang.org/x/time/rate"

"github.com/rusq/slackdump/v2/fsadapter"
"github.com/rusq/fsadapter"
"github.com/rusq/slackdump/v2/internal/fixtures"
"github.com/rusq/slackdump/v2/internal/mocks/mock_downloader"
)
Expand Down
2 changes: 1 addition & 1 deletion export/expfmt.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package export
import (
"github.com/slack-go/slack"

"github.com/rusq/slackdump/v2/fsadapter"
"github.com/rusq/fsadapter"
"github.com/rusq/slackdump/v2/internal/structures/files/dl"
"github.com/rusq/slackdump/v2/logger"
)
Expand Down
2 changes: 1 addition & 1 deletion export/expfmt_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"fmt"
"testing"

"github.com/rusq/slackdump/v2/fsadapter"
"github.com/rusq/fsadapter"
"github.com/rusq/slackdump/v2/logger"
"github.com/slack-go/slack"
)
Expand Down
2 changes: 1 addition & 1 deletion export/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import (
"path/filepath"
"runtime/trace"

"github.com/rusq/fsadapter"
"github.com/slack-go/slack"

"github.com/rusq/slackdump/v2"
"github.com/rusq/slackdump/v2/fsadapter"
"github.com/rusq/slackdump/v2/internal/network"
"github.com/rusq/slackdump/v2/internal/structures"
"github.com/rusq/slackdump/v2/internal/structures/files/dl"
Expand Down
2 changes: 1 addition & 1 deletion export/export_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"time"

gomock "github.com/golang/mock/gomock"
"github.com/rusq/fsadapter"
"github.com/rusq/slackdump/v2"
"github.com/rusq/slackdump/v2/fsadapter"
"github.com/rusq/slackdump/v2/internal/fixtures"
"github.com/rusq/slackdump/v2/internal/mocks/mock_dl"
"github.com/rusq/slackdump/v2/internal/mocks/mock_fsadapter"
Expand Down
2 changes: 1 addition & 1 deletion export/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"reflect"
"strings"

"github.com/rusq/slackdump/v2/fsadapter"
"github.com/rusq/fsadapter"
"github.com/rusq/slackdump/v2/internal/structures"
"github.com/rusq/slackdump/v2/types"

Expand Down
2 changes: 1 addition & 1 deletion export/index_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package export
import (
"testing"

"github.com/rusq/slackdump/v2/fsadapter"
"github.com/rusq/fsadapter"
"github.com/slack-go/slack"
)

Expand Down
80 changes: 0 additions & 80 deletions fsadapter/directory.go

This file was deleted.

Loading

0 comments on commit 57966d8

Please sign in to comment.