Skip to content

Commit

Permalink
Merge pull request #431 from meisnate12/develop
Browse files Browse the repository at this point in the history
v1.13.0
  • Loading branch information
meisnate12 committed Nov 17, 2021
2 parents 6413f2c + aae1ae2 commit 0228574
Show file tree
Hide file tree
Showing 31 changed files with 1,691 additions and 1,007 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Docker Develop Release

on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]

jobs:

docker-develop:
runs-on: ubuntu-latest

steps:

- name: Check Out Repo
uses: actions/checkout@v2
with:
ref: develop

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1

- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: ./
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/plex-meta-manager:develop
36 changes: 36 additions & 0 deletions .github/workflows/latest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Docker Latest Release

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:

docker-latest:
runs-on: ubuntu-latest

steps:

- name: Check Out Repo
uses: actions/checkout@v2

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1

- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: ./
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/plex-meta-manager:latest
18 changes: 18 additions & 0 deletions .github/workflows/tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Tag

on:
push:
branches: [ master ]

jobs:
tag-new-versions:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
token: ${{ secrets.PAT }}
fetch-depth: 2
- uses: salsify/action-detect-and-tag-new-version@v1.0.3
with:
version-command: |
cat VERSION
39 changes: 39 additions & 0 deletions .github/workflows/version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Docker Version Release

on:
create:
tags:
- v*

jobs:

docker-develop:
runs-on: ubuntu-latest

steps:

- name: Check Out Repo
uses: actions/checkout@v2

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1

- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}

- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: ./
file: ./Dockerfile
push: true
tags: ${{ secrets.DOCKER_HUB_USERNAME }}/plex-meta-manager:${{ steps.get_version.outputs.VERSION }}
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
# Plex Meta Manager

[![GitHub release (latest by date)](https://img.shields.io/github/v/release/meisnate12/Plex-Meta-Manager?style=plastic)](https://github.com/meisnate12/Plex-Meta-Manager/releases)
[![GitHub commits since latest release (by SemVer)](https://img.shields.io/github/commits-since/meisnate12/plex-meta-manager/latest/develop?label=Number%20of%20Commits%20in%20Develop&style=plastic)](https://github.com/meisnate12/Plex-Meta-Manager/tree/develop)
[![GitHub commits since latest release (by SemVer)](https://img.shields.io/github/commits-since/meisnate12/plex-meta-manager/latest/develop?label=Commits%20in%20Develop&style=plastic)](https://github.com/meisnate12/Plex-Meta-Manager/tree/develop)
[![Docker Image Version (latest semver)](https://img.shields.io/docker/v/meisnate12/plex-meta-manager?label=docker&sort=semver&style=plastic)](https://hub.docker.com/r/meisnate12/plex-meta-manager)
[![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/meisnate12/plex-meta-manager?style=plastic)](https://hub.docker.com/r/meisnate12/plex-meta-manager)
[![Docker Pulls](https://img.shields.io/docker/pulls/meisnate12/plex-meta-manager?style=plastic)](https://hub.docker.com/r/meisnate12/plex-meta-manager)
[![Discord](https://img.shields.io/discord/822460010649878528?label=Discord&style=plastic)](https://discord.gg/TsdpsFYqqm)
[![Sponsor or Donate](https://img.shields.io/badge/-Sponsor_or_Donate-blueviolet?style=plastic)](https://github.com/sponsors/meisnate12)

The original concept for Plex Meta Manager is [Plex Auto Collections](https://github.com/mza921/Plex-Auto-Collections), but this is rewritten from the ground up to be able to include a scheduler, metadata edits, multiple libraries, and logging. Plex Meta Manager is a Python 3 script that can be continuously run using YAML configuration files to update on a schedule the metadata of the movies, shows, and collections in your libraries as well as automatically build collections based on various methods all detailed in the wiki. Some collection examples that the script can automatically build and update daily include Plex Based Searches like actor, genre, or studio collections or Collections based on TMDb, IMDb, Trakt, TVDb, AniDB, or MyAnimeList lists and various other services.

The script can update many metadata fields for movies, shows, collections, seasons, and episodes and can act as a backup if your plex DB goes down. It can even update metadata the plex UI can't like Season Names. If the time is put into the metadata configuration file you can have a way to recreate your library and all its metadata changes with the click of a button.

The script is designed to work with most Metadata agents including the new Plex Movie Agent, New Plex TV Agent, [Hama Anime Agent](https://github.com/ZeroQI/Hama.bundle), and [MyAnimeList Anime Agent](https://github.com/Fribb/MyAnimeList.bundle).
The script works with most Metadata agents including the new Plex Movie Agent, New Plex TV Agent, [Hama Anime Agent](https://github.com/ZeroQI/Hama.bundle), and [MyAnimeList Anime Agent](https://github.com/Fribb/MyAnimeList.bundle).

## Getting Started

Expand All @@ -23,7 +24,7 @@ The script is designed to work with most Metadata agents including the new Plex

## Support

* Before posting on Github about an enhancement, error, or configuration question please visit the [Plex Meta Manager Discord Server](https://discord.gg/TsdpsFYqqm).
* Before posting on GitHub about an enhancement, error, or configuration question please visit the [Plex Meta Manager Discord Server](https://discord.gg/TsdpsFYqqm).
* If you're getting an Error or have an Enhancement post in the [Issues](https://github.com/meisnate12/Plex-Meta-Manager/issues).
* If you have a configuration question post in the [Discussions](https://github.com/meisnate12/Plex-Meta-Manager/discussions).
* To see user submitted Metadata configuration files, and you to even add your own, go to the [Plex Meta Manager Configs](https://github.com/meisnate12/Plex-Meta-Manager-Configs).
Expand Down
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.12.2-develop1115
40 changes: 24 additions & 16 deletions config/config.yml.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,40 @@
libraries: # Library mappings must have a colon (:) placed after them
Movies:
metadata_path:
- file: config/Movies.yml # You have to create this file the other are online
- file: config/Movies.yml # You have to create this file the other is online
- git: meisnate12/MovieCharts
- git: meisnate12/Studios
- git: meisnate12/IMDBGenres
- git: meisnate12/People
TV Shows:
metadata_path:
- file: config/TV Shows.yml # You have to create this file the other are online
- file: config/TV Shows.yml # You have to create this file the other is online
- git: meisnate12/ShowCharts
- git: meisnate12/Networks
Anime:
metadata_path:
- file: config/Anime.yml # You have to create this file the other are online
- file: config/Anime.yml # You have to create this file the other is online
- git: meisnate12/AnimeCharts
settings: # Can be individually specified per library as well
cache: true
cache_expiration: 60
asset_directory: config/assets
asset_folders: true
assets_for_all: false
sync_mode: append
show_unmanaged: true
show_filtered: false
show_missing: true
save_missing: true
run_again_delay: 2
released_missing_only: false
create_asset_folders: false
missing_only_released: false
collection_minimum: 1
delete_below_minimum: true
tvdb_language: eng
webhooks: # Can be individually specified per library as well
error:
run_start:
run_end:
collection_creation:
collection_addition:
collection_removal:
plex: # Can be individually specified per library as well
url: http://192.168.1.12:32400
token: ####################
Expand All @@ -42,10 +50,16 @@ tmdb:
tautulli: # Can be individually specified per library as well
url: http://192.168.1.12:8181
apikey: ################################
omdb:
apikey: ########
notifiarr:
apikey: ####################################
anidb: # Not required for AniDB builders unless you want mature content
username: ######
password: ######
radarr: # Can be individually specified per library as well
url: http://192.168.1.12:7878
token: ################################
version: v3
add: false
root_folder_path: S:/Movies
monitor: true
Expand All @@ -56,7 +70,6 @@ radarr: # Can be individually specified
sonarr: # Can be individually specified per library as well
url: http://192.168.1.12:8989
token: ################################
version: v3
add: false
root_folder_path: "S:/TV Shows"
monitor: all
Expand All @@ -67,8 +80,6 @@ sonarr: # Can be individually specified
tag:
search: false
cutoff_search: false
omdb:
apikey: ########
trakt:
client_id: ################################################################
client_secret: ################################################################
Expand All @@ -88,7 +99,4 @@ mal:
access_token:
token_type:
expires_in:
refresh_token:
anidb: # Optional
username: ######
password: ######
refresh_token:
16 changes: 11 additions & 5 deletions modules/anidb.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,21 @@ def __init__(self, config, params):
if params and not self._login(self.username, self.password).xpath("//li[@class='sub-menu my']/@title"):
raise Failed("AniDB Error: Login failed")

def _request(self, url, language=None, post=None):
if post:
return self.config.post_html(url, post, headers=util.header(language))
def _request(self, url, language=None, data=None):
if self.config.trace_mode:
logger.debug(f"URL: {url}")
if data:
return self.config.post_html(url, data=data, headers=util.header(language))
else:
return self.config.get_html(url, headers=util.header(language))

def _login(self, username, password):
data = {"show": "main", "xuser": username, "xpass": password, "xdoautologin": "on"}
return self._request(urls["login"], post=data)
return self._request(urls["login"], data={
"show": "main",
"xuser": username,
"xpass": password,
"xdoautologin": "on"
})

def _popular(self, language):
response = self._request(urls["popular"], language=language)
Expand Down
5 changes: 5 additions & 0 deletions modules/anilist.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,13 @@ def __init__(self, config):
self.options["Tag Category"][media_tag["category"].lower().replace(" ", "-")] = media_tag["category"]

def _request(self, query, variables, level=1):
if self.config.trace_mode:
logger.debug(f"Query: {query}")
logger.debug(f"Variables: {variables}")
response = self.config.post(base_url, json={"query": query, "variables": variables})
json_obj = response.json()
if self.config.trace_mode:
logger.debug(f"Response: {json_obj}")
if "errors" in json_obj:
if json_obj['errors'][0]['message'] == "Too Many Requests.":
wait_time = int(response.headers["Retry-After"]) if "Retry-After" in response.headers else 0
Expand Down

0 comments on commit 0228574

Please sign in to comment.