Trimming video file name to avoid error when file name is too long.

This commit is contained in:
Roland 2024-07-14 09:54:02 -06:00
parent 37ff1ab2cd
commit cdc73d9d16
No known key found for this signature in database
GPG key ID: 1BA620CE6C9A4680
13 changed files with 140 additions and 27 deletions

View file

@ -65,6 +65,7 @@ def get_domain_directory(url: str) -> pathlib.Path:
return directory
# File names include domain and datetime.
MAXIMUM_ARCHIVE_FILE_CHARACTER_LENGTH = 200

View file

@ -359,7 +359,7 @@ async def test_get_title_from_html(test_directory, test_session, fake_now):
@skip_circleci
def test_get_new_archive_files_length(fake_now):
def test_get_new_archive_files_length(test_directory, fake_now):
"""Archive titles are truncated to fit file system length limit. (255-character limit for most file systems)"""
fake_now(datetime(2001, 1, 1))
archive_files = get_new_archive_files('https://example.com', 'a' * 500)
@ -372,7 +372,7 @@ def test_get_new_archive_files_length(fake_now):
@skip_circleci
def test_get_new_archive_files(fake_now):
"""Archive files have a specific format so they are sorted by datetime, and are near each other."""
"""Archive files have a specific format, so they are sorted by datetime, and are near each other."""
fake_now(datetime(2001, 1, 1))
archive_files = get_new_archive_files('https://example.com/two', None)
assert str(archive_files.singlefile).endswith('archive/example.com/2001-01-01-00-00-00_NA.html')