- Poetry installation documentation
- open the terminal in the project directory
- execute
poetry install
to install the dependencies - execute
poetry run compile-messages
to install other languages - execute
poetry run generate-test-data
to generate the test data for the unittests - execute
poetry run plexutils
to run the script
To create a config.yaml file you can simply copy or rename the example-config.yaml
file
to config.yaml
and adjust the settings to your needs.
language: de_DE
de_DE
german (germany)de_AT
german (tyrol)en_US
english
libraries:
- name: Movies
type: movie
lang:
dub: de_DE
sub: de_DE
path: /.../movies
- name: TV Shows
type: tvshow
lang:
dub: de_DE
sub: de_DE
path: /.../tvshows
Under the libraries
key you can define your plex libraries. Each library has the following keys:
name
(required): The name of the librarytype
(required): The type of the library. Possible values aremovie
andtvshow
path
(required): The path to the librarylang
(optional): The language settings for the library. Each library has the following keys:dub
(optional): The default isen_US
. The language of the dubbingsub
(optional): The language of the subtitles
To get the TVDB credentials you need to create an account on thetvdb.com and create a new API key and pin.
tvdb:
api_key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
api_pin: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Under the tvdb
key you can define your TVDB credentials:
api_key
(required): The API keyapi_pin
(required): The API pin
- open the terminal in the project directory
- execute
poetry run generate-docs
to generate the documentation with sphinx
- validate movie filename syntax
- validate tvshow directory syntax
- validate season directory syntax
- validate episode filename syntax
- search in tvdb for new seasons of existing tvshows
- search in tvdb for missing episodes of existing seasons of existing tvshows
- install
xgettext
- create the
messages.pot
file- (unix)
find . -iname "*.py" | xargs xgettext -o messages.pot
- (unix)
- rename the
messages.pot
file toplexutils.po
- move
plexutils.po
tolocale/xx_XX/LC_MESSAGES/
- execute
msgfmt locale/xx_XX/LC_MESSAGES/plexutils.po -o locale/xx_XX/LC_MESSAGES/plexutils.mo
- change the language in the config.yaml
- DONE!
- install babel if not installed (
pip install Babel
) - create
babel.cfg
with[python: **.py]
as its content - open Command Prompt (cmd) and navigate to your project directory. Run:
pybabel extract -F babel.cfg -o messages.pot .
- run the following command, replacing
xx_XX
with your language code (e.g.,de_DE
for German):pybabel init -i messages.pot -d locale -l xx_XX
- open the generated .po file in
locale/xx_XX/LC_MESSAGES/
directory with a text editor and translate the messages into your desired language - rename the
messages.pot
file toplexutils.po
- compile the .po file to a .mo file:
Execute:
pybabel compile -d locale
- Open
config.yaml
in a text editor and update the language setting (e.g.,language: de_DE
) - DONE!