mirror of
https://github.com/libre-tube/LibreTube.git
synced 2024-12-14 22:30:30 +05:30
fix: improve filtering of DeArrow titles and thumbnails
This commit is contained in:
parent
8e133f79ca
commit
c62aadacfc
@ -19,10 +19,10 @@ object DeArrowUtil {
|
|||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
return null to null
|
return null to null
|
||||||
}
|
}
|
||||||
val newTitle = content.titles.maxByOrNull { it.votes }?.title
|
val newTitle = content.titles.firstOrNull { it.votes >= 0 || it.locked }?.title
|
||||||
val newThumbnail =
|
val newThumbnail = content.thumbnails.firstOrNull {
|
||||||
content.thumbnails.filter { it.thumbnail != null }.maxByOrNull { it.votes }
|
it.thumbnail != null && !it.original && (it.votes >= 0 || it.locked)
|
||||||
?.takeIf { !it.original }?.thumbnail
|
}?.thumbnail
|
||||||
return newTitle to newThumbnail
|
return newTitle to newThumbnail
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user