Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More portable Export download tasks and imports, support curl #446

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

XiaoYingYo
Copy link

No description provided.

fun generateCurlCommands(credentialsList: List<DownloadCredentials>): List<String>
}

object DownloadCredentialsFromStringExtractor : DownloadCredentialsFromCurl<String> {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have another class with this name which extracts simple links.
it should be something like this instead

object DownloadCredentialsFromCurl: DownloadCredentialExtractor<String> 

import com.abdownloadmanager.shared.utils.extractors.Extractor


interface DownloadCredentialsFromCurl<T>: Extractor<T, List<DownloadCredentials>> {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we already had this interface (DownloadCredentialExtractor) so remove this.

Comment on lines 225 to 229
ClipboardUtil.copy(
selections.value
.map { it.downloadLink }
.joinToString(System.lineSeparator())
)
val credentialsList = selections.value
.mapNotNull { downloadSystem.getDownloadItemById(it.id) }
.map { DownloadCredentials.from(it) }
ClipboardUtil.copy(DownloadCredentialsFromStringExtractor.generateCurlCommands(credentialsList).joinToString("\n"))
Copy link
Owner

@amir1376 amir1376 Mar 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep the previous logic. which simply copies the download link.
I will add another button to "Export download as Curl" instead later

Copy link
Owner

@amir1376 amir1376 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

everything looks good thank you
the only think is that we use crowdin for translation

in PR just add english translation. other languages will be featched from Crowdin and rhere is no need to create them here as they make this synchronization with crowdin harder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants