Skip to content

Can't Add rss url  #56

@JasonLinkinBright

Description

@JasonLinkinBright

`fun onSaveSourceClicked(url: String) = viewModelScope.launch(Dispatchers.IO) {
val trimmedUrl = url.trimIndent()
if (Patterns.WEB_URL.matcher(trimmedUrl.toLowerCase(Locale.US)).matches()) {
sourceErrText.postValue(R.string.empty_string)

        val cleanUrl = URLUtil.guessUrl(trimmedUrl)
        val alreadyExists = sourceRepo.isSourceExisting(cleanUrl)

        if (alreadyExists) {
            sourceErrText.postValue(R.string.error_source_exists)
        } else {
            isSourceProgressVisible.postValue(true)
            isSourceAddButtonEnabled.postValue(false)
            closeKeyboardEvent.postEvent(true)
            addSource(cleanUrl)
        }
    } else if (url.isEmpty()) {
        sourceErrText.postValue(R.string.error_empty_source_url)
    } else {
        sourceErrText.postValue(R.string.error_invalid_url)
    }
}`

I want to add rss ,but it appears to not work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions