Skip to content

Commit

Permalink
add(config): .gitattributes and .editorconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
zakkarry committed Nov 23, 2023
1 parent 805a3dc commit ab975c3
Show file tree
Hide file tree
Showing 8 changed files with 116 additions and 92 deletions.
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.editorconfig export-ignore
.gitattributes export-ignore
.gitignore export-ignore
.github export-ignore
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
*.pdf
*.jpg
*.png
MANIFEST
*.pdf
*.jpg
*.png
16 changes: 8 additions & 8 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -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*
38 changes: 19 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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.
Expand Down Expand Up @@ -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 <sec>` 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 <sec>` 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)

Expand Down
2 changes: 1 addition & 1 deletion retraktarr/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from .retraktarr import main
from .retraktarr import main
4 changes: 2 additions & 2 deletions retraktarr/api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from .arr import ArrAPI
from .trakt import TraktAPI
from .arr import ArrAPI
from .trakt import TraktAPI
116 changes: 58 additions & 58 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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="[email protected]",
# 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="[email protected]",
# 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"]},
)

0 comments on commit ab975c3

Please sign in to comment.