Skip to content

Instantly share code, notes, and snippets.

@Artiume
Forked from oddstr13/Readme.md
Created May 14, 2020 21:42
Show Gist options
  • Select an option

  • Save Artiume/07e64b0065e1a3cc3ecfd0ac3711b051 to your computer and use it in GitHub Desktop.

Select an option

Save Artiume/07e64b0065e1a3cc3ecfd0ac3711b051 to your computer and use it in GitHub Desktop.

Revisions

  1. @oddstr13 oddstr13 revised this gist May 14, 2020. 2 changed files with 15 additions and 1 deletion.
    1 change: 0 additions & 1 deletion ! Jellyfin Plugin Tools
    Original file line number Diff line number Diff line change
    @@ -1 +0,0 @@
    .
    15 changes: 15 additions & 0 deletions Readme.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    Put these scripts in a separate directory — I've got them in `~/Projects/Jellyfin/Plugins/`.

    `pull_all.py` grabs all repositories from the Jellyfin Org. with the name prefix of `jellyfin-plugin-`.

    `build_all.sh` runs `dotnet` clean & publish (release build) on them all.

    `issues.sh` and `pullrequests.sh` lists the issues and pullrequests of the repos if any.

    ### Dependencies ###
    - .NET core
    - `git`
    - `hub` (The GitHub commandline client)
    - Python 3
    - `requests` (Python library)

  2. @oddstr13 oddstr13 renamed this gist May 14, 2020. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. @oddstr13 oddstr13 revised this gist May 14, 2020. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions Jellyfin Plugin Tools
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    .
  4. @oddstr13 oddstr13 revised this gist May 14, 2020. 4 changed files with 31 additions and 0 deletions.
    7 changes: 7 additions & 0 deletions build_all.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    for plugin in $(find . -maxdepth 1 -mindepth 1 -type d); do
    pushd $plugin > /dev/null
    basename $plugin
    dotnet clean > /dev/null
    dotnet publish --configuration Release --output bin
    popd > /dev/null
    done
    12 changes: 12 additions & 0 deletions issues.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    for plugin in $(find . -maxdepth 1 -mindepth 1 -type d); do
    pushd $plugin > /dev/null
    data=$(hub issue --format='%sC%>(8)%i%Creset %t% l%n%Cblue% U%Creset%n' --color=always)

    if [ ! -z "$data" ]; then
    basename $plugin
    echo "${data}"
    echo
    fi

    popd > /dev/null
    done
    File renamed without changes.
    12 changes: 12 additions & 0 deletions pullrequests.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    for plugin in $(find . -maxdepth 1 -mindepth 1 -type d); do
    pushd $plugin > /dev/null
    data=$(hub pr list --format='%pC%>(8)%i%Creset %t% l%n%Cblue% U%Creset%n' --color=always)

    if [ ! -z "$data" ]; then
    basename $plugin
    echo "${data}"
    echo
    fi

    popd > /dev/null
    done
  5. @oddstr13 oddstr13 revised this gist May 14, 2020. No changes.
  6. @oddstr13 oddstr13 created this gist Mar 25, 2020.
    29 changes: 29 additions & 0 deletions jellyfin-clone-all-plugin-repos.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,29 @@
    #!/usr/bin/env python3
    import os
    import subprocess
    import requests

    resp = requests.get('https://api.github.com/orgs/jellyfin/repos?per_page=100')

    repos = resp.json()

    #print(repos)


    for repo in repos:
    _name = repo.get('name')
    description = repo.get('description')
    url = repo.get('clone_url')
    if _name.startswith('jellyfin-plugin-'):
    print('-----')
    print(_name)
    print(description)
    print(url)

    if not os.path.exists(_name):
    subprocess.run(['git', 'clone', url], check=True)
    subprocess.run(['git', 'remote', 'rename', 'origin', 'upstream'], cwd=_name, check=True)

    subprocess.run(['git', 'checkout', 'master'], cwd=_name, check=True)
    subprocess.run(['git', 'fetch', '--all'], cwd=_name, check=True)
    subprocess.run(['git', 'pull', 'upstream', 'master', '--ff-only'], cwd=_name, check=True)