<commit_before>{ stdenv, buildPythonApplication, fetchFromGitHub, callPackage
, mpv, python-mpv-jsonipc, jellyfin-apiclient-python
, pillow, tkinter, pystray, jinja2, pywebview }:

let
  shaderPack = callPackage ./shader-pack.nix {};
in
buildPythonApplication rec {
  pname = "jellyfin-mpv-shim";
  version = "1.7.1";

  src = fetchFromGitHub {
    owner = "iwalton3";
    repo = pname;
    rev = "v${version}";
    sha256 = "0alrh5h3f8pq9mrq09jmpqa0yslxsjqwij6kwn24ggbwc10zkq75";
    fetchSubmodules = true; # needed for display_mirror css file
  };

  patches = [
    ./disable-desktop-client.patch
    ./disable-update-check.patch
  ];

  # override $HOME directory:
  #   error: [Errno 13] Permission denied: '/homeless-shelter'
  #
  # remove jellyfin_mpv_shim/win_utils.py:
  #   ModuleNotFoundError: No module named 'win32gui'
  preCheck = ''
    export HOME=$TMPDIR

    rm jellyfin_mpv_shim/win_utils.py
  '';

  postPatch = ''
    # link the default shader pack
    ln -s ${shaderPack} jellyfin_mpv_shim/default_shader_pack
  '';

  propagatedBuildInputs = [
    jellyfin-apiclient-python
    mpv
    pillow
    python-mpv-jsonipc

    # gui dependencies
    pystray
    tkinter

    # display_mirror dependencies
    jinja2
    pywebview
  ];

  meta = with stdenv.lib; {
    homepage = "https://github.com/iwalton3/jellyfin-mpv-shim";
    description = "Allows casting of videos to MPV via the jellyfin mobile and web app";
    license = licenses.gpl3;<commit_msg>jellyfin-mpv-shim: Disable tests<commit_after>{ stdenv, buildPythonApplication, fetchFromGitHub, callPackage
, mpv, python-mpv-jsonipc, jellyfin-apiclient-python
, pillow, tkinter, pystray, jinja2, pywebview }:

let
  shaderPack = callPackage ./shader-pack.nix {};
in
buildPythonApplication rec {
  pname = "jellyfin-mpv-shim";
  version = "1.7.1";

  src = fetchFromGitHub {
    owner = "iwalton3";
    repo = pname;
    rev = "v${version}";
    sha256 = "0alrh5h3f8pq9mrq09jmpqa0yslxsjqwij6kwn24ggbwc10zkq75";
    fetchSubmodules = true; # needed for display_mirror css file
  };

  patches = [
    ./disable-desktop-client.patch
    ./disable-update-check.patch
  ];

  # override $HOME directory:
  #   error: [Errno 13] Permission denied: '/homeless-shelter'
  #
  # remove jellyfin_mpv_shim/win_utils.py:
  #   ModuleNotFoundError: No module named 'win32gui'
  preCheck = ''
    export HOME=$TMPDIR

    rm jellyfin_mpv_shim/win_utils.py
  '';

  postPatch = ''
    # link the default shader pack
    ln -s ${shaderPack} jellyfin_mpv_shim/default_shader_pack
  '';

  propagatedBuildInputs = [
    jellyfin-apiclient-python
    mpv
    pillow
    python-mpv-jsonipc

    # gui dependencies
    pystray
    tkinter

    # display_mirror dependencies
    jinja2
    pywebview
  ];

  # no tests
  doCheck = false;
  pythonImportsCheck = [ "jellyfin_mpv_shim" ];

  meta = with stdenv.lib; {
    homepage = "https://github.com/iwalton3/jellyfin-mpv-shim";
    description = "Allows casting of videos to MPV via the jellyfin mobile and web app";
    license = licenses.gpl3;
{'fraction_non_alphanumeric': 0.10615989515072084, 'fraction_numerical': 0.019659239842726082, 'mean_word_length': 3.330496453900709, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2398533', 'n_tokens_mistral': 1176, 'n_tokens_neox': 1121, 'n_words': 225}