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

fix(es/SoloLatino): Update episode date #117

Merged
merged 3 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/es/sololatino/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ext {
extClass = '.SoloLatino'
themePkg = 'dooplay'
baseUrl = 'https://sololatino.net'
overrideVersionCode = 1
overrideVersionCode = 2
}

apply from: "$rootDir/common.gradle"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.net.HttpURLConnection
import java.net.URL
import java.text.SimpleDateFormat
import java.util.Locale

class SoloLatino : DooPlay(
"es",
Expand Down Expand Up @@ -71,6 +73,7 @@ class SoloLatino : DooPlay(
setUrlWithoutDomain(doc.location())
episode_number = 1F
name = episodeMovieText
date_upload = doc.selectFirst("span.date")?.text()?.toDate() ?: 0L
}.let(::listOf)
} else {
seasonList.flatMap(::getSeasonEpisodes).reversed()
Expand Down Expand Up @@ -468,7 +471,16 @@ class SoloLatino : DooPlay(
}

// ============================= Utilities ==============================
override fun String.toDate() = 0L

override fun String.toDate(): Long {
return try {
val dateFormat = SimpleDateFormat("MMM. dd, yyyy", Locale.ENGLISH)
val date = dateFormat.parse(this)
date?.time ?: 0L
} catch (e: Exception) {
0L
}
}

override fun List<Video>.sort(): List<Video> {
val quality = preferences.getString(prefQualityKey, prefQualityDefault)!!
Expand Down