Skip to content

Commit

Permalink
add(workflows): added labeler and PR template
Browse files Browse the repository at this point in the history
  • Loading branch information
zakkarry committed Nov 18, 2023
1 parent c0afcab commit 26062b9
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 14 deletions.
17 changes: 17 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Pull Request

## Purpose

<!-- Please provide a detailed description of why you created this pull request. -->

## Approach

<!-- If this pull request is created to solve an issue, please explain how this change addresses the problem. -->

## Open Questions and Pre-Merge TODOs

<!-- - [ ] Use GitHub checklists. When solved, check the box and explain the answer. -->

## Notes

<!-- Add additional notes or comments if you have any worth mentioning -->
10 changes: 10 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"documentation":
- "README.md"
"config":
- "config.py"
"*arr":
- "api/arr.py"
"trakt":
- "api/trakt.py"
"base":
- "retraktarr.py"
14 changes: 14 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Label Pull Requests

on: [pull_request_target, push]

jobs:
triage:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
with:
sync-labels: true
2 changes: 1 addition & 1 deletion api/arr.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def get_list(self, args, arr):

# if its monitored, add to arr ids
if args.mon:
arr_ids = [item for item in arr_data if arr_data[item][1]]
arr_ids = [key for key, value in arr_data.items() if value[1]]

# get the current filtered arr_ids that qualify for the specified quality profile
if args.qualityprofile:
Expand Down
7 changes: 5 additions & 2 deletions api/trakt.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,10 @@ def post_trakt(self, path, post_json, args, media_type, timeout):
# http error parsing
if "401" in str(error) or "403" in str(error):
print(
"Trakt.tv Error: You likely have a bad OAuth2 Token, username, or ClientID/API key.\n"
"Please check your config, revalidate with the oauth2 command, and try again."
"Trakt.tv Error: You likely have a bad OAuth2 Token, "
"username, or ClientID/API key.\n"
"Please check your config, revalidate with the oauth2 "
"command, and try again."
)
sys.exit(1)
elif "420" in str(error):
Expand Down Expand Up @@ -334,6 +336,7 @@ def del_from_list(
else:
for item in filtered_extra_imdb_ids:
trakt_del[media_type].append({"ids": {"imdb": item}})

# if filtered is less is 0 or wipe, set needed_ids to all
# build a json to delete everything (in case of wipe)
# we wont run delete if the list is empty anyway...
Expand Down
4 changes: 2 additions & 2 deletions retraktarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
path.join(path.dirname(path.abspath(__file__)), "VERSION"), encoding="utf-8"
) as f:
VERSION = f.read()
except Exception:
except OSError as e:
VERSION = "MISSING"


Expand Down Expand Up @@ -113,7 +113,7 @@ def main():

if args.version:
print(f"reTraktarr v{VERSION}")
exit(0)
sys.exit(0)

config = Configuration("config.conf")
if args.oauth:
Expand Down
20 changes: 11 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,22 @@
from distutils.core import setup
from setuptools import find_packages

"""
setup file for package publishing
"""
# User-friendly description from README.md
current_directory = os.path.dirname(os.path.abspath(__file__))
try:
with open(os.path.join(current_directory, "README.md"), encoding="utf-8") as f:
long_description = f.read()
except Exception:
long_description = ""
LONG_DESCRIPTION = f.read()
except OSError as e:
LONG_DESCRIPTION = ""

try:
with open(os.path.join(current_directory, "VERSION"), encoding="utf-8") as f:
version_no = f.read()
except Exception as e:
print(e)
version_no = "a"
VERSION_NO = f.read()
except OSError as e:
VERSION_NO = ""

setup(
# Name of the package
Expand All @@ -27,12 +29,12 @@
# help.github.com / articles / licensing - a -
# repository. For example: MIT
license="MIT",
version=version_no,
version=VERSION_NO,
# Short description of your library
description=("a simple Arr -> Trakt.tv list sync script"),
# Long description of your library
install_requires="requests",
long_description=long_description,
long_description=LONG_DESCRIPTION,
long_description_content_type="text/markdown",
# long_description=long_description,
# long_description_content_type="text/markdown",
Expand Down

0 comments on commit 26062b9

Please sign in to comment.