mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
Trimming video file name to avoid error when file name is too long.
This commit is contained in:
parent
37ff1ab2cd
commit
cdc73d9d16
13 changed files with 140 additions and 27 deletions
|
|
@ -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
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue