mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-03-04 08:53:42 +00:00
transmission-deamon creates the directory if it doesn't exist. Signed-off-by: Veiko Aasa <veiko17@disroot.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
23 lines
772 B
Python
23 lines
772 B
Python
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
"""
|
|
FreedomBox app for configuring Transmission.
|
|
"""
|
|
|
|
from django.utils.translation import ugettext_lazy as _
|
|
|
|
from plinth.modules.transmission import reserved_usernames
|
|
from plinth.modules.storage.forms import (DirectorySelectForm,
|
|
DirectoryValidator)
|
|
|
|
|
|
class TransmissionForm(DirectorySelectForm):
|
|
"""Transmission configuration form"""
|
|
|
|
def __init__(self, *args, **kw):
|
|
validator = DirectoryValidator(
|
|
username=reserved_usernames[0], check_creatable=True)
|
|
super(TransmissionForm, self).__init__(
|
|
title=_('Download directory'),
|
|
default='/var/lib/transmission-daemon/downloads',
|
|
validator=validator, *args, **kw)
|