DFWEBOS_DATA_DIR="${DFWEBOS_ROOT}/data"
DFWEBOS_DATA_STORAGE_AUDIOBOOKS_DIR="${DFWEBOS_DATA_DIR}/storage/downloads/audiobooks"
DFWEBOS_DATA_STORAGE_PODCASTS_DIR="${DFWEBOS_DATA_DIR}/storage/downloads/podcasts"
DESIRED_OWNER="1000:1000"

if [[ ! -d "${DFWEBOS_DATA_STORAGE_AUDIOBOOKS_DIR}" ]]; then
	mkdir -p "${DFWEBOS_DATA_STORAGE_AUDIOBOOKS_DIR}"

	chown "${DESIRED_OWNER}" "${DFWEBOS_DATA_STORAGE_AUDIOBOOKS_DIR}"
fi

if [[ ! -d "${DFWEBOS_DATA_STORAGE_PODCASTS_DIR}" ]]; then
	mkdir -p "${DFWEBOS_DATA_STORAGE_PODCASTS_DIR}"

	chown "${DESIRED_OWNER}" "${DFWEBOS_DATA_STORAGE_PODCASTS_DIR}"
fi