Add _nfo_element function

This commit is contained in:
tcely 2025-05-09 03:40:20 -04:00 committed by GitHub
parent 6278087b12
commit 3bb19861cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -8,6 +8,13 @@ media_file_storage = FileSystemStorage(location=str(settings.DOWNLOAD_ROOT), bas
_srctype_dict = lambda n: dict(zip( YouTube_SourceType.values, (n,) * len(YouTube_SourceType.values) ))
def _nfo_element(nfo, label, text, /, *, attrs={}, tail='\n', char=' ', indent=2):
element = nfo.makeelement(label, attrs)
element.text = text
element.tail = tail + (char * indent)
return element
def get_media_file_path(instance, filename):
return instance.filepath