diff --git a/src/ytdl_sub/plugins/output_directory_nfo_tags.py b/src/ytdl_sub/plugins/output_directory_nfo_tags.py index 3d1f3be4..24123f8a 100644 --- a/src/ytdl_sub/plugins/output_directory_nfo_tags.py +++ b/src/ytdl_sub/plugins/output_directory_nfo_tags.py @@ -11,7 +11,20 @@ from ytdl_sub.validators.string_formatter_validators import OverridesStringForma class OutputDirectoryNfoTagsOptions(PluginOptions): """ - Validates config values for the output directory nfo tags plugin. + Adds a single NFO file in the output directory. An NFO file is simply an XML file with a + ``.nfo`` extension. You can add any values into the NFO. + + Usage: + + .. code-block:: yaml + + presets: + my_example_preset: + output_directory_nfo_tags: + nfo_name: "tvshow.nfo" + nfo_root: "tvshow" + tags: + title: "Sweet youtube TV show" """ _required_keys = {"nfo_name", "nfo_root", "tags"} @@ -20,13 +33,47 @@ class OutputDirectoryNfoTagsOptions(PluginOptions): super().__init__(name, value) # Since this does not create NFOs for entries, we must use the overrides formatter classes # to ensure we are only using values defined as string literals or in overrides - self.nfo_name = self._validate_key( + self._nfo_name = self._validate_key( key="nfo_name", validator=OverridesStringFormatterValidator ) - self.nfo_root = self._validate_key( + self._nfo_root = self._validate_key( key="nfo_root", validator=OverridesStringFormatterValidator ) - self.tags = self._validate_key(key="tags", validator=OverridesDictFormatterValidator) + self._tags = self._validate_key(key="tags", validator=OverridesDictFormatterValidator) + + @property + def nfo_name(self) -> OverridesStringFormatterValidator: + """ + The NFO file name. + """ + return self._nfo_name + + @property + def nfo_root(self) -> OverridesStringFormatterValidator: + """ + The root tag of the NFO's XML. In the usage above, it would look like + + .. code-block:: xml + + + + + """ + return self._nfo_root + + @property + def tags(self) -> OverridesDictFormatterValidator: + """ + Tags within the nfo_root tag. In the usage above, it would look like + + .. code-block:: xml + + + + Sweet youtube TV show + + """ + return self._tags class OutputDirectoryNfoTagsPlugin(Plugin[OutputDirectoryNfoTagsOptions]):