commonMain.models.ResolveResultSet.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of torrentsearch-jvm Show documentation
Show all versions of torrentsearch-jvm Show documentation
Torrent Provider API client written in Kotlin.
The newest version!
package torrentsearch.models
/**
* [ResolveResultSet] is a container for a collection of [ProviderResult]s
* which simplifies accessing the resolve details across multiple providers.
*/
public class ResolveResultSet(
/**
* The original list of [ResolveResult]s from each provider.
*/
public val results: List,
) {
/**
* Contains a list of all the successfully resolved [TorrentDescription]s.
*/
public val resolved: List = results.flatMap { it.torrents }
/**
* Indicates if any of the [ResolveResult]s in [results] are an error.
*/
public val hasErrors: Boolean = results.any { it is ResolveResult.Error }
/**
* Returns a list of all the collected [ResolveResult.Error] results.
*/
public val failed: List = results.filterIsInstance()
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy