diff --git a/.gitignore b/.gitignore index cd999a0e..d7816905 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,7 @@ config/overlays/*/ config/overlays/temp.jpeg config/overlays/temp.jpg config/overlays/temp.png +config/overlays/temp.webp !config/*.template build/ develop-eggs/ diff --git a/CHANGELOG b/CHANGELOG index 7546112f..8c0ae032 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,18 +3,17 @@ # Removed Features # New Features -Added `overlay_filetype` and `overlay_quality` settings to control the filetype and quality of overlay images. +Added `overlay_filetype` and `overlay_quality` settings to control the filetype and quality of overlay images. Users can select from JPG, PNG and WEBP. # Updates # Defaults Added `starting_only` template variable to the `mal` Collection Default. Changed streaming defaults to use names as their keys vs their TMDb IDs as keys +Fixed `amazon` ID in `streaming` when region is `CA` # Bug Fixes Catch bad ID data from Plex Fixes `- git` file calls -Various other Minor Fixes - -Closed legacy issues on GitHub +Various other Minor Fixes \ No newline at end of file diff --git a/defaults/both/streaming.yml b/defaults/both/streaming.yml index dddb61b8..aa2e69fe 100644 --- a/defaults/both/streaming.yml +++ b/defaults/both/streaming.yml @@ -26,27 +26,33 @@ templates: conditions: - originals_only: false value: <> - discover_with: - conditions: - - originals_only: false - value: <> discover_region: conditions: - originals_only: false value: <> + final_tmdb_key: + default: <> + conditions: + - region: CA + tmdb_key: [9] + value: 119 + discover_with: + conditions: + - originals_only: false + value: <> allowed_streaming: conditions: - originals_only: true - tmdb_key: ["103", "1759", "151", "230", "283", "510", "39", "37", "188"] + tmdb_key: [103, 1759, 151, 230, 283, 510, 39, 37, 188] value: False - region.not: GB - tmdb_key: ["103", "151", "39"] + tmdb_key: [103, 151, 39] value: False - region.not: CA - tmdb_key: ["230"] + tmdb_key: [230] value: False - region: CA - tmdb_key: ["1899", "37"] + tmdb_key: [1899, 37] value: False default: diff --git a/defaults/overlays/streaming.yml b/defaults/overlays/streaming.yml index 8dfb8c59..1b7ee313 100644 --- a/defaults/overlays/streaming.yml +++ b/defaults/overlays/streaming.yml @@ -75,24 +75,30 @@ templates: discover_with: conditions: - originals_only: false - value: <> + value: <> discover_region: conditions: - originals_only: false value: <> + final_tmdb_key: + default: <> + conditions: + - region: CA + tmdb_key: [9] + value: 119 allowed_streaming: conditions: - originals_only: true - tmdb_key: ["103", "1759", "151", "230", "283", "510", "39", "37", "188"] + tmdb_key: [103, 1759, 151, 230, 283, 510, 39, 37, 188] value: False - region.not: GB - tmdb_key: ["103", "151", "39"] + tmdb_key: [103, 151, 39] value: False - region.not: CA - tmdb_key: ["230"] + tmdb_key: [230] value: False - region: CA - tmdb_key: ["1899", "37"] + tmdb_key: [1899, 37] value: False mdblist_list: https://mdblist.com/lists/k0meta/<>-<> tmdb_discover: @@ -103,73 +109,73 @@ templates: overlays: Netflix: - variables: {key: netflix, tmdb_key: "8", weight: 160} + variables: {key: netflix, tmdb_key: 8, weight: 160} template: [name: standard, name: mdb_streaming] Prime: - variables: {key: amazon, tmdb_key: "9", weight: 150} + variables: {key: amazon, tmdb_key: 9, weight: 150} template: [name: standard, name: mdb_streaming] Disney: - variables: {key: disney, tmdb_key: "337", weight: 140} + variables: {key: disney, tmdb_key: 337, weight: 140} template: [name: standard, name: mdb_streaming] Max: - variables: {key: max, tmdb_key: "1899", weight: 130} + variables: {key: max, tmdb_key: 1899, weight: 130} template: [name: standard, name: mdb_streaming] Crunchyroll: - variables: {key: crunchyroll, tmdb_key: "283", weight: 120, allowed_libraries: show} + variables: {key: crunchyroll, tmdb_key: 283, weight: 120, allowed_libraries: show} template: [name: standard, name: mdb_streaming] YouTube: - variables: {key: youtube, tmdb_key: "188", weight: 110} + variables: {key: youtube, tmdb_key: 188, weight: 110} template: [name: standard, name: mdb_streaming] Hulu: - variables: {key: hulu, tmdb_key: "15", weight: 100} + variables: {key: hulu, tmdb_key: 15, weight: 100} template: [name: standard, name: mdb_streaming] Paramount: - variables: {key: paramount, tmdb_key: "531", weight: 90} + variables: {key: paramount, tmdb_key: 531, weight: 90} template: [name: standard, name: mdb_streaming] AppleTV: - variables: {key: appletv, tmdb_key: "350", weight: 80} + variables: {key: appletv, tmdb_key: 350, weight: 80} template: [name: standard, name: mdb_streaming] Peacock: - variables: {key: peacock, tmdb_key: "387", weight: 70} + variables: {key: peacock, tmdb_key: 387, weight: 70} template: [name: standard, name: mdb_streaming] Showtime: - variables: {key: showtime, tmdb_key: "37", weight: 60} + variables: {key: showtime, tmdb_key: 37, weight: 60} template: [name: standard, name: mdb_streaming] discovery+: - variables: {key: discovery, tmdb_key: "510", weight: 58, allowed_libraries: show} + variables: {key: discovery, tmdb_key: 510, weight: 58, allowed_libraries: show} template: [name: standard, name: mdb_streaming] Crave: - variables: {key: crave, tmdb_key: "230", weight: 55} + variables: {key: crave, tmdb_key: 230, weight: 55} template: [name: standard, name: mdb_streaming] NOW: - variables: {key: now, tmdb_key: "39", weight: 50} + variables: {key: now, tmdb_key: 39, weight: 50} template: [name: standard, name: mdb_streaming] All 4: - variables: {key: all4, tmdb_key: "103", weight: 40} + variables: {key: all4, tmdb_key: 103, weight: 40} template: [name: standard, name: mdb_streaming] britbox: - variables: {key: britbox, tmdb_key: "151", weight: 30} + variables: {key: britbox, tmdb_key: 151, weight: 30} template: [name: standard, name: mdb_streaming] BET+: - variables: {key: bet, tmdb_key: "1759", weight: 20} + variables: {key: bet, tmdb_key: 1759, weight: 20} template: [name: standard, name: mdb_streaming] hayu: - variables: {key: hayu, tmdb_key: "223", weight: 10, allowed_libraries: show} + variables: {key: hayu, tmdb_key: 223, weight: 10, allowed_libraries: show} template: [name: standard, name: mdb_streaming] diff --git a/docs/config/settings.md b/docs/config/settings.md index 061839ce..2186f245 100644 --- a/docs/config/settings.md +++ b/docs/config/settings.md @@ -1002,20 +1002,22 @@ The available setting attributes which can be set at each level are outlined bel +
`jpg`Use JPG files for saving Overlays
`png`Use PNG files for saving Overlays
`webp`Use WEBP files for saving Overlays
**Default Value:** `jpg` ???+ example "Example" + ```yaml ```yaml settings: overlay_filetype: png ``` -??? blank "`overlay_quality` - Used to control the JPG quality used with overlay images." +??? blank "`overlay_quality` - Used to control the JPG or WEBP quality used with overlay images." -
Used to control the JPG quality used with overlay images. +
Used to control the JPG or WEBP quality used with overlay images.
diff --git a/json-schema/config-schema.json b/json-schema/config-schema.json index c39d4aac..7a903e22 100644 --- a/json-schema/config-schema.json +++ b/json-schema/config-schema.json @@ -898,10 +898,10 @@ }, "overlay_filetype": { "description": "Used to control the filetype used with overlay images.", - "enum": ["jpg", "png"] + "enum": ["jpg", "png", "webp"] }, "overlay_quality": { - "description": "Used to control the JPG quality used with overlay images.", + "description": "Used to control the JPG or WEBP quality used with overlay images.", "type": "integer", "minimum": 1, "maximum": 100 diff --git a/modules/config.py b/modules/config.py index d1fbedfc..104363a8 100644 --- a/modules/config.py +++ b/modules/config.py @@ -43,7 +43,8 @@ run_order_options = { sync_modes = {"append": "Only Add Items to the Collection or Playlist", "sync": "Add & Remove Items from the Collection or Playlist"} filetype_list = { "jpg": "Use JPG files for saving Overlays", - "png": "Use PNG files for saving Overlays" + "png": "Use PNG files for saving Overlays", + "webp": "Use WEBP files for saving Overlays" } imdb_label_options = { "remove": "Remove All IMDb Parental Labels", diff --git a/modules/overlays.py b/modules/overlays.py index cb42c048..0b383ef4 100644 --- a/modules/overlays.py +++ b/modules/overlays.py @@ -61,7 +61,8 @@ class Overlays: logger.ghost(f"Restoring: {i}/{len(remove_overlays)} {item_title}") self.remove_overlay(item, item_title, "Overlay", [ os.path.join(self.library.overlay_backup, f"{item.ratingKey}.png"), - os.path.join(self.library.overlay_backup, f"{item.ratingKey}.jpg") + os.path.join(self.library.overlay_backup, f"{item.ratingKey}.jpg"), + os.path.join(self.library.overlay_backup, f"{item.ratingKey}.webp") ]) logger.exorcise() else: @@ -176,11 +177,15 @@ class Overlays: os.remove(os.path.join(self.library.overlay_backup, f"{item.ratingKey}.png")) if os.path.exists(os.path.join(self.library.overlay_backup, f"{item.ratingKey}.jpg")): os.remove(os.path.join(self.library.overlay_backup, f"{item.ratingKey}.jpg")) + if os.path.exists(os.path.join(self.library.overlay_backup, f"{item.ratingKey}.webp")): + os.remove(os.path.join(self.library.overlay_backup, f"{item.ratingKey}.webp")) elif has_overlay: if os.path.exists(os.path.join(self.library.overlay_backup, f"{item.ratingKey}.png")): has_original = os.path.join(self.library.overlay_backup, f"{item.ratingKey}.png") elif os.path.exists(os.path.join(self.library.overlay_backup, f"{item.ratingKey}.jpg")): has_original = os.path.join(self.library.overlay_backup, f"{item.ratingKey}.jpg") + elif os.path.exists(os.path.join(self.library.overlay_backup, f"{item.ratingKey}.webp")): + has_original = os.path.join(self.library.overlay_backup, f"{item.ratingKey}.webp") if self.library.reset_overlays: reset_list = self.library.reset_overlays elif has_original is None and not self.library.reset_overlays: @@ -508,7 +513,7 @@ class Overlays: overlay_box = current_overlay.get_coordinates((canvas_width, canvas_height), box=current_overlay.image.size, new_cords=cord) new_poster.paste(current_overlay.image, overlay_box, current_overlay.image) temp = os.path.join(self.library.overlay_folder, f"temp.{self.library.overlay_filetype}") - if self.library.overlay_filetype == "jpg" and self.library.overlay_quality: + if self.library.overlay_quality and self.library.overlay_filetype in ["jpg", "webp"]: new_poster.save(temp, exif=exif_tags, quality=self.library.overlay_quality) else: new_poster.save(temp, exif=exif_tags) diff --git a/modules/plex.py b/modules/plex.py index c8341071..53cb138c 100644 --- a/modules/plex.py +++ b/modules/plex.py @@ -1350,7 +1350,7 @@ class Plex(Library): elif self.show_missing_assets: logger.warning(f"Asset Warning: No poster or background found in the assets folder '{item_dir}'") else: - logger.warning(f"Asset Warning: {name} has an Overlay and will be updated when overlays are run") + logger.info(f"Item: {name} has an Overlay and will be updated when overlays are run") except Failed as e: if self.show_missing_assets: logger.warning(e)