Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.4.0 Filter/Subfilter Overall, tmdb_director, and tmdb_writer #76

Merged
merged 36 commits into from
Nov 4, 2020
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
656bde3
Merge pull request #5 from mza921/master
meisnate12 Oct 27, 2020
d206f7b
Bump pyyaml from 5.1.2 to 5.3.1
dependabot[bot] Oct 27, 2020
cf43b95
Merge pull request #7 from mza921/master
meisnate12 Oct 28, 2020
1faee56
Merge pull request #6 from meisnate12/dependabot/pip/pyyaml-5.3.1
meisnate12 Oct 28, 2020
cc8e0d5
added method to detail
meisnate12 Oct 28, 2020
7ed0018
combined methods
meisnate12 Oct 28, 2020
51496a7
update trakt_tools
meisnate12 Oct 28, 2020
e6cb027
Merge pull request #8 from mza921/master
meisnate12 Oct 28, 2020
d7d4c68
method rename
meisnate12 Oct 29, 2020
be0a1e1
2.3.0 Revamped Filters and Subfilters
meisnate12 Oct 29, 2020
878a7c3
typo
meisnate12 Oct 29, 2020
392b12e
fixed two errors
meisnate12 Oct 29, 2020
405b6d1
added tmdb_director
meisnate12 Oct 29, 2020
0e2d05f
collection_sort -> collection_order
meisnate12 Oct 30, 2020
5f65bdb
updated CHANGELOG
meisnate12 Oct 30, 2020
9d60c0f
added tmdb_writer
meisnate12 Oct 30, 2020
7b63417
README fix
meisnate12 Oct 30, 2020
22e10a7
README edit
meisnate12 Oct 30, 2020
d79a628
days_from_now -> max_age
meisnate12 Oct 30, 2020
1c19c88
! -> .not
meisnate12 Oct 30, 2020
0827293
check methods first
meisnate12 Oct 30, 2020
47aee95
small fixes
meisnate12 Oct 30, 2020
fe62ae6
Overhaul how the program checks input and .and
meisnate12 Oct 31, 2020
425c881
bug fix
meisnate12 Oct 31, 2020
f741f34
filters->searches subfilters->collection_filters
meisnate12 Nov 1, 2020
d31f169
Bump plexapi from 4.1.2 to 4.2.0
dependabot[bot] Nov 2, 2020
208ffcf
Major Config checks created plex_search
meisnate12 Nov 3, 2020
c57b78b
Merge pull request #9 from meisnate12/dependabot/pip/plexapi-4.2.0
meisnate12 Nov 3, 2020
0b4617b
Bump plexapi from 4.1.2 to 4.2.0
meisnate12 Nov 3, 2020
24a4c7b
README edits
meisnate12 Nov 3, 2020
22ddd65
README fix
meisnate12 Nov 3, 2020
c44982a
typo
meisnate12 Nov 3, 2020
40dba4a
removed decade and fixed bug
meisnate12 Nov 3, 2020
7b14b7a
Merge remote-tracking branch 'upstream/master'
meisnate12 Nov 3, 2020
d53c3c8
decades is back
meisnate12 Nov 4, 2020
b38f082
Merge remote-tracking branch 'upstream/master'
meisnate12 Nov 4, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,19 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.3.0] - 2020-10-30
### Added
- Added `and_filter` to AND filters together instead of OR
- Added additional subfilters and allow for use of `!` with subfilters
- Added `tmdb_director` and `tmdb_writer` which function the same as `tmdb_actor` but for directors and writers

### Changed
- Filters are now listed and have been tested
- Subfilters are now listed and have been tested

### Fixed
- `collection_order` was in the code as `collection_sort`

## [2.2.1] - 2020-10-28
### Added
- CHANGELOG.md
Expand Down
221 changes: 187 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Plex Auto Collections
##### Version 2.2.1
##### Version 2.3.0
Plex Auto Collections is a Python 3 script that works off a configuration file to create/update Plex collections. Collection management with this tool can be automated in a varying degree of customizability. Supports IMDB, TMDb, and Trakt lists as well as built in Plex filters such as actors, genres, year, studio and more.

![https://i.imgur.com/iHAYFIZ.png](https://i.imgur.com/iHAYFIZ.png)
Expand All @@ -11,17 +11,17 @@ Plex Auto Collections is a Python 3 script that works off a configuration file t
2. [Configuration](#configuration)
- [Collections](#collections)
- [List Type](#list-type-collection-attribute)
- [Plex Collection (List Type)](#plex-collection-list-type)
- [Plex Filters (List Type)](#plex-filters-list-type)
- [TMDb Collection (List Type)](#tmdb-collection-list-type)
- [TMDb Actor (List Type)](#tmdb-actor-list-type)
- [TMDb People (List Type)](#tmdb-people-list-type)
- [TMDb List (List Type)](#tmdb-list-list-type)
- [TMDb Movie (List Type)](#tmdb-movie-list-type)
- [TMDb Show (List Type)](#tmdb-show-list-type)
- [TVDb Show (List Type)](#tvdb-show-list-type)
- [IMDb List or Search (List Type)](#imdb-list-or-search-list-type)
- [Trakt List (List Type)](#trakt-list-list-type)
- [Trakt Trending List (List Type)](#trakt-trending-list-list-type)
- [Tautulli List (List Type)](#tautulli-list-list-type)
- [IMDb List or Search (List Type)](#imdb-list-or-search-list-type)
- [Trakt List (List Type)](#trakt-list-list-type)
- [Trakt Trending List (List Type)](#trakt-trending-list-list-type)
- [Tautulli List (List Type)](#tautulli-list-list-type)
- [Subfilters (Collection Attribute)](#subfilters-collection-attribute)
- [Sync Mode (Collection Attribute)](#sync-mode-collection-attribute)
- [Sort Title (Collection Attribute)](#sort-title-collection-attribute)
Expand Down Expand Up @@ -131,7 +131,7 @@ You can find a template config file in [config/config.yml.template](config/confi

## Collections

Each collection is defined by the mapping name which becomes the name of the Plex collection. Additionally, there are three other attributes to set for each collection:
Each collection is defined by the mapping name which becomes the name of the Plex collection. Additionally, there are many different attributes you can set for each collection:
- [List Type (required)](#list-type-collection-attribute)
- [Subfilters (optional)](#subfilters-collection-attribute)
- [Sync Mode (optional)](#sync-mode-collection-attribute)
Expand All @@ -146,10 +146,10 @@ Each collection is defined by the mapping name which becomes the name of the Ple

### List Type (Collection Attribute)

The only required attribute for each collection is the list type. There are eleven different list types to choose from:
- [Plex Collection](#plex-collection-list-type)
The only required attribute for each collection is the list type. There are many different list types to choose from:
meisnate12 marked this conversation as resolved.
Show resolved Hide resolved
- [Plex Filters](#plex-filters-list-type)
- [TMDb Collection](#tmdb-collection-list-type)
- [TMDb Actor](#tmdb-actor-list-type)
- [TMDb People](#tmdb-people-list-type)
- [TMDb List](#tmdb-list-list-type)
- [TMDb Movie](#tmdb-movie-list-type)
- [TMDb Show](#tmdb-show-list-type)
Expand All @@ -160,26 +160,37 @@ The only required attribute for each collection is the list type. There are elev
- [Tautulli List](#tautulli-list-list-type)

Note that most list types supports multiple lists, with the following exceptions:
- Trakt Trending List
- Tautulli List
- Trakt Trending Lists
- Tautulli Lists

#### Plex Collection (List Type)
#### Plex Filters (List Type)

###### Works with Movie and TV Show Libraries

There are a number of built in Plex filters such as actors, genres, year, studio and more. For more filters refer to the [plexapi.video.Movie](https://python-plexapi.readthedocs.io/en/latest/modules/video.html#plexapi.video.Movie) documentation. Not everything has been tested, so results may vary based off the filter.
You can create a collection based on Plex filters using the options below.

#### Filter Options
- `all` (Gets every movie/show in Plex useful with [subfilters](#subfilters-collection-attribute))
- `actor` (Gets every movie with the specified actor) (Movie libraries only)
- `country` (Gets every movie with the specified country) (Movie libraries only)
- `decade` (Gets every movie from the specified year + the 9 that follow i.e. 1990 will get you 1990-1999) (Movie libraries only)
- `director` (Gets every movie with the specified director) (Movie libraries only)
- `genre` (Gets every movie/show with the specified genre)
- `studio` (Gets every movie/show with the specified studio)
- `year` (Gets every movie/show with the specified year)
- `writer` (Gets every movie with the specified writer) (Movie libraries only)

Here's some high-level ideas:

```yaml
collections:
Documentaries:
genres: Documentary
genre: Documentary
```
```yaml
collections:
Dave Chappelle:
actors: Dave Chappelle
actor: Dave Chappelle
```
```yaml
collections:
Expand All @@ -201,6 +212,46 @@ collections:
- 1998
- 1999
```
```yaml
collections:
90s Movies:
decade: 1990
```

In addition you can also use the `!` at the end of any filter except `all` to instead search for everything but what you specified.

```yaml
collections:
No Comedies:
genre!: Comedy
```

Note that the script will `OR` together any high level filters so this:

```yaml
collections:
Dave Chappelle:
actor: Dave Chappelle
genre: Comedy
```

will get you every movie/show with Dave Chappelle as well as every movie that has the Comedy genre tag. To get around this we added the `and_filter` collection level attribute. so the above collection would look like this:

```yaml
collections:
Dave Chappelle:
actor: Dave Chappelle
and_filter:
genre: Comedy
```

This will get you every movie/show with Dave Chappelle that is a Comedy.

Notes:
- You can use any filter listed above in `and_filters` except `all`.
- `and_filters` requires at least one high level filter to work.
- If you have multiple high level filters `and_filters` will `AND` all `and_filters` with each one.
- You cannot use a filter in `and_filters` if its being used as a high level filter (Use [subfilters](#subfilters-collection-attribute) instead)

#### TMDb Collection (List Type)

Expand Down Expand Up @@ -247,11 +298,14 @@ Notes:
- Local posters/backgrounds are loaded over `tmdb_poster`/`tmdb_background` if they exist unless `tmdb_poster`/`tmdb_background` is also specified
- `tmdb_summary` will load unless `summary`,`tmdb_summary`, or `tmdb_biography` is also specified

#### TMDb Actor (List Type)

###### Works with Movie and TV Show Libraries
#### TMDb People (List Type)

Similarly to `tmdb_id`, `tmdb_actor`, `tmdb_director`, `tmdb_writer` can specify [`tmdb_biography`](#summary-collection-attribute) and [`tmdb_profile`](#poster-collection-attribute) of the person's TMDb page ID or URL as well as search Plex using their respective Plex filters all with one attribute.

Similarly to `tmdb_id`, `tmdb_actor` can specify [`tmdb_biography`](#summary-collection-attribute) and [`tmdb_profile`](#poster-collection-attribute) of the actor's TMDb page ID or URL as well as search Plex using the actor filter all with one attribute.
##### TMDb Actor (List Type)

###### Works with Movie and TV Show Libraries

```yaml
collections:
Expand All @@ -265,8 +319,40 @@ collections:
tmdb_actor: https://www.themoviedb.org/person/2157-robin-williams
```

##### TMDb Director (List Type)

###### Works with Movie Libraries

```yaml
collections:
Steven Spielberg:
tmdb_director: 488
```

```yaml
collections:
Steven Spielberg:
tmdb_director: https://www.themoviedb.org/person/488-steven-spielberg
```

##### TMDb Writer (List Type)

###### Works with Movie Libraries

```yaml
collections:
Quentin Tarantino:
tmdb_writer: 138
```

```yaml
collections:
Quentin Tarantino:
tmdb_writer: https://www.themoviedb.org/person/138-quentin-tarantino
```

Notes:
- You can specify more than one `tmdb_actor` but it will pull the summary and poster from only the first one.
- You can specify more than one `tmdb_actor`, `tmdb_director`, or `tmdb_writer` but it will pull the summary and poster from only the first one.
- Local posters are loaded over `tmdb_profile` if they exist unless `tmdb_profile` is also specified
- `tmdb_biography` will load unless `summary`,`tmdb_summary`, or `tmdb_biography` is also specified

Expand Down Expand Up @@ -331,7 +417,7 @@ collections:

###### Works with TV Show Libraries

You can also add individual shows to a collection using `tvdb_show`.
You can also add individual shows to a collection using `tvdb_show` and the show's TVDb ID.

```yaml
collections:
Expand Down Expand Up @@ -436,16 +522,35 @@ Note that if you have multiple movie Libraries or multiple show Libraries Tautul

###### Works with Movie and TV Show Libraries

The next optional attribute for any collection is the `subfilters` key. Subfilters allows for a little more granular selection from a list of movies to add to a collection.

Many `subfilters` are supported such as actors, genres, year, studio and more. For more subfilters refer to the [plexapi.video.Movie](https://python-plexapi.readthedocs.io/en/latest/modules/video.html#plexapi.video.Movie) documentation. Not everything has been tested, so results may vary based off the subfilter. Additionally, subfilters for `audio_language`, `subtitle_language`, and `video_resolution` have been created.

Note that muliple subfilters are supported but a movie must match at least one value from **each** subfilter to be added to a collection. The values for each must match what Plex has including special characters in order to match.
The next optional attribute for any collection is the `subfilters` key. Subfilters allows for additional filters on any List Type not just filters when adding movies/shows to a collection. All subfilters options are listed below.
In addition you can also use the `!` at the end of any standard subfilter to instead match everything that doesn't have the value specified.

#### Standard Subfilter Options
- `actor` (Matches every movie/show with the specified actor)
- `content_rating` (Matches every movie/show with the specified content rating)
- `country` (Matches every movie with the specified country) (Movie libraries only)
- `director` (Matches every movie with the specified director) (Movie libraries only)
- `genre` (Matches every movie/show with the specified genre)
- `studio` (Matches every movie/show with the specified studio)
- `year` (Matches every movie/show with the specified year)
- `writer` (Matches every movie with the specified writer) (Movie libraries only)
- `video_resolution` (Matches every movie with the specified video resolution) (Movie libraries only)
- `audio_language` (Matches every movie with the specified audio language) (Movie libraries only)
- `subtitle_language` (Matches every movie with the specified subtitle language) (Movie libraries only)

#### Special Subfilter options (These options can only take one value each)
- `days_from_now` (Matches any movie/show whos Originally Available date is within the last X days where X is the number you give as the value)
meisnate12 marked this conversation as resolved.
Show resolved Hide resolved
- `year.gte` (Matches any movie/show whos year is greater then or equal to the specified year)
- `year.lte` (Matches any movie/show whos year is less then or equal to the specified year)
- `rating.gte` (Matches any movie/show whos rating is greater then or equal to the specified rating)
- `rating.lte` (Matches any movie/show whos rating is less then or equal to the specified rating)
- `originally_available.gte` (Matches any movie/show whos originally_available is greater then or equal to the specified originally_available) (Date must be in the 10/29/2020 Format)
- `originally_available.lte` (Matches any movie/show whos originally_available is less then or equal to the specified originally_available)(Date must be in the 10/29/2020 Format)

```yaml
collections:
1080p Documentaries:
genres: Documentary
genre: Documentary
summary: A collection of 1080p Documentaries
subfilters:
video_resolution: 1080
Expand All @@ -455,15 +560,49 @@ collections:
Daniel Craig only James Bonds:
imdb_list: https://www.imdb.com/list/ls006405458/
subfilters:
actors: Daniel Craig
actor: Daniel Craig
```
```yaml
collections:
French Romance:
Romantic Comedies:
genre: Romance
subfilters:
audio_language: Français
genre: Comedy
```
```yaml
collections:
9.0 Movies:
all: True
subfilters:
rating.gte: 9
```
```yaml
collections:
Summer 2020 Movies:
all: True
subfilters:
originally_available.gte: 5/1/2020
originally_available.lte: 8/31/2020
```
```yaml
collections:
Movies Released in the Last 180 Days:
all: True
subfilters:
days_from_now: 180
```
```yaml
collections:
Good Adam Sandler Romantic Comedies:
genre: Romance
and_filters:
actor: Adam Sandler
subfilters:
genre: Comedy
rating.gte: 7
```

Note that multiple subfilters are supported but a movie must match at least one value from **each** subfilter to be added to a collection. The values for each must match what Plex has including special characters in order to match.

### Sync Mode (Collection Attribute)
You can specify how collections sync using `sync_mode`. Set it to `append` to only add movies/shows to the collection or set it to `sync` to add movies/shows to the collection and remove movies/shows from a collection.
Expand Down Expand Up @@ -519,7 +658,7 @@ collections:
```yaml
collections:
Dave Chappelle:
actors: Dave Chappelle
actor: Dave Chappelle
tmdb_biography: 4169
```
If you want to use a custom summary:
Expand Down Expand Up @@ -616,7 +755,7 @@ If you want to use the default actor image on TMDb:
```yaml
collections:
Dave Chappelle:
actors: Dave Chappelle
actor: Dave Chappelle
tmdb_biography: 4169
tmdb_profile: 4169
```
Expand Down Expand Up @@ -690,7 +829,21 @@ plex: # Req
sync_mode: append # Opt - Global Sync Mode
```

**This script does not currently support Plex's [new metadata agent / matching](https://forums.plex.tv/t/introducing-the-new-plex-movie-agent/615989)**. Do not "update matching" until the script's dependencies support the new agent (feel free to follow issue #33).
**This script has limited support for Plex's [new metadata agent / matching](https://forums.plex.tv/t/introducing-the-new-plex-movie-agent/615989)**. Do not "update matching" until the script's dependencies support the new agent (feel free to follow issue #33).

Attributes incompatible with Plex's new metadata agent:
- `tmdb_collection`
- `tmdb_id`
- `tmdb_actor`
- `tmdb_director`
- `tmdb_writer`
- `tmdb_list`
- `tmdb_movie`
- `tmdb_show`
- `tvdb_show`
- `imdb_list`
- `trakt_list`
- `trakt_trending`

Note that Plex does not allow a `show` to be added to a `movie` library or vice versa.

Expand Down
Loading