Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,21 @@ tasks:
- build
test:
cmds:
- go test -coverprofile=coverage.txt ./...
# Workaround for Go 1.25.0 bug: "no such tool covdata" messages cause non-zero exit
# Run tests and check output for actual failures (FAIL lines) vs just covdata warnings
- |
if output=$(go test -coverprofile=coverage.txt ./... 2>&1); then
echo "$output"
else
# Check if it's only covdata errors (no actual FAIL messages)
if echo "$output" | grep -q "^FAIL"; then
echo "$output"
exit 1
else
# Only covdata warnings, tests actually passed
echo "$output"
fi
fi
test-e2e:
cmds:
- task: build
Expand Down
2 changes: 2 additions & 0 deletions cmd/dapp-fm-app/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build dappfm

// dapp-fm-app is a native desktop media player for dapp.fm
// Decryption in Go, media served via Wails asset handler (same origin, no CORS)
package main
Expand Down
2 changes: 2 additions & 0 deletions cmd/dapp-fm/main.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build dappfm

// dapp-fm CLI provides headless media player functionality
// For native desktop app with WebView, use dapp-fm-app instead
package main
Expand Down
2 changes: 2 additions & 0 deletions pkg/player/assets.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// +build dappfm

package player

import (
Expand Down
37 changes: 37 additions & 0 deletions pkg/player/assets_stub.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// +build !dappfm

package player

import (
"embed"
"io/fs"
)

// Assets embeds all frontend files for the media player (except demo track)
// To build with full assets including demo track, use: go build -tags dappfm
//
//go:embed frontend/index.html
//go:embed frontend/wasm_exec.js
//go:embed frontend/stmf.wasm
var assets embed.FS

// Assets returns the embedded filesystem with frontend/ prefix stripped
var Assets fs.FS

func init() {
var err error
Assets, err = fs.Sub(assets, "frontend")
if err != nil {
panic("failed to create sub filesystem: " + err.Error())
}
}

// GetDemoTrack returns an error since demo track is not available in stub build
func GetDemoTrack() ([]byte, error) {
return nil, fs.ErrNotExist
}

// GetIndex returns the main HTML page
func GetIndex() ([]byte, error) {
return fs.ReadFile(Assets, "index.html")
}