This repository has been archived by the owner on Mar 16, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
53 lines (41 loc) · 2.24 KB
/
config.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import datetime
import os
def set_defaults(self):
# TMDB API key
self.config["tmdb_api_key"] = os.environ['TMDB_API_KEY']
# TMDB poster image size. Other options can be obtained by quering https://developers.themoviedb.org/3/configuration/get-api-configuration
self.config["tmdb_image_type"] = "w300"
# Connection details for Elasticsearch
self.config["es_host"] = ["127.0.0.1"]
self.config["es_port"] = 9200
self.config["es_scheme"] = "http"
# Leave as empty strings if no authentication is required
self.config["es_username"] = ""
self.config["es_password"] = ""
# Prefix to use when naming indexes
self.config["index_prefix"] = "tmdb"
# Min score to consider result from elasticsearch accurate enough and no search to TMDB is required
self.config["min_score_no_search"] = 40
# Min score to consider result correct
self.config["min_score"] = 20
# Min score when doing an exact match query
self.config["min_score_exact"] = 7
# Increase score by increment for every member of cast present in search criteria
self.config["score_increment_per_actor"] = 4
# Year difference to allow between given movie year and the returned one
self.config["year_diff"] = 1
# Aspect ratio of poster image to use
self.config["image_aspect_ratio"] = 0.6666
# ISO code for language to get details with
self.config["main_language"] = "en"
# Details of movies whose original language are in this language are fetched in the original language and not in the main_language
self.config["exception_language"] = "it"
# Title translated in these languages will be stored as aliases
self.config["languages"] = ["en", "de", "it", "es", "fr", "pl", "hu", "xx", "cs", "nl"]
# Title as released in these countries will be stored as aliases
self.config["countries"] = ["UK", "GB", "US", "IT", "ES", "DE", "FR", "PL", "HU", "CZ", "NL", "BE"]
# Disable extra logging generated by elasticsearch and requests modules
self.config["extra_logging"] = False
# Update record if older then the specified number of days or older then a specified date
self.config["refresh_after_days"] = 90
self.config["refresh_if_older"] = datetime.datetime.strptime("2020-01-01", "%Y-%m-%d")