Skip to content

Instantly share code, notes, and snippets.

@Artiume
Forked from oddstr13/Readme.md
Created May 14, 2020 21:42
Show Gist options
  • Save Artiume/07e64b0065e1a3cc3ecfd0ac3711b051 to your computer and use it in GitHub Desktop.
Save Artiume/07e64b0065e1a3cc3ecfd0ac3711b051 to your computer and use it in GitHub Desktop.
Jellyfin Plugin Tools

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)
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
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
#!/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)
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment