Skip to content

Commit 782dbee

Browse files
committed
mac/menu: pre-fill mpv and system information when creating an issue
when opening a new issue from the menu bar when can easily pre-fill the mpv and system information since they are easily available in our code.
1 parent 593194c commit 782dbee

File tree

2 files changed

+40
-1
lines changed

2 files changed

+40
-1
lines changed

osdep/mac/info_helper.swift

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,40 @@
1616
*/
1717

1818
class InfoHelper {
19+
static var version: String {
20+
return """
21+
\(mpvVersion) \(mpvCopyright)
22+
23+
""" +
24+
(mpvBuilddate == "UNKNOWN" ? "" : " built on \(mpvBuilddate)\n") +
25+
"""
26+
libplacebo version: \(libplaceboVersion)
27+
FFmpeg version: \(ffmpegVersion)
28+
FFmpeg library versions:
29+
libavcodec \(libavcodecVersion)
30+
31+
""" +
32+
(libavdeviceVersion == nil ? "" : " libavdevice \(libavdeviceVersion ?? "")\n") +
33+
"""
34+
libavfilter \(libavfilterVersion)
35+
libavformat \(libavformatVersion)
36+
libavutil \(libavutilVersion)
37+
libswresample \(libswresampleVersion)
38+
libswscale \(libswscaleVersion)
39+
"""
40+
}
41+
42+
static var system: String {
43+
return """
44+
- macOS version: \(systemVersion)
45+
- Source of mpv:
46+
- Latest known working version:
47+
- Issue started after the following happened:
48+
"""
49+
}
50+
51+
static var systemVersion: String { return ProcessInfo.processInfo.operatingSystemVersionString.replacing("Version ", with: "") }
52+
1953
static var mpvVersion: String { return String(cString: swift_mpv_version) }
2054
static var mpvCopyright: String { return String(cString: swift_mpv_copyright) }
2155
static var mpvBuilddate: String { return String(cString: swift_mpv_builddate) }

osdep/mac/menu_bar.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,12 @@ class MenuBar: NSObject, EventSubscriber {
238238
Config(name: "Release Notes…", action: #selector(url(_:)), target: self, url: "https://github.com/mpv-player/mpv/blob/master/RELEASE_NOTES"),
239239
Config(name: "Keyboard Shortcuts…", action: #selector(url(_:)), target: self, url: "https://github.com/mpv-player/mpv/blob/master/etc/input.conf"),
240240
Config(type: .separator),
241-
Config(name: "Report Issue…", action: #selector(url(_:)), target: self, url: "https://github.com/mpv-player/mpv/issues/new/choose")
241+
Config(name: "Report Issue…", action: #selector(url(_:)),
242+
target: self,
243+
url: "https://github.com/mpv-player/mpv/issues/new?template=2_bug_report_macos.yml" +
244+
"&mpv_info=" + (InfoHelper.version.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed) ?? "") +
245+
"&other_info=" + (InfoHelper.system.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed) ?? "")
246+
)
242247
]
243248
if AppHub.shared.isBundle {
244249
helpMenuConfigs += [

0 commit comments

Comments
 (0)