-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from zeroquinc/code-cleanup
chore: cleanup and optimize code readability
- Loading branch information
Showing
7 changed files
with
140 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name-template: 'v$RESOLVED_VERSION' | ||
tag-template: 'v$RESOLVED_VERSION' | ||
categories: | ||
- title: '🚀 Features' | ||
labels: | ||
- 'feature' | ||
- 'enhancement' | ||
- title: '🐛 Bug Fixes' | ||
labels: | ||
- 'fix' | ||
- 'bugfix' | ||
- 'bug' | ||
- title: '🧰 Maintenance' | ||
label: 'chore' | ||
change-template: '- $TITLE @$AUTHOR (#$NUMBER)' | ||
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks. | ||
version-resolver: | ||
major: | ||
labels: | ||
- 'major' | ||
minor: | ||
labels: | ||
- 'minor' | ||
patch: | ||
labels: | ||
- 'patch' | ||
default: patch | ||
template: | | ||
## Changes | ||
$CHANGES |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
name: Label PRs based on PR title | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize] | ||
|
||
jobs: | ||
labelPR: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install GitHub CLI | ||
run: | | ||
curl -OL https://github.com/cli/cli/releases/download/v2.4.0/gh_2.4.0_linux_amd64.deb | ||
sudo dpkg -i gh_2.4.0_linux_amd64.deb | ||
- name: Get PR number | ||
id: pr_number | ||
run: echo "::set-output name=number::${{ github.event.pull_request.number }}" | ||
|
||
- name: Add label | ||
run: | | ||
PR_TITLE="${{ github.event.pull_request.title }}" | ||
if [[ "$PR_TITLE" == fix:* ]]; then | ||
gh pr edit ${{ steps.pr_number.outputs.number }} --add-label "fix" | ||
elif [[ "$PR_TITLE" == feature:* ]]; then | ||
gh pr edit ${{ steps.pr_number.outputs.number }} --add-label "feature" | ||
elif [[ "$PR_TITLE" == chore:* ]]; then | ||
gh pr edit ${{ steps.pr_number.outputs.number }} --add-label "chore" | ||
elif [[ "$PR_TITLE" == enhancement:* ]]; then | ||
gh pr edit ${{ steps.pr_number.outputs.number }} --add-label "enhancement" | ||
fi | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Release Drafter | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request_target: | ||
types: [closed] | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Release Drafter | ||
uses: release-drafter/release-drafter@v6 | ||
with: | ||
config-name: release-drafter.yml | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
from .custom_logger import logger | ||
|
||
""" | ||
This module contains functions related to Letterboxd. | ||
""" | ||
|
||
# Function to get the Letterboxd URL of a media | ||
def get_letterboxd_url(tmdb_id): | ||
""" | ||
Constructs the Letterboxd URL for a given TMDB ID. | ||
Parameters: | ||
- tmdb_id: The Movie Database (TMDB) ID of the media. | ||
Returns: | ||
- The Letterboxd URL string if tmdb_id is provided, else None. | ||
""" | ||
url = f"https://letterboxd.com/tmdb/{tmdb_id}" if tmdb_id else None | ||
logger.debug(f"Letterboxd URL: {url}") | ||
return url |