[3] fix small overlay errors

pull/858/head
meisnate12 3 years ago
parent adf2ad2073
commit 7bc9b7f95b

@ -1 +1 @@
1.16.5-develop2 1.16.5-develop3

@ -6,6 +6,8 @@ libraries: # This is called out once within
- file: config/Movies.yml # This is a local file on the system - file: config/Movies.yml # This is a local file on the system
- folder: config/Movies/ # This is a local directory on the system - folder: config/Movies/ # This is a local directory on the system
- git: meisnate12/MovieCharts # This is a file within the GitHub Repository - git: meisnate12/MovieCharts # This is a file within the GitHub Repository
overlay_path:
- file: config/Overlays.yml # This is a local file on the system
TV Shows: TV Shows:
metadata_path: metadata_path:
- file: config/TVShows.yml - file: config/TVShows.yml

@ -1,6 +1,6 @@
# Path Types # Path Types
YAML Files are defined by their path type and path location for the [`metadata_path`](libraries.md#metadata-path), [`playlist_files`](libraries.md#metadata-path), and [`external_templates`](libraries.md#metadata-path) attributes. YAML Files are defined by their path type and path location for the [`metadata_path`](libraries.md#metadata-path), [`overlay_path`](libraries.md#overlay-path), [`playlist_files`](libraries.md#metadata-path), and [`external_templates`](libraries.md#metadata-path) attributes.
They can either be on the local system, online at an url, directly from the [Plex Meta Manager Configs](https://github.com/meisnate12/Plex-Meta-Manager-Configs) repository, or from another [`Custom Repository`](settings.md#custom-repo). They can either be on the local system, online at an url, directly from the [Plex Meta Manager Configs](https://github.com/meisnate12/Plex-Meta-Manager-Configs) repository, or from another [`Custom Repository`](settings.md#custom-repo).

@ -21,7 +21,7 @@ These are the attributes which can be used within the Overlay File:
## Overlay Attributes ## Overlay Attributes
Each overlay requires its own section within the `overalys` attribute. Each overlay requires its own section within the `overlays` attribute.
```yaml ```yaml
overlays: overlays:
@ -107,7 +107,7 @@ overlays:
Dolby: Dolby:
overlay: overlay:
name: Dolby name: Dolby
url: https://somewebsite.com/dobly_overlay.png url: https://somewebsite.com/dolby_overlay.png
plex_all: true plex_all: true
filters: filters:
has_dolby_vision: true has_dolby_vision: true

@ -575,6 +575,14 @@ class Cache:
with closing(connection.cursor()) as cursor: with closing(connection.cursor()) as cursor:
cursor.execute(f"SELECT * FROM image_maps WHERE library = ?", (library,)) cursor.execute(f"SELECT * FROM image_maps WHERE library = ?", (library,))
row = cursor.fetchone() row = cursor.fetchone()
cursor.execute(
f"""CREATE TABLE IF NOT EXISTS {table_name}_overlays (
key INTEGER PRIMARY KEY,
rating_key TEXT UNIQUE,
overlay TEXT,
compare TEXT,
location TEXT)"""
)
if row and row["key"]: if row and row["key"]:
table_name = f"image_map_{row['key']}" table_name = f"image_map_{row['key']}"
else: else:
@ -599,33 +607,8 @@ class Cache:
compare TEXT, compare TEXT,
location TEXT)""" location TEXT)"""
) )
cursor.execute(
f"""CREATE TABLE IF NOT EXISTS {table_name}_overlays (
key INTEGER PRIMARY KEY,
rating_key TEXT UNIQUE,
overlay TEXT,
compare TEXT,
location TEXT)"""
)
return table_name return table_name
def query_image_map_overlay(self, table_name, overlay):
rks = []
with sqlite3.connect(self.cache_path) as connection:
connection.row_factory = sqlite3.Row
with closing(connection.cursor()) as cursor:
cursor.execute(f"SELECT * FROM {table_name} WHERE overlay = ?", (overlay,))
rows = cursor.fetchall()
for row in rows:
rks.append(int(row["rating_key"]))
return rks
def update_remove_overlay(self, table_name, overlay):
with sqlite3.connect(self.cache_path) as connection:
connection.row_factory = sqlite3.Row
with closing(connection.cursor()) as cursor:
cursor.execute(f"UPDATE {table_name} SET overlay = ? WHERE overlay = ?", ("", overlay))
def query_image_map(self, rating_key, table_name): def query_image_map(self, rating_key, table_name):
with sqlite3.connect(self.cache_path) as connection: with sqlite3.connect(self.cache_path) as connection:
connection.row_factory = sqlite3.Row connection.row_factory = sqlite3.Row

Loading…
Cancel
Save