Skip to content

feat(storage): add WebDAV provider support#649

Open
obeone wants to merge 7 commits into
dutchcoders:mainfrom
obeone:main
Open

feat(storage): add WebDAV provider support#649
obeone wants to merge 7 commits into
dutchcoders:mainfrom
obeone:main

Conversation

@obeone
Copy link
Copy Markdown

@obeone obeone commented Jun 3, 2025

  • Add WebDAV storage backend using github.com/studio-b12/gowebdav
  • Update CLI flags and environment variables for WebDAV configuration
  • Document new provider and its usage in README
  • Update workflow GitHub Actions versions
  • Add gowebdav dependency to go.mod and go.sum

(I updated the release workflow because upload-artifact@v2 wasn't exist anymore)

@francescayeye
Copy link
Copy Markdown
Collaborator

@obeone , thank you very much for this!

i'll review as soon as possible

@francescayeye
Copy link
Copy Markdown
Collaborator

@obeone , sorry for the very late feedback. indeed i reviewed your PR immediately and from what I remember the only main concern from my side it's that I just prefer if you use a different webdav library.

under x/net there's https://pkg.go.dev/golang.org/x/net/webdav

I was going to tell you I could migrate to that library, if you had no willing to do the effort in your PR, please let me know :)

Copy link
Copy Markdown
Collaborator

@francescayeye francescayeye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see also the comment in the PR conversation about the webdav library change, please

Comment thread server/storage/webdav.go
// Type returns the storage type
func (s *WebDAVStorage) Type() string { return "webdav" }

func (s *WebDAVStorage) fullPath(token, filename string) string {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks an helper that could be moved outside of the specific storage implementation, if we don't have already one somewhere.
could you please do?

Comment thread server/storage/webdav.go
func (s *WebDAVStorage) Head(_ context.Context, token, filename string) (uint64, error) {
fi, err := s.client.Stat(s.fullPath(token, filename))
if err != nil {
if s.logger != nil {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't do this kind of logging (unfortunately, I can admit) throughout all the project. if you want extra information for the user could you please wrap with en error with your specific message instead?
feel free to open a new PR reviewing the whole logging mechanism ;)

Comment thread server/storage/webdav.go
var rc io.ReadCloser
var err error
if rng != nil {
rc, err = s.client.ReadStreamRange(p, int64(rng.Start), int64(rng.Limit))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

have you tested this on playing a video or audio media with scrobbling?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants