Skip to content

Commit 3a4ba67

Browse files
committed
Tweaks
1 parent ebb4a45 commit 3a4ba67

File tree

5 files changed

+111
-335
lines changed

5 files changed

+111
-335
lines changed

.envrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
layout python3
1+
layout pyenv 3.11.10
22
python -m pip install --upgrade pip
33
python -m pip install -r requirements.txt
44

Kometa/README.md

Lines changed: 21 additions & 142 deletions
Original file line numberDiff line numberDiff line change
@@ -10,148 +10,7 @@ All these scripts use the same `config.yaml` and requirements.
1010

1111
### `config.template.yaml` contents
1212

13-
```yaml
14-
plex_api:
15-
header_identifier: "media-scripts"
16-
timeout: 360
17-
auth_server:
18-
base_url: 'YOUR_PLEX_URL'
19-
token: 'YOUR_PLEX_TOKEN'
20-
log:
21-
backup_count: 3
22-
format: "%(asctime)s %(module)12s:%(lineno)-4s %(levelname)-9s %(message)s"
23-
level: "INFO"
24-
path: "plexapi.log"
25-
rotate_bytes: 512000
26-
show_secrets: 0
27-
skip_verify_ssl: 0
28-
29-
general:
30-
tmdb_key: "TMDB_API_KEY" # https://developers.themoviedb.org/3/getting-started/introduction
31-
tvdb_key: "TVDB_V4_API_KEY" # currently not used; https://thetvdb.com/api-information
32-
delay: 1 # optional delay between items
33-
library_names: Movies,TV Shows,Movies 4K # comma-separated list of libraries to act on
34-
superchat: 0
35-
36-
kometa:
37-
config_dir: /kometa/is/here # location of Kometa config dir as seen by this script
38-
39-
image_download:
40-
what_to_grab:
41-
### collection-related
42-
include_collection_artwork: 1 # should get-all-posters retrieve collection posters?
43-
only_collection_artwork: 0 # should get-all-posters retrieve ONLY collection posters?
44-
only_these_collections: "Bing|Bang|Boing" # only grab artwork for these collections and items in them
45-
46-
### tv-related
47-
seasons: 1 # should get-all-posters retrieve season posters?
48-
episodes: 1 # should get-all-posters retrieve episode posters? [requires GRAB_SEASONS]
49-
50-
### background-related
51-
backgrounds: 1 # should get-all-posters retrieve backgrounds?
52-
artwork: 1 # current background is downloaded with current poster
53-
54-
### quantity-related
55-
only_current: 0 # should get-all-posters retrieve ONLY current artwork?
56-
poster_depth: 20 # grab this many posters [0 grabs all] [ONLY_CURRENT overrides this]
57-
58-
### what-to-keep
59-
keep_junk: 0 # keep files that script would normally delete [incorrect filetypes, mainly]
60-
find_overlaid_images: 0 # check all downloaded images for overlays
61-
retain_overlaid_images: 0 # keep images that have an overlay EXIF tag [this will override the following two]
62-
retain_kometa_overlaid_images: 0 # keep images that have the Kometa overlay EXIF tag
63-
retain_tcm_overlaid_images: 0 # keep images that have the TCM overlay EXIF tag
64-
65-
## where-to-put-it
66-
where_to_put_it:
67-
use_asset_naming: 1 # should grab-all-posters name images to match Kometa's Asset Directory requirements?
68-
use_asset_folders: 1 # should those Kometa-Asset-Directory names use asset folders?
69-
use_asset_subfolders: 0 # create asset folders in subfolders ["Collections", "Other", or [0-9, A-Z]] ]
70-
assets_by_libraries: 1 # should those Kometa-Asset-Directory images be sorted into library folders?
71-
asset_dir: "assets" # top-level directory for those Kometa-Asset-Directory images
72-
# if asset-directory naming is on, the next three are ignored
73-
poster_dir: "extracted_posters" # put downloaded posters here
74-
current_poster_dir: "current_posters" # put downloaded current posters and artwork here
75-
poster_consolidate: 0 # if false, posters are separated into folders by library
76-
77-
## tracking
78-
tracking:
79-
track_urls: 1 # If set to 1, URLS are tracked and won't be downloaded twice
80-
track_completion: 1 # If set to 1, movies/shows are tracked as complete by rating id
81-
track_image_sources: 1 # keep a file containing file names and source URLs
82-
83-
## general
84-
general:
85-
poster_download: 1 # if false, generate a script rather than downloading
86-
folders_only: 0 # Just build out the folder hierarchy; no image downloading
87-
default_years_back: 2 # in absence of a "last run date", grab things added this many years back.
88-
# 0 sets the fallback date to the beginning of time
89-
threaded_downloads: 0 # should downloads be done in the background in threads?
90-
reset_libraries: "Bing,Bang,Boing" # reset "last time" count to the fallback date for these libraries
91-
reset_collections: "Bing,Bang,Boing" # CURRENTLY UNUSED
92-
add_source_exif_comment: 1 # CURRENTLY UNUSED
93-
94-
status:
95-
plex_owner: "yournamehere" # account name of the server owner
96-
target_plex_url: "https://plex.domain2.tld" # As above, the target of apply_all_status
97-
target_plex_token: "PLEX-TOKEN-TWO" # As above, the target of apply_all_status
98-
target_plex_owner: "yournamehere" # As above, the target of apply_all_status
99-
library_map: '{"LIBRARY_ON_PLEX":"LIBRARY_ON_TARGET_PLEX", ...}'
100-
# In apply_all_status, map libraries according to this JSON.
101-
102-
reset_posters:
103-
track_reset_status: 1 # should reset-posters-* keep track of status and pick up where it left off?
104-
clear_reset_status: 0
105-
local_reset_archive: 1 # should reset-posters-tmdb keep a local archive of posters?
106-
override_overlay_status: 0
107-
target_labels: this label, that label # comma-separated list of labels to reset posters on
108-
remove_labels: 0 # attempt to remove the TARGET_LABELs from items after resetting the poster
109-
reset_seasons: 1 # reset-posters-* resets season artwork as well in TV libraries
110-
reset_episodes: 1 # reset-posters-* resets episode artwork as well in TV libraries [requires RESET_SEASONS=True]
111-
retain_reset_status_file: 0 # Don't delete the reset progress file at the end
112-
flush_status_at_start: 0 # Delete the reset progress file at the start instead of reading it
113-
reset_seasons_with_series: 0 # If there isn't a season poster, use the series poster
114-
dry_run: 0 # [currently only works with reset-posters-*]; don't actually do anything, just log
115-
116-
list_item_ids:
117-
include_collection_members: 0
118-
only_collection_members: 0
119-
120-
delete_collection:
121-
keep_collections: "bing,bang" # List of collections to keep
122-
123-
refresh_metadata:
124-
refresh_1970_only: 1 # If 1, only refresh things that have an originally-available date of 1970-01-01
125-
126-
rematch_items:
127-
unmatched_only: 1 # If 1, only rematch things that are currently unmatched
128-
129-
reset_added_at:
130-
adjust_date_futures_only: 0 # Only look at items that show up as added in the future
131-
adjust_date_epoch_only: 1 # Only adjust items that have "originally available" dates of `1970-01-01`
132-
133-
actor:
134-
cast_depth: 20 # how deep to go into the cast for actor collections
135-
top_count: 10 # how many actors to export
136-
job_type: "Actor"
137-
known_for_only: 0 # ignore cast members who are not primarily known as actors
138-
build_collections: 0 # build yaml for Kometa config.yml
139-
num_collections: 20 # this many actors in Kometa yaml
140-
track_gender: 1 # Pay attention to actor gender [as recorded on TMDB]
141-
min_gender_none: 5 # include minimum this many "none" gendered actors in the YAML, if possible
142-
min_gender_female: 5 # include minimum this many "female" gendered actors in the YAML, if possible
143-
min_gender_male: 5 # include minimum this many "male" gendered actors in the YAML, if possible
144-
min_gender_nb: 5 # include minimum this many "non-binary" gendered actors in the YAML, if possible
145-
146-
low_poster_count:
147-
poster_threshold: 10 # how many posters counts as a "low" count?
148-
149-
crew:
150-
depth: 20
151-
count: 100
152-
target_job: Director
153-
show_jobs: 0
154-
```
13+
The `config.yaml` template can be viewed here: [../config.template.yaml](../config.template.yaml).
15514

15615
## Scripts:
15716
1. [clean-overlay-backup.py](#clean-overlay-backuppy) - clean out leftover overlay backup art
@@ -452,6 +311,24 @@ You want to seed a Kometa metadata file with the contents of one or more librari
452311

453312
Here is a basic script to do that.
454313

314+
Script-specific variables in `config.yaml`:
315+
316+
```yaml
317+
metadata:
318+
download_images: false # should the script download files like images and themes
319+
only_first_genre: true # should the script include only the first genre that Plex has assigned to the item?
320+
321+
include_audience_rating: true
322+
include_content_rating: true
323+
# ... rest of fields redacted for space...
324+
```
325+
326+
There has recently been a regression in some PlexAPI code such that for the moment you should leave `download_images: false`
327+
328+
This should be cleared up relatively soon.
329+
330+
You can turn off individual fields with the `include_` flags.
331+
455332
### Usage
456333
1. setup as above
457334
1. Run with `metadata-extractor.py`
@@ -462,6 +339,8 @@ IMPORTANT NOTES:
462339

463340
This script backs up all Kometa-supported metadata [with a few minor exceptions], which includes things you may not have changed. It also includes the "Overlay" label. It backs up this label because it *also* backs up the current art, which might be overlaid. You will probably want to edit or trim this file before using it to restore.
464341

342+
NOTE: This functionality is hobbled currently by the image-downloading issue.
343+
465344
Metadata not backed up:
466345
```
467346
metadata_language Movie, Show

0 commit comments

Comments
 (0)