From e04cfc31db44dea09e2cae048f746573f6dc06af Mon Sep 17 00:00:00 2001 From: Chaz Larson Date: Mon, 29 Apr 2024 12:52:24 -0500 Subject: [PATCH 1/5] More words about customizing defaults --- docs/defaults/guide.md | 96 ++++++++++++++++++++++++++++++++---------- 1 file changed, 74 insertions(+), 22 deletions(-) diff --git a/docs/defaults/guide.md b/docs/defaults/guide.md index 28329108..9e07063d 100644 --- a/docs/defaults/guide.md +++ b/docs/defaults/guide.md @@ -17,17 +17,9 @@ Special thanks to Magic815 for the overlay image inspiration and base template. Please consider [donating](https://github.com/sponsors/meisnate12) towards the project. -## Collection Defaults - -See the [Collection Defaults](collections.md) Page for more information on the specifics of the Collection Defaults. - -## Overlay Defaults - -See the [Overlay Defaults](overlays.md) Page for more information on the specifics of the Overlay Defaults. - ## Configurations -To run a default KometCollection or Overlay file you can simply add it to your `collection_files` (For Collection Files) +To run a default Kometa Collection or Overlay file you can simply add it to your `collection_files` (For Collection Files) or `overlay_files` (For Overlay Files) using `default` like so: ```yaml @@ -41,16 +33,60 @@ libraries: - default: ratings ``` -## Customizing Configs +## Customizing these defaults + +Configs can be customized using the `template_variables` attribute when calling the file. + +These template variables can be used to customize individual colelctions/overlays or the set as a whole. + +A given default may have variables that are specific to it, and may also leverage a common set of shared template variables. These lists are shown on each default file's wiki page. -Configs can be customized using the `template_variables` attribute when calling the file. These `template_variables` -will be given to every template call in the file which allows them to affect how that file runs. +## Customizing individual components -For collections, this example disables two keys, which will prevent those collections from being created. It also sets -the visibility of one of the keys so that it is visible on the library tab, the server owner's homescreen and shared -user's homescreens (assuming they server owner and/or the shared users have the library pinned to their homescreen) +Each default file uses "keys" to refer to the collections and overlays that it creates, and you can use those keys to modify the behavior of the defaults file. -For overlays, this example changes the ratings overlay to apply to episodes rather than shows. +For, example, the IMDB default creates three collections, each with their own "key": + +| Collection | Key | +|:--------------------|:----------| +| `IMDb Popular` | `popular` | +| `IMDb Top 250` | `top` | +| `IMDb Lowest Rated` | `lowest` | + +You use that key to customize the individual collection or overlay. + +This example disables two keys, which will prevent those collections from being created. It also sets +the visibility of one of the keys [`top`] so that it is visible on the library tab, the server owner's homescreen and shared +user's homescreens (assuming the server owner and/or the shared users have the library pinned to their homescreen) + +It also changes the resolution overlay to skip applying the overlay to 480p movies. + +The template variables in this example happen to be all shared template variables. + +```yaml +libraries: + Movies: + collection_files: + - default: imdb + template_variables: + use_popular: false # turn off the 'popular' key + use_lowest: false # turn off the 'lowest' key + visible_library_top: true # set visibilities for the 'top' key + visible_home_top: true + visible_shared_top: true + overlay_files: + - default: resolution + template_variables: + use_480p: false # turn off the '480p' key +``` + +## Customizing the set as a whole + +In addition to the keys, each default can be customized with other template variables that are not key-specific. + +This example uses a file-specific variable to change the order of all the IMDB chart collections to alphabetical by title and a shared variable to schedule these IMDB collections to be run only on Wednesdays. + +For the overlays, it uses a file-specific variable to disable all the "edition" overlays and a shared variable to align the overlay on the right side of the poster. ```yaml libraries: @@ -63,17 +99,33 @@ libraries: visible_library_top: true visible_home_top: true visible_shared_top: true + collection_order: alpha # file-specific variable sets sort order + schedule: weekly(wednesday) # shared variable sets schedule overlay_files: - - default: ratings + - default: ribbon template_variables: - builder_level: episode + use_480p: false + use_edition: false # file-specific variable hides editions + horizontal_align: right # shared variable sets alignment ``` -Each file has a page on the wiki showing the available `template_variables` for each file. For example the default -`default: ratings` has a page [here](overlays/ratings.md). +All of the default files are customized in this basic fashion. + +**NOTE: this `template_variable` system is specific to the defaults. If and when you start creating your own [collection](../files/collections.md) or [overlay](../files/overlays.md) files, you cannot use this `template_variables` setup unless you specifically write your files to implement it.** + +Each of these default files has a page on the wiki showing its keys, available `template_variables`, and default settings. For example, the default overlay `default: resolution` has a page [here](overlays/resolution.md). + +The shared template variables can be reviewed here for [Collections](collection_variables.md) and [Overlays](overlay_variables.md). These are also linked from each default file's wiki page. + +## Collection Defaults + +See the [Collection Defaults](collections.md) Page for more information on the specifics of the Collection Defaults. + +## Overlay Defaults + +See the [Overlay Defaults](overlays.md) Page for more information on the specifics of the Overlay Defaults. -**In addition to the defined `template_variables` almost all default Collection and Overlay files have access to their -respective [Collection](collection_variables.md)/[Overlay](overlay_variables.md) Shared Variables.** +# Example config using the defaults {% include-markdown "./example.md" From b2658155010c770005dba5a2183cad7f2fac5d35 Mon Sep 17 00:00:00 2001 From: Chaz Larson Date: Mon, 29 Apr 2024 12:53:10 -0500 Subject: [PATCH 2/5] colelctions --- docs/defaults/guide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/defaults/guide.md b/docs/defaults/guide.md index 9e07063d..c261a218 100644 --- a/docs/defaults/guide.md +++ b/docs/defaults/guide.md @@ -37,7 +37,7 @@ libraries: Configs can be customized using the `template_variables` attribute when calling the file. -These template variables can be used to customize individual colelctions/overlays or the set as a whole. +These template variables can be used to customize individual collections/overlays or the set as a whole. A given default may have variables that are specific to it, and may also leverage a common set of shared template variables. These lists are shown on each default file's wiki page. From 18e3d9886f9f46ce2ab5d2190f281f7df20d30a8 Mon Sep 17 00:00:00 2001 From: Chaz Larson Date: Mon, 29 Apr 2024 12:56:38 -0500 Subject: [PATCH 3/5] minor adjustments --- docs/defaults/guide.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/defaults/guide.md b/docs/defaults/guide.md index c261a218..8fc565bc 100644 --- a/docs/defaults/guide.md +++ b/docs/defaults/guide.md @@ -43,7 +43,7 @@ A given default may have variables that are specific to it, and may also leverag ## Customizing individual components -Each default file uses "keys" to refer to the collections and overlays that it creates, and you can use those keys to modify the behavior of the defaults file. +Each default file uses "keys" to refer to the collections and overlays that it creates, and you can use those keys to modify the behavior of individual collections or overlays created by the file. For, example, the IMDB default creates three collections, each with their own "key": @@ -86,7 +86,7 @@ In addition to the keys, each default can be customized with other template vari This example uses a file-specific variable to change the order of all the IMDB chart collections to alphabetical by title and a shared variable to schedule these IMDB collections to be run only on Wednesdays. -For the overlays, it uses a file-specific variable to disable all the "edition" overlays and a shared variable to align the overlay on the right side of the poster. +On the `resolution` overlay, it uses a file-specific variable to disable all the "edition" overlays and a shared variable to align the overlay on the right side of the poster. ```yaml libraries: @@ -115,7 +115,7 @@ All of the default files are customized in this basic fashion. Each of these default files has a page on the wiki showing its keys, available `template_variables`, and default settings. For example, the default overlay `default: resolution` has a page [here](overlays/resolution.md). -The shared template variables can be reviewed here for [Collections](collection_variables.md) and [Overlays](overlay_variables.md). These are also linked from each default file's wiki page. +The shared template variables can be reviewed here for [Collections](collection_variables.md) and [Overlays](overlay_variables.md). These are also linked from each default file's wiki page. Keep in mind that *most*, but not all default files have access to the shared variables. This will be noted on the individual files' page. ## Collection Defaults From f7f4fb68083f3b6db243d177aa706828abfe2dad Mon Sep 17 00:00:00 2001 From: Chaz Larson Date: Mon, 29 Apr 2024 13:24:24 -0500 Subject: [PATCH 4/5] Minor tweaks --- docs/files/templates.md | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/docs/files/templates.md b/docs/files/templates.md index ea2214aa..df187627 100644 --- a/docs/files/templates.md +++ b/docs/files/templates.md @@ -47,9 +47,8 @@ In addition, templates also have a few special attributes that they can use: ??? blank "`default` - Sets what template variables default to." -
The `default` attribute allows default values for template variables to be used if they're not - specified in the call. It's value is a dictionary of key value pairs where the key is the template variable and the - value is the default value to set it to when not provided. +
The `default` attribute allows default values for template variables which will be used if they're not + specified in the call. You need to provide a list of variables and the value that variable should get if not told differently when the template is referenced. See the tooltips below. **A variable cannot be default if it is a conditional variable.** @@ -83,13 +82,13 @@ In addition, templates also have a few special attributes that they can use: 1. This sets the default value of the template variable `my_sync_mode` to `sync`. 2. The value for template variable `my_sync_mode` will replace `<>` here. - 3. This specifiys that `my_sync_mode` for this definition will be `append`. + 3. This specifies that `my_sync_mode` for this definition will be `append`. 4. Since `my_sync_mode` is not passed to this definition the value of `my_sync_mode` will be the default `sync`. ??? blank "`optional` - List of template variables to be removed when not provided."
The `optional` attribute can specify variables that when not specified on the template call - will cause any attribute using one of those variables to be ignored in the template. It's value is a list of + will cause any attribute using one of those variables to be ignored in the template. Its value is a list of template variables to be considered optional. **You can make any template variable optional per collection by setting it to `null`.** @@ -126,7 +125,7 @@ In addition, templates also have a few special attributes that they can use: 1. This sets the template variable `my_sync_mode` as an optional variable. 2. The value for template variable `my_sync_mode` will replace `<>` here or removed as optional. - 3. This specifiys that `my_sync_mode` for this definition will be `append`. + 3. This specifies that `my_sync_mode` for this definition will be `append`. 4. Since `my_sync_mode` is not passed to this definition it will ignore the entire `sync_mode` attribute in the template. @@ -145,7 +144,7 @@ In addition, templates also have a few special attributes that they can use: A condition block consists of one or more key value pairs comparing given template variables to pre supplied static values. - The key is the name of the template variable who's value you want to compare. While the value is the staic value or + The key is the name of the template variable whose value you want to compare, while the value is the static value or values to compare aginst. Every condition block must also have the `value` key which will be the value of the template variable if all the conditions in that block are met. @@ -231,7 +230,7 @@ In addition, templates also have a few special attributes that they can use: name: Movies tmdb_id: 86311 Iron Man: - template: + 1 template: name: Movies tmdb_id: 131292 ``` From 7674a638828e733ca721494d975444c348f4b71e Mon Sep 17 00:00:00 2001 From: Chaz Larson Date: Mon, 29 Apr 2024 15:56:40 -0500 Subject: [PATCH 5/5] move bullmoose link In hopes of it working outside the details --- docs/defaults/overlays.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/defaults/overlays.md b/docs/defaults/overlays.md index 7fe9e6d8..94ad6ac2 100644 --- a/docs/defaults/overlays.md +++ b/docs/defaults/overlays.md @@ -23,14 +23,14 @@ libraries: ### Example Poster Overlays +**Note: These examples use fonts not packaged with Kometa. See [bullmoose20's Configs](https://github.com/Kometa-Team/Community-Configs/tree/master/bullmoose20)** + ![](images/movie-overlays1-annotated.png) ![](images/movie-overlays2-annotated.png)
Click to expand sample config.yml Movies overlays section: -**Note: This uses fonts not packaged with Kometa. See [bullmoose20's Configs](https://github.com/Kometa-Team/Community-Configs/tree/master/bullmoose20)** - ```yaml libraries: Movies: @@ -74,8 +74,6 @@ libraries:
Click to expand sample config.yml TV Shows overlays section for the Show Poster: -**Note: This uses fonts not packaged with Kometa. See [bullmoose20's Configs](https://github.com/Kometa-Team/Community-Configs/tree/master/bullmoose20)** - ```yaml libraries: TV Shows: @@ -141,8 +139,6 @@ libraries:
Click to expand sample config.yml TV Shows overlays section for the Episode Poster: -**Note: This uses fonts not packaged with Kometa. See [bullmoose20's Configs](https://github.com/Kometa-Team/Community-Configs/tree/master/bullmoose20)** - ```yaml libraries: TV Shows: @@ -239,6 +235,10 @@ Each file has a page on the wiki showing the available `template_variables` for **In addition to the defined `template_variables` almost all default Overlay files have access to the [Shared Variables](collection_variables.md).** +### Custom fonts used in these examples: + +See [bullmoose20's Configs](https://github.com/Kometa-Team/Community-Configs/tree/master/bullmoose20) + ### Examples {%