diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..a46c09e --- /dev/null +++ b/.editorconfig @@ -0,0 +1,20 @@ +; This file is for unifying the coding style for different editors and IDEs. +; More information at http://editorconfig.org + +; top-most EditorConfig file +root = true + +# Unix-style newlines with a newline ending every file +[*] +charset = utf-8 +indent_style = space +indent_size = 4 +end_of_line = LF +insert_final_newline = true +trim_trailing_whitespace = true + +[*.md] +trim_trailing_whitespace = false + +[VERSION] +insert_final_newline = false diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..cb2e95d --- /dev/null +++ b/.gitattributes @@ -0,0 +1,4 @@ +.editorconfig export-ignore +.gitattributes export-ignore +.gitignore export-ignore +.github export-ignore diff --git a/.gitignore b/.gitignore index 121b32b..6bfbfcc 100644 --- a/.gitignore +++ b/.gitignore @@ -46,7 +46,7 @@ share/python-wheels/ *.egg-info/ .installed.cfg *.egg -MANIFEST -*.pdf -*.jpg -*.png +MANIFEST +*.pdf +*.jpg +*.png diff --git a/MANIFEST.in b/MANIFEST.in index 7bc5771..babc429 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,8 +1,8 @@ -include retraktarr/VERSION -include README.md -include LICENSE -include *.py -include *.txt -include MANIFEST.in -exclude *.conf -exclude .git* +include retraktarr/VERSION +include README.md +include LICENSE +include *.py +include *.txt +include MANIFEST.in +exclude *.conf +exclude .git* diff --git a/README.md b/README.md index 38104ce..386cb4d 100644 --- a/README.md +++ b/README.md @@ -14,18 +14,18 @@ The goal was to add the list to [Radarr](https://radarr.video), set up a filter This use case was admittedly very narrow, and a few more use cases have emerged since. -- Backing up entire Radarr/Sonarr libraries, including movies/shows you do not already have downloaded. For example, if it's missing in Radarr, PlexTraktSync would not help. -- Restoring your library easily by importing an entire (backed up) list (in the case of migrating OSs or catastrophic failures) -- Giving someone the ability to browse media you have (without giving them access to Plex/Jellyfin/Emby) -- Sync multiple instances of Sonarr/Radarr -- _Possibly more I have not considered..._ +- Backing up entire Radarr/Sonarr libraries, including movies/shows you do not already have downloaded. For example, if it's missing in Radarr, PlexTraktSync would not help. +- Restoring your library easily by importing an entire (backed up) list (in the case of migrating OSs or catastrophic failures) +- Giving someone the ability to browse media you have (without giving them access to Plex/Jellyfin/Emby) +- Sync multiple instances of Sonarr/Radarr +- _Possibly more I have not considered..._ ## Requirements -- [Python 3](https://www.python.org/downloads/) (including `requests` module) - - `pip3 install requests` -- [Radarr](https://radarr.video) and/or [Sonarr](https://sonarr.tv) -- A [Trakt.tv](https://www.trakt.tv) account with [API App configured](#trakttv-api-app-setup) +- [Python 3](https://www.python.org/downloads/) (including `requests` module) + - `pip3 install requests` +- [Radarr](https://radarr.video) and/or [Sonarr](https://sonarr.tv) +- A [Trakt.tv](https://www.trakt.tv) account with [API App configured](#trakttv-api-app-setup) ## Arr Support @@ -37,11 +37,11 @@ This use case was admittedly very narrow, and a few more use cases have emerged A [Trakt.tv](https://www.trakt.tv) account with an [API set up](#trakttv-api-app-setup) is obviously necessary. -- 🚨Note: [Trakt.tv](https://www.trakt.tv) lists have limits. You can read their official statement [here](https://twitter.com/trakt/status/1536751362943332352/photo/1)🚨 +- 🚨Note: [Trakt.tv](https://www.trakt.tv) lists have limits. You can read their official statement [here](https://twitter.com/trakt/status/1536751362943332352/photo/1)🚨 1. Head to [Trakt.tv API App Setup Page](https://trakt.tv/oauth/applications) 2. Create a new application, you will only **need** to fill `Name` and `RedirectURI` - - I suggest using `https://google.com` for your redirect URI. We will need to steal a parameter from the redirect to complete the OAuth2 process. + - I suggest using `https://google.com` for your redirect URI. We will need to steal a parameter from the redirect to complete the OAuth2 process. 3. After creating the application, click on it and you will see your `Client ID`, `Client Secret`, and an `Authorize` button. 4. Click `Authorize`. Click `Yes`. You will be redirected to Google (or your URI) and in the URL bar you will see `?code=` followed by 64 alphanumeric characters. **Save this for now. This is your OAuth2 Authorization code.** 5. You can now complete the OAuth2 process when you're ready using the `retraktarr` script. @@ -89,14 +89,14 @@ options: ## Troubleshooting -- If you are having problems with old entries not being removed, feel free to use the -wipe command in addition, it will delete the entire **contents** of the list **without** deleting the list itself, and resync. -- If you want to sync multiple "filters" (tag, profile, etc) to one list, consider running multiple times with your filter arguments and the additional -cat parameter. -- Privacy can only be set when the list is first created, specifying privacy on an already created list will do nothing. -- Unless a list is specified using `-list` - when you use `-all` or `-r -s` - each Arr will sync to the list specified in the config.conf file. -- Using filtered syncs with `-all` is not recommended, consider chaining multiple runs. -- Syncing an instance will only remove non-syncing media in its associated type. If you have a list with movies and TV added and run a Sonarr sync to it, it will only remove **SHOWS** that are not present in the sync. (excludes usage of -cat) -- If you repeatedly get the same movies reporting deleted, but not deleting, this is almost certainly due to an outdated ID (usually TMDB) being associated with the movie on Trakt. Report it and give them the correct link. If after it's updated it does not fix it, create an issue with details. -- If you're getting timeouts during runs, particularly during `--wipe` or large list processing, use the `--timeout ` command. Default is 30, increase it until you're list is processed completely. +- If you are having problems with old entries not being removed, feel free to use the -wipe command in addition, it will delete the entire **contents** of the list **without** deleting the list itself, and resync. +- If you want to sync multiple "filters" (tag, profile, etc) to one list, consider running multiple times with your filter arguments and the additional -cat parameter. +- Privacy can only be set when the list is first created, specifying privacy on an already created list will do nothing. +- Unless a list is specified using `-list` - when you use `-all` or `-r -s` - each Arr will sync to the list specified in the config.conf file. +- Using filtered syncs with `-all` is not recommended, consider chaining multiple runs. +- Syncing an instance will only remove non-syncing media in its associated type. If you have a list with movies and TV added and run a Sonarr sync to it, it will only remove **SHOWS** that are not present in the sync. (excludes usage of -cat) +- If you repeatedly get the same movies reporting deleted, but not deleting, this is almost certainly due to an outdated ID (usually TMDB) being associated with the movie on Trakt. Report it and give them the correct link. If after it's updated it does not fix it, create an issue with details. +- If you're getting timeouts during runs, particularly during `--wipe` or large list processing, use the `--timeout ` command. Default is 30, increase it until you're list is processed completely. [start a discussion](https://github.com/zakkarry/retraktarr/discussions/new) or [open an issue](https://github.com/zakkarry/retraktarr/issues/new) diff --git a/retraktarr/__init__.py b/retraktarr/__init__.py index 8c4b74e..4726c60 100644 --- a/retraktarr/__init__.py +++ b/retraktarr/__init__.py @@ -1 +1 @@ -from .retraktarr import main +from .retraktarr import main diff --git a/retraktarr/api/__init__.py b/retraktarr/api/__init__.py index f9407ab..7a789b0 100644 --- a/retraktarr/api/__init__.py +++ b/retraktarr/api/__init__.py @@ -1,2 +1,2 @@ -from .arr import ArrAPI -from .trakt import TraktAPI +from .arr import ArrAPI +from .trakt import TraktAPI diff --git a/setup.py b/setup.py index bb376de..e599aba 100644 --- a/setup.py +++ b/setup.py @@ -1,58 +1,58 @@ -import os - -from setuptools import setup, 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 OSError as e: - LONG_DESCRIPTION = "" - -try: - with open( - os.path.join(current_directory, f"retraktarr{os.path.sep}VERSION"), - encoding="utf-8", - ) as f: - VERSION_NO = f.read() -except OSError as e: - VERSION_NO = "" - - -with open("requirements.txt") as reqs_file: - requirements = reqs_file.read().splitlines() - -setup( - # Name of the package - name="retraktarr", - # Start with a small number and increase it with - # every change you make https://semver.org - # Chose a license from here: https: // - # help.github.com / articles / licensing - a - - # repository. For example: MIT - license="MIT", - version=VERSION_NO, - # Short description of your library - description=("a simple Arr -> Trakt.tv list sync script"), - entry_points={"console_scripts": ["retraktarr = retraktarr:main"]}, - # Long description of your library - install_requires=requirements, - long_description=LONG_DESCRIPTION, - long_description_content_type="text/markdown", - # long_description=long_description, - # long_description_content_type="text/markdown", - # Your name - author="zakkarry", - # Your email - author_email="zak@ary.dev", - # Either the link to your github or to your website - url="https://github.com/zakkarry", - # Link from which the project can be downloaded - download_url="https://github.com/zakkarry/retraktarr", - packages=find_packages(exclude=[".github"]), - package_data={"retraktarr": ["VERSION"]}, -) +import os + +from setuptools import setup, 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 OSError as e: + LONG_DESCRIPTION = "" + +try: + with open( + os.path.join(current_directory, f"retraktarr{os.path.sep}VERSION"), + encoding="utf-8", + ) as f: + VERSION_NO = f.read() +except OSError as e: + VERSION_NO = "" + + +with open("requirements.txt") as reqs_file: + requirements = reqs_file.read().splitlines() + +setup( + # Name of the package + name="retraktarr", + # Start with a small number and increase it with + # every change you make https://semver.org + # Chose a license from here: https: // + # help.github.com / articles / licensing - a - + # repository. For example: MIT + license="MIT", + version=VERSION_NO, + # Short description of your library + description=("a simple Arr -> Trakt.tv list sync script"), + entry_points={"console_scripts": ["retraktarr = retraktarr:main"]}, + # Long description of your library + install_requires=requirements, + long_description=LONG_DESCRIPTION, + long_description_content_type="text/markdown", + # long_description=long_description, + # long_description_content_type="text/markdown", + # Your name + author="zakkarry", + # Your email + author_email="zak@ary.dev", + # Either the link to your github or to your website + url="https://github.com/zakkarry", + # Link from which the project can be downloaded + download_url="https://github.com/zakkarry/retraktarr", + packages=find_packages(exclude=[".github"]), + package_data={"retraktarr": ["VERSION"]}, +)