Cleanup TorrentParser

This commit is contained in:
tarsin committed 2023-07-28 12:30:43 +08:00
1 parent 69bba560f0
commit 8c10836e6e
4 files changed
+29 -42

No files matched your search

@@ -12,12 +12,10 @@ class Torrent(
val downloads: Int,
val url: String,
val name: String,
) {
fun format() = "[$posted] $name [$size] [↑$seeds ↓$peers ✓$downloads]"
}
)
class TorrentResult(
val list: ArrayList<Torrent>,
) : List<Torrent> by list
fun Torrent.format() = "[$posted] $name [$size] [↑$seeds ↓$peers ✓$downloads]"
private external fun parseTorrent(body: String): TorrentResult
typealias TorrentResult = ArrayList<Torrent>
private external fun parseTorrent(body: String): ArrayList<Torrent>
@@ -125,6 +125,7 @@ import com.hippo.ehviewer.client.exception.NoHAtHClientException
import com.hippo.ehviewer.client.parser.ArchiveParser
import com.hippo.ehviewer.client.parser.HomeParser
import com.hippo.ehviewer.client.parser.TorrentResult
import com.hippo.ehviewer.client.parser.format
import com.hippo.ehviewer.coil.justDownload
import com.hippo.ehviewer.dao.DownloadInfo
import com.hippo.ehviewer.dao.Filter