diff --git a/src/ytdl_sub/entries/script/variable_types.py b/src/ytdl_sub/entries/script/variable_types.py index f406baf6..bbf994e9 100644 --- a/src/ytdl_sub/entries/script/variable_types.py +++ b/src/ytdl_sub/entries/script/variable_types.py @@ -22,7 +22,6 @@ VariableT = TypeVar("VariableT", bound="Variable") def _get( - cast: str, metadata_variable_name: str, metadata_key: str, variable_name: Optional[str], @@ -47,7 +46,7 @@ def _get( return as_type( variable_name=variable_name or metadata_key, metadata_key=metadata_key, - definition=f"{{ %legacy_bracket_safety(%{cast}({out})) }}", + definition=f"{{ {out} }}", ) @@ -182,7 +181,6 @@ class MapMetadataVariable(MetadataVariable, MapVariable): Creates a map variable from entry metadata """ return _get( - "map", metadata_variable_name=ENTRY_METADATA_VARIABLE_NAME, metadata_key=metadata_key, variable_name=variable_name, @@ -204,7 +202,6 @@ class ArrayMetadataVariable(MetadataVariable, ArrayVariable): Creates an array variable from entry metadata """ return _get( - "array", metadata_variable_name=ENTRY_METADATA_VARIABLE_NAME, metadata_key=metadata_key, variable_name=variable_name, @@ -226,7 +223,6 @@ class StringMetadataVariable(MetadataVariable, StringVariable): Creates a string variable from entry metadata """ return _get( - "string", metadata_variable_name=ENTRY_METADATA_VARIABLE_NAME, metadata_key=metadata_key, variable_name=variable_name, @@ -245,7 +241,6 @@ class StringMetadataVariable(MetadataVariable, StringVariable): Creates a string variable from playlist metadata """ return _get( - "string", metadata_variable_name=PLAYLIST_METADATA_VARIABLE_NAME, metadata_key=metadata_key, variable_name=variable_name, @@ -264,7 +259,6 @@ class StringMetadataVariable(MetadataVariable, StringVariable): Creates a string variable from source metadata """ return _get( - "string", metadata_variable_name=SOURCE_METADATA_VARIABLE_NAME, metadata_key=metadata_key, variable_name=variable_name, @@ -301,7 +295,6 @@ class IntegerMetadataVariable(MetadataVariable, IntegerVariable): Creates an int variable from entry metadata """ return _get( - "int", metadata_variable_name=ENTRY_METADATA_VARIABLE_NAME, metadata_key=metadata_key, variable_name=variable_name, @@ -320,7 +313,6 @@ class IntegerMetadataVariable(MetadataVariable, IntegerVariable): Creates an int variable from playlist metadata """ return _get( - "int", metadata_variable_name=PLAYLIST_METADATA_VARIABLE_NAME, metadata_key=metadata_key, variable_name=variable_name, diff --git a/tests/unit/entries/conftest.py b/tests/unit/entries/conftest.py index 9421d35e..e3302010 100644 --- a/tests/unit/entries/conftest.py +++ b/tests/unit/entries/conftest.py @@ -65,8 +65,8 @@ def mock_entry_to_dict( "epoch": 1596878400, "epoch_date": "20200808", "epoch_hour": "09", - "title": "entry {title}", - "title_sanitized": "entry {title}", + "title": "entry {title}", + "title_sanitized": "entry {title}", "ext": ext, "description": "", "creator": "abc123", @@ -113,8 +113,8 @@ def mock_entry_to_dict( "playlist_count": 1, "playlist_max_upload_year": 2021, "playlist_max_upload_year_truncated": 21, - "playlist_title": "entry {title}", - "playlist_title_sanitized": "entry {title}", + "playlist_title": "entry {title}", + "playlist_title_sanitized": "entry {title}", "playlist_description": "", "playlist_webpage_url": "https://yourname.here", "playlist_uid": "abc123", @@ -126,15 +126,15 @@ def mock_entry_to_dict( "source_description": "", "source_index": 1, "source_index_padded": "01", - "source_title": "entry {title}", - "source_title_sanitized": "entry {title}", + "source_title": "entry {title}", + "source_title_sanitized": "entry {title}", "source_webpage_url": "https://yourname.here", "source_uid": "abc123", "source_uploader": "abc123", "source_uploader_id": "abc123", "source_uploader_url": "https://yourname.here", "uid_sanitized_plex": "abc123", - "title_sanitized_plex": "entry {title}", + "title_sanitized_plex": "entry {title}", "release_date": upload_date, "release_date_standardized": "2021-01-12", "release_year": 2021,