-
Notifications
You must be signed in to change notification settings - Fork 113
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 #209 from Taxel/main
- Loading branch information
Showing
31 changed files
with
1,120 additions
and
508 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,7 @@ | ||
# https://docs.docker.com/engine/reference/builder/#dockerignore-file | ||
/* | ||
!/*.py | ||
!/Pipfile | ||
!/Pipfile.lock | ||
!/config.default.json | ||
!/plex_trakt_sync/*.py |
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,54 @@ | ||
# Contributing to PlexTraktSync | ||
|
||
We love your input! We want to make contributing to this project as easy and transparent as possible, whether it's: | ||
|
||
- Reporting a bug | ||
- Discussing the current state of the code | ||
- Submitting a fix | ||
- Proposing new features | ||
- Becoming a maintainer | ||
|
||
## We Develop with GitHub | ||
|
||
We use GitHub to host code, to track issues and feature requests, as well as accept pull requests. | ||
|
||
## We Use [GitHub Flow], So All Code Changes Happen Through Pull Requests | ||
|
||
Pull requests are the best way to propose changes to the codebase (we use [GitHub Flow]). We actively welcome your pull requests: | ||
|
||
1. Fork the repo and create your branch from `master`. | ||
2. If you've added code that should be tested, add tests. | ||
3. If you've changed APIs, update the documentation. | ||
4. Ensure the test suite passes. | ||
5. Make sure your code lints. | ||
6. Issue that pull request! | ||
|
||
[GitHub Flow]: https://guides.github.com/introduction/flow/index.html | ||
|
||
## Any contributions you make will be under the MIT Software License | ||
|
||
In short, when you submit code changes, your submissions will be understood | ||
under the same [MIT License] that covers the project. | ||
|
||
Feel free to contact the maintainers if that's a concern. | ||
|
||
[MIT License]: http://choosealicense.com/licenses/mit/ | ||
|
||
## Report bugs using GitHub's [issues] | ||
|
||
We use GitHub issues to track public bugs. Report a bug by [opening a new issue]; it's that easy! | ||
|
||
[issues]: https://github.com/Taxel/PlexTraktSync/issues | ||
[opening a new issue]: https://github.com/Taxel/PlexTraktSync/issues/new | ||
|
||
## License | ||
|
||
By contributing, you agree that your contributions will be licensed under its MIT License. | ||
|
||
## References | ||
|
||
This document was adapted from [@briandk gist] which itself was adapted from | ||
the open-source contribution guidelines for [Facebook's Draft]. | ||
|
||
[@briandk gist]: https://gist.github.com/briandk/3d2e8b3ec8daf5a27a62 | ||
[Facebook's Draft]: https://github.com/facebook/draft-js/blob/a9316a723f9e918afde44dea68b5f9f39b7d9b00/CONTRIBUTING.md |
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,12 @@ | ||
FROM python:3.9-alpine3.13 AS base | ||
|
||
WORKDIR /app | ||
ENTRYPOINT ["/app/main.py"] | ||
|
||
# Install app depedencies | ||
RUN pip install pipenv | ||
COPY Pipfile* ./ | ||
RUN pipenv install --system --deploy | ||
|
||
# Copy rest of the app | ||
COPY . . |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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,6 +1,6 @@ | ||
#!/usr/bin/env python3 | ||
|
||
from plex_trakt_sync.main import main | ||
from plex_trakt_sync.cli import cli | ||
|
||
if __name__ == "__main__": | ||
main() | ||
cli() |
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,3 +1,6 @@ | ||
#!/bin/sh | ||
PATH=/usr/local/bin:/usr/local/sbin:~/bin:/usr/bin:/bin:/usr/sbin:/sbin | ||
python3 ./main.py | ||
set -eu | ||
|
||
dir=$(dirname "$0") | ||
|
||
exec python3 "$dir/main.py" "$@" |
This file was deleted.
Oops, something went wrong.
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,19 @@ | ||
import click | ||
from plex_trakt_sync.commands.clear_collections import clear_collections | ||
from plex_trakt_sync.commands.sync import sync | ||
from plex_trakt_sync.commands.watch import watch | ||
|
||
|
||
@click.group(invoke_without_command=True) | ||
@click.pass_context | ||
def cli(ctx): | ||
""" | ||
Plex-Trakt-Sync is a two-way-sync between trakt.tv and Plex Media Server | ||
""" | ||
if not ctx.invoked_subcommand: | ||
sync() | ||
|
||
|
||
cli.add_command(sync) | ||
cli.add_command(clear_collections) | ||
cli.add_command(watch) |
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,28 @@ | ||
import click | ||
from plex_trakt_sync.logging import logger | ||
from plex_trakt_sync.trakt_api import TraktApi | ||
|
||
|
||
@click.command() | ||
@click.option('--confirm', is_flag=True, help='Confirm the dangerous action') | ||
@click.option('--dry-run', is_flag=True, help='Do not perform delete actions') | ||
def clear_collections(confirm, dry_run): | ||
""" | ||
Clear Movies and Shows collections in Trakt | ||
""" | ||
|
||
if not confirm and not dry_run: | ||
click.echo('You need to pass --confirm or --dry-run option to proceed') | ||
return | ||
|
||
trakt = TraktApi() | ||
|
||
for movie in trakt.movie_collection: | ||
logger.info(f"Deleting: {movie}") | ||
if not dry_run: | ||
trakt.remove_from_library(movie) | ||
|
||
for show in trakt.show_collection: | ||
logger.info(f"Deleting: {show}") | ||
if not dry_run: | ||
trakt.remove_from_library(show) |
Oops, something went wrong.