homebrew-core icon indicating copy to clipboard operation
homebrew-core copied to clipboard

media-control 0.2.0 (new formula)

Open ungive opened this issue 10 months ago • 1 comments

  • [x] Have you followed the guidelines for contributing?
  • [x] Have you ensured that your commits follow the commit style guide?
  • [x] Have you checked that there aren't other open pull requests for the same formula update/change?
  • [x] Have you built your formula locally with HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>, where <formula> is the name of the formula you're submitting?
  • [x] Is your test running fine brew test <formula>, where <formula> is the name of the formula you're submitting?
  • [x] Does your build pass brew audit --strict <formula> (after doing HOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>)?
  • [ ] If this is a new formula, does it pass brew audit --new <formula>?

I've just created this tool within the last couple of days, but regarding the "notability threshold" (Acceptable Casks), I think my tool may qualify to fall under the following exception:

A piece of software that was recently released to great fanfare—everyone is talking about it on Twitter and Hacker News and we’ve even gotten multiple premature submissions for it. That’d be a clear case of an app that will reach the threshold in no time so that’s a PR we won’t close immediately (but may wait to merge).

While the tool is located at ungive/media-control, the projected started over at ungive/mediaremote-adapter.

Since macOS 15.4 media control and media detection has been broken by Apple and formulas like nowplaying-cli no longer work: https://github.com/kirtan-shah/nowplaying-cli/issues/28

This is because Apple has added entitlement checks for the use of the MediaRemote private framework which makes it impossible to directly use it in an application. You can still use it indirectly by loading it in a separate process that passes these new entitlement checks, which is e.g. the case with /usr/bin/perl. That's exactly what media-control does and what mediaremote-adapter implements (which is the main component of this formula, media-control is just a small wrapper script written in Perl).

To my knowledge I'm the first person to discover this workaround and people got very excited when I shared the news:

  • https://github.com/vincentneo/LosslessSwitcher/issues/161#issuecomment-2974745096
  • https://github.com/aviwad/LyricFever/issues/94#issuecomment-2974751942
  • https://github.com/kirtan-shah/nowplaying-cli/issues/28#issuecomment-2976239982
  • 16 stars since I published the repository 3 days ago: https://github.com/ungive/mediaremote-adapter/stargazers
    Date of publishment: https://github.com/ungive/mediaremote-adapter/commit/1af927ff4c2ba0cb2b6b1a5d9535ecd28b14e02b
  • So far one fork exists which turned the whole thing into a Swift package: https://github.com/ungive/mediaremote-adapter/forks (https://github.com/ejbills/mediaremote-adapter)

On a side note, the mediaremote-adapter library that media-control uses is also used by and bundled with in the recently merged music-presence cask, albeit an older version: https://github.com/Homebrew/homebrew-cask/pull/216446

I hope this insight helps in deciding whether merging is a viable option for you.

ungive avatar Jun 19 '25 02:06 ungive

Thanks for contributing to Homebrew! :tada: It looks like you're having trouble with a CI failure. See our contribution guide for help. You may be most interested in the section on dealing with CI failures. You can find the CI logs in the Checks tab of your pull request.

github-actions[bot] avatar Jun 19 '25 02:06 github-actions[bot]

I've released a new version, v0.4.0. I would integrate it into this PR, but I don't want to interrupt the review process, in case the version is relevant for that. Let me know though, if I can just go ahead and update the PR anyway, that might save you another pull request later (in case this PR is even accepted).

Changes since making this PR:

  • media-control: https://github.com/ungive/media-control/compare/v0.2.0..v0.4.0
  • mediaremote-adapter (submodule): https://github.com/ungive/mediaremote-adapter/compare/v0.2.0..v0.4.0

ungive avatar Jun 19 '25 15:06 ungive

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

github-actions[bot] avatar Jul 27 '25 11:07 github-actions[bot]

I'd love some feedback on this. The repository has 15 stars now, but it's merely a small CLI wrapper around the main project which has 43 stars today: https://github.com/ungive/mediaremote-adapter (see the submodule inclusion in the repository).

ungive avatar Jul 27 '25 13:07 ungive

Thanks @ungive!

chenrui333 avatar Jul 31 '25 11:07 chenrui333

:robot: An automated task has requested bottles to be published to this PR.

[!CAUTION] Please do not push to this PR branch before the bottle commits have been pushed, as this results in a state that is difficult to recover from. If you need to resolve a merge conflict, please use a merge commit. Do not force-push to this PR branch.

github-actions[bot] avatar Jul 31 '25 11:07 github-actions[bot]