add id and file_size on default format ordering

pull/812/head
deniscerri 1 year ago
parent 2433b3768c
commit 903293e159
No known key found for this signature in database
GPG Key ID: 95C43D517D830350

@ -216,4 +216,4 @@ dependencies {
implementation "io.noties.markwon:core:4.6.2"
implementation("org.greenrobot:eventbus:3.3.1")
implementation("com.github.teamnewpipe:newpipeextractor:0.24.6")
implementation("com.grack:nanojson:1.10")}
}

@ -79,7 +79,7 @@ class ObserveSourcesRepository(private val observeSourcesDao: ObserveSourcesDao,
Calendar.getInstance().apply {
timeInMillis = it.startsTime
if (it.everyCategory != ObserveSourcesRepository.EveryCategory.HOUR){
if (it.everyCategory != EveryCategory.HOUR){
val hourMin = Calendar.getInstance()
hourMin.timeInMillis = it.everyTime
set(Calendar.HOUR_OF_DAY, hourMin.get(Calendar.HOUR_OF_DAY))
@ -87,9 +87,9 @@ class ObserveSourcesRepository(private val observeSourcesDao: ObserveSourcesDao,
}
when(it.everyCategory){
ObserveSourcesRepository.EveryCategory.HOUR -> {}
ObserveSourcesRepository.EveryCategory.DAY -> {}
ObserveSourcesRepository.EveryCategory.WEEK -> {
EveryCategory.HOUR -> {}
EveryCategory.DAY -> {}
EveryCategory.WEEK -> {
var weekDayNr = get(Calendar.DAY_OF_WEEK) - 1
if (weekDayNr == 0) weekDayNr = 7
val followingWeekDay = it.weeklyConfig?.weekDays?.firstOrNull { it >= weekDayNr }
@ -101,7 +101,7 @@ class ObserveSourcesRepository(private val observeSourcesDao: ObserveSourcesDao,
add(Calendar.DAY_OF_MONTH, followingWeekDay - weekDayNr)
}
}
ObserveSourcesRepository.EveryCategory.MONTH -> {
EveryCategory.MONTH -> {
val currentMonthIndex = get(Calendar.MONTH)
if (it.monthlyConfig?.startsMonth != currentMonthIndex){
set(Calendar.MONTH, it.monthlyConfig?.startsMonth ?: 0)

@ -45,9 +45,10 @@ class FormatUtil(private var context: Context) {
return orderPreferences
}else {
val formatImportance = mutableListOf("codec", "container", "language")
val formatImportance = mutableListOf("id","codec", "container", "language", "file_size")
if (sharedPreferences.getBoolean("prefer_smaller_formats", false)) {
formatImportance.add(0, "smallsize")
formatImportance.remove("file_size")
}
val preferContainerOverCodec = sharedPreferences.getBoolean("prefer_container_over_codec_audio", false)
@ -71,9 +72,10 @@ class FormatUtil(private var context: Context) {
return orderPreferences
}else {
val formatImportance = mutableListOf("resolution", "codec", "container")
val formatImportance = mutableListOf("id","resolution", "codec", "container", "file_size")
if (sharedPreferences.getBoolean("prefer_smaller_formats", false)) {
formatImportance.add("smallsize")
formatImportance.remove("file_size")
}
return formatImportance

Loading…
Cancel
Save