diff --git a/.editorconfig b/.editorconfig index a8ced1c..e4eee1d 100644 --- a/.editorconfig +++ b/.editorconfig @@ -11,5 +11,8 @@ insert_final_newline = false [{Makefile}] indent_style = tab -[{*.html,*.js,*.json,*.css}] +[*.html,*.js,*.json,*.css] +indent_size = 2 + +[*.yml] indent_size = 2 \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml new file mode 100644 index 0000000..a619c89 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -0,0 +1,93 @@ +name: "Bug Report" +title: "bug: " +description: Create a bug report for us to fix. +labels: ["bug"] + +body: + - type: markdown + attributes: + value: | + ### Notice + - If you want to suggest a new feature, use the **Feature Request** template. + - Write your issue in clear and understandable English. + - type: textarea + id: description + attributes: + label: "Bug Description" + description: "A clear and detailed description of what the bug is." + placeholder: "Explain your problem as clearly and in detail as possible." + validations: + required: true + - type: textarea + id: how-to-reproduce + attributes: + label: How to Reproduce + description: "Steps to reproduce the behavior and what should be observed in the end." + placeholder: "Tell us step by step how we can replicate your problem and what we should see in the end." + value: | + Steps to reproduce the behavior: + 1. Go to '....' + 2. Click on '....' + 3. Do '....' + 4. See '....' + validations: + required: true + - type: textarea + id: expected-behavior + attributes: + label: Expected Behavior + description: "A clear and detailed description of what you think should happen." + placeholder: "Tell us what the app should normally do." + validations: + required: true + - type: input + id: version + attributes: + label: "Version" + description: "Some bugs may be fixed in future releases, so we have to know which version you're running." + placeholder: "Write your open-in-mpv version. (v2.0.0, v2.1.0...)" + validations: + required: true + - type: textarea + id: snippet + attributes: + label: "Configuration" + description: "For some issues, we may need to take a look at the configuration you're running." + placeholder: "Share your configuration." + render: yml + value: | + players: + mpv: + name: mpv + executable: mpv + fullscreen: "--fs" + pip: "--ontop --no-border --autofit=384x216 --geometry=98\\%:98\\%" + needs_ipc: true + flag_overrides: {} + validations: + required: true + - type: textarea + id: logs + attributes: + label: Relevant log output (optional) + description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks. + render: sh + - type: dropdown + id: browsers + attributes: + label: What browsers are you seeing the problem on? (optional) + multiple: true + options: + - Firefox-based (Librewolf, Iceraven, etc.) + - Chromium-based (Brave, Chrome, etc.) + - Other (please specify in the description above) + - type: checkboxes + id: terms + attributes: + label: "Checklist:" + description: "By submitting this issue, you confirm that:" + options: + - label: "I have checked for existing issues that describe my problem prior to opening this one." + required: true + - label: "I understand that improperly formatted bug reports may be closed without explanation." + required: true \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..ec4bb38 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1 @@ +blank_issues_enabled: false \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml new file mode 100644 index 0000000..d0659cd --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -0,0 +1,51 @@ +name: "Feature Request" +title: "feature: " +description: Suggest an idea to improve this project. +labels: ["enhancement"] + +body: + - type: markdown + attributes: + value: | + ### Notice + - If you think this is just a bug, use the **Bug Report** template. + - Write your issue in clear and understandable English. + - type: textarea + id: description + attributes: + label: "Feature Description" + description: "A clear and detailed description of the new feature." + placeholder: "Explain the feature you're suggesting as clearly and in detail as possible." + validations: + required: true + - type: textarea + id: additional-context + attributes: + label: "Additional Context (optional)" + description: "If you have something else to add, write it here." + placeholder: "Anything goes." + - type: textarea + id: snippet + attributes: + label: "Code Snippet (optional)" + description: "A code snippet may help to describe a feature." + placeholder: "Share some code to explain the feature better." + render: Go + value: | + package main + import "log" + + func main() { + // An example to describe the feature + log.Println("Hello world!") + } + - type: checkboxes + id: terms + attributes: + label: "Checklist:" + description: "By submitting this issue, you confirm that:" + options: + - label: "I have checked for existing issues that describe my suggestion prior to opening this one." + required: true + - label: "I understand that improperly formatted feature requests may be closed without explanation." + required: true \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/question.yml b/.github/ISSUE_TEMPLATE/question.yml new file mode 100644 index 0000000..99cc63c --- /dev/null +++ b/.github/ISSUE_TEMPLATE/question.yml @@ -0,0 +1,46 @@ +name: "Question" +title: "question: " +description: Ask a question if something isn't clear to you. +labels: ["question"] + +body: + - type: markdown + attributes: + value: | + ### Notice + - If you think this is just a bug, use the **Bug Report** template. + - If you want to suggest a new feature, use the **Feature Request** template. + - Write your issue in clear and understandable English. + - type: textarea + id: description + attributes: + label: "Question Description" + description: "A clear and detailed description of the question." + placeholder: "Explain your question as clearly and in detail as possible." + validations: + required: true + - type: textarea + id: snippet + attributes: + label: "Code Snippet (optional)" + description: "A code snippet may help to describe a feature." + placeholder: "Share a code to explain the feature better." + render: Go + value: | + package main + import "log" + + func main() { + // An example to describe the feature + log.Println("Hello world!") + } + - type: checkboxes + id: terms + attributes: + label: "Checklist:" + description: "By submitting this issue, you confirm that:" + options: + - label: "I have checked for existing issues that describe my questions prior to opening this one." + required: true + - label: "I understand that improperly formatted questions may be closed without explanation." + required: true \ No newline at end of file diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..169511b --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,29 @@ +## Description + +- Please include a summary of the change and which issue is fixed +- Please also include relevant motivation and context +- List any dependencies that are required for this change +- Explain the *details* for making this change. What existing problem does the pull request solve? + +You can delete this line and the bullet points above, and use this space to describe the PR in detail. + +## Type of change + +Please delete options which are not relevant. + +- [ ] Bug fix (**non-breaking** change which fixes an issue) +- [ ] New feature (**non-breaking** change which adds functionality) +- [ ] **Breaking** change (fix or feature that would cause existing functionality to not work as expected) +- [ ] This change requires a documentation update + +## Checklist + +- Code quality: + - [ ] I have performed a self-review of my own code + - [ ] I have commented my code, particularly in hard-to-understand areas +- Tests: + - [ ] I have added tests that prove my fix is effective or that my feature works + - [ ] New and existing unit tests pass locally with my changes +- Other: + - [ ] I have made corresponding changes to the documentation and/or `README.md` + - [ ] If new dependencies exist, I have checked that they are really necessary and agreed with the maintainers/community (we want to have as few dependencies as possible) \ No newline at end of file diff --git a/README.md b/README.md index f041e23..6da4244 100644 --- a/README.md +++ b/README.md @@ -30,9 +30,13 @@ $ make install-protocol ### Configuration The configuration file has to be named `config.yml` and can be placed in the same folder as the executable or in: -- Windows: `C:\Users\\AppData\Roaming\open-in-mpv\` -- Linux: `~/.config/open-in-mpv/` -- Mac: `~/Library/Application Support/open-in-mpv/` + +| | Windows | Linux/BSDs | MacOS | | +| -------------------------- | ---------------------------------- | ------------------------------ | -------------------------------------------------- | - | +| System level configuration | `C:\ProgramData\open-in-mpv\` | `/etc/xdg/open-in-mpv/` | `/Library/Application Support/open-in-mpv/` | | +| User level configuration | `C:\Users\\AppData\Roaming\` | `${HOME}/.config/open-in-mpv/` | `${HOME}/Library/Application Support/open-in-mpv/` | | + +The user level configuration will always override the system level one. The configuration file has the following structure: diff --git a/config.go b/config.go index cbd6b02..7ef63a4 100644 --- a/config.go +++ b/config.go @@ -89,6 +89,7 @@ func LoadConfig() error { player.SupportedSchemes = defaultSupportedSchemas defaultConfig.Players[name] = player } + // TODO: restrict/escape custom flags } return nil diff --git a/config.yml b/config.yml index 3306361..e0d208c 100644 --- a/config.yml +++ b/config.yml @@ -1,4 +1,3 @@ ---- players: mpv: name: mpv diff --git a/scripts/Info.plist b/scripts/Info.plist index e00356d..f4979e7 100644 --- a/scripts/Info.plist +++ b/scripts/Info.plist @@ -27,7 +27,9 @@ CFBundleURLName - open-in-mpv wrapper + open-in-mpv + CFBundleTypeRole + Viewer CFBundleURLSchemes mpv