6 Commits

Author SHA1 Message Date
ff02993a0a Merge branch 'master' into code-cleanup
All checks were successful
Build only (for PRs) / build-only (pull_request) Successful in 4m52s
2026-03-09 11:05:10 -04:00
52337254b6 bugfix: handle lack of separate audio/video streams
All checks were successful
Build only (for PRs) / build-only (pull_request) Successful in 3m47s
2026-03-09 10:58:56 -04:00
a44bb1bf34 optimize codebase
All checks were successful
Build only (for PRs) / build-only (pull_request) Successful in 3m33s
main.go:
- Eliminated ~160 lines of duplicate code: Extracted 3 new helper functions at the bottom of the file:
buildVideoMenuOptions([]VideoOption) — builds the Discord select menu options for video formats
buildAudioMenuOptions([]AudioOption) — same for audio
fetchAndShowFormats(s, i, url) — fetches formats, sorts them, builds menus, stores state, and edits the interaction; previously duplicated identically in both the download and download video command handlers
- Fixed time.Sleep ordering bug: The startAsyncDownload goroutine was launched before InteractionRespond with a 100ms sleep to compensate. Now the download is launched after InteractionRespond returns — no sleep needed. Removed "time" import.
- Used helpers in video_select handler: The two inline menu-building loops in that handler now call buildAudioMenuOptions / buildVideoMenuOptions

misc.go:
- Moved regexp.MustCompile(...) to a package-level var urlPattern — previously it recompiled the regex on every call to extractURLFromString
- Simplified the function body to a single return line
2026-03-09 10:46:10 -04:00
51e1cc5e85 Merge pull request 'chore(deps): update module github.com/lrstanley/go-ytdlp to v1.3.3' (#47) from renovate/github.com-lrstanley-go-ytdlp-1.x into master
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 5m31s
Build and Push Docker Image / deploy-on-green (push) Successful in 8s
Reviewed-on: #47
2026-03-08 15:55:17 +00:00
d3e6ddebcd remove my fork after my changes were merged upstream
All checks were successful
Build only (for PRs) / build-only (pull_request) Successful in 4m27s
2026-03-08 11:50:09 -04:00
558f95ad9d chore(deps): update module github.com/lrstanley/go-ytdlp to v1.3.3
All checks were successful
Build only (for PRs) / build-only (pull_request) Successful in 6m37s
2026-03-08 07:01:17 +00:00

Diff Content Not Available