From 032d4d58e965cd45c0a294cff688d492398f0510 Mon Sep 17 00:00:00 2001 From: deniscerri <64997243+deniscerri@users.noreply.github.com> Date: Sun, 1 Dec 2024 20:54:56 +0100 Subject: [PATCH] 1.8.1.1 --- CHANGELOG.md | 14 ++++++- app/build.gradle | 2 +- .../ui/downloads/ErroredDownloadsFragment.kt | 8 +++- .../java/com/deniscerri/ytdl/util/UiUtil.kt | 9 ++++- .../ytdl/util/extractors/YTDLPUtil.kt | 39 ++++++++++--------- .../android/en-US/changelogs/108010100.txt | 8 ++++ 6 files changed, 57 insertions(+), 23 deletions(-) create mode 100644 fastlane/metadata/android/en-US/changelogs/108010100.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index ae9f611d..d3a09dfa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # YTDLnis Changelog +> # 1.8.1.1 (2024-12) + +# What's Changed + +- Fixed some preferences having wrong description +- Fixed app not matching vp9 formats sometimes +- Fixed command templates order icon +- Fixed app crashing when going landscape on large tablets +- Player Client preference is now reset so its empty by default. If you had modified it, please set it again :) +- Added ability for the app to also move the write info json files along with the video if the user requests it as extra command +- Made the re-download button always show the download card for error downloads +- Used format sorting for selecting worst format instead of wv or wa + > # 1.8.1 (2024-11) # What's Changed @@ -15,7 +28,6 @@ - #618, made all preferences with a description show their values - Fixed bug that prevented app from loading all urls from text file - Added ability to stop an observed source but not delete it -- ## Custom yt-dlp source diff --git a/app/build.gradle b/app/build.gradle index ece00f71..ce656232 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -12,7 +12,7 @@ def properties = new Properties() def versionMajor = 1 def versionMinor = 8 def versionPatch = 1 -def versionBuild = 0 // bump for dogfood builds, public betas, etc. +def versionBuild = 1 // bump for dogfood builds, public betas, etc. def isBeta = false def versionExt = "" diff --git a/app/src/main/java/com/deniscerri/ytdl/ui/downloads/ErroredDownloadsFragment.kt b/app/src/main/java/com/deniscerri/ytdl/ui/downloads/ErroredDownloadsFragment.kt index eedb5e08..22e806e0 100644 --- a/app/src/main/java/com/deniscerri/ytdl/ui/downloads/ErroredDownloadsFragment.kt +++ b/app/src/main/java/com/deniscerri/ytdl/ui/downloads/ErroredDownloadsFragment.kt @@ -364,7 +364,13 @@ class ErroredDownloadsFragment : Fragment(), GenericDownloadAdapter.OnItemClickL val item = withContext(Dispatchers.IO){ downloadViewModel.getItemByID(itemID) } - downloadViewModel.queueDownloads(listOf(item), true) + + findNavController().navigate(R.id.downloadBottomSheetDialog, bundleOf( + Pair("downloadItem", item), + Pair("result", downloadViewModel.createResultItemFromDownload(item)), + Pair("type", item.type) + )) + adapter.notifyItemChanged(position) } } diff --git a/app/src/main/java/com/deniscerri/ytdl/util/UiUtil.kt b/app/src/main/java/com/deniscerri/ytdl/util/UiUtil.kt index e9d95662..0877e9d0 100644 --- a/app/src/main/java/com/deniscerri/ytdl/util/UiUtil.kt +++ b/app/src/main/java/com/deniscerri/ytdl/util/UiUtil.kt @@ -629,13 +629,18 @@ object UiUtil { download.setOnClickListener { longClickDownloadButton(item) bottomSheet.cancel() - true } } DownloadRepository.Status.Scheduled -> { download!!.setCompoundDrawablesWithIntrinsicBounds(R.drawable.ic_downloads, 0, 0, 0); download.text = context.getString(R.string.download_now) } + DownloadRepository.Status.Error -> { + download?.setOnClickListener { + longClickDownloadButton(item) + bottomSheet.cancel() + } + } else -> { download?.setOnLongClickListener { longClickDownloadButton(item) @@ -645,7 +650,7 @@ object UiUtil { } } - if (status != DownloadRepository.Status.Queued){ + if (status != DownloadRepository.Status.Queued && status != DownloadRepository.Status.Error){ download?.setOnClickListener { bottomSheet.dismiss() downloadItem(item) diff --git a/app/src/main/java/com/deniscerri/ytdl/util/extractors/YTDLPUtil.kt b/app/src/main/java/com/deniscerri/ytdl/util/extractors/YTDLPUtil.kt index 82960ab5..47808604 100644 --- a/app/src/main/java/com/deniscerri/ytdl/util/extractors/YTDLPUtil.kt +++ b/app/src/main/java/com/deniscerri/ytdl/util/extractors/YTDLPUtil.kt @@ -78,7 +78,8 @@ class YTDLPUtil(private val context: Context) { val extraCommands = sharedPreferences.getString("data_fetching_extra_commands", "")!! if (extraCommands.isNotBlank()){ - addConfig(extraCommands) + addCommands(extraCommands.split(" ", "\t", "\n")) + //addConfig(extraCommands) } } @@ -762,12 +763,9 @@ class YTDLPUtil(private val context: Context) { var abrSort = "" var audioQualityId : String = downloadItem.format.format_id - if (audioQualityId.isBlank() || listOf("0", context.getString(R.string.best_quality), "ba", "best", "").contains(audioQualityId)){ + if (audioQualityId.isBlank() || listOf("0", context.getString(R.string.best_quality), "ba", "best", "", context.getString(R.string.worst_quality), "wa", "worst").contains(audioQualityId)){ audioQualityId = "ba/b" - }else if (listOf(context.getString(R.string.worst_quality), "wa", "worst").contains(audioQualityId)){ - audioQualityId = "wa/w" }else if(audioQualityId.contains("kbps_ytdlnisgeneric")){ - abrSort = audioQualityId.split("kbps")[0] audioQualityId = "" }else{ @@ -798,6 +796,10 @@ class YTDLPUtil(private val context: Context) { val formatSorting = StringBuilder("hasaud") + if (downloadItem.format.format_id == context.resources.getString(R.string.worst_quality) || downloadItem.format.format_id == "wa" || downloadItem.format.format_id == "worst") { + formatSorting.append(",+br,+res,+fps") + } + if (abrSort.isNotBlank()){ formatSorting.append(",abr:${abrSort}") } @@ -990,11 +992,8 @@ class YTDLPUtil(private val context: Context) { } } }else{ - if (videoF == context.resources.getString(R.string.best_quality) || videoF == "best") { + if (videoF == context.resources.getString(R.string.best_quality) || videoF == "best" || videoF == context.resources.getString(R.string.worst_quality) || videoF == "worst") { videoF = "bv" - }else if (videoF == context.resources.getString(R.string.worst_quality) || videoF == "worst") { - videoF = "wv" - if (audioF == "ba") audioF = "wa" }else if (defaultFormats.contains(videoF)) { hasGenericResulutionFormat = videoF.split("_")[0].dropLast(1) videoF = "bv" @@ -1067,7 +1066,9 @@ class YTDLPUtil(private val context: Context) { val preferredLanguage = sharedPreferences.getString("audio_language","")!! StringBuilder().apply { - if (hasGenericResulutionFormat.isNotBlank()) { + if (downloadItem.format.format_id == context.resources.getString(R.string.worst_quality) || downloadItem.format.format_id == "worst") { + append(",+br,+res,+fps") + }else if (hasGenericResulutionFormat.isNotBlank()) { append(",res:${hasGenericResulutionFormat}") } if (sharedPreferences.getBoolean("prefer_smaller_formats", false)) append(",+size") @@ -1145,14 +1146,16 @@ class YTDLPUtil(private val context: Context) { } if (downloadItem.extraCommands.isNotBlank() && downloadItem.type != DownloadViewModel.Type.command){ - val cache = File(FileUtil.getCachePath(context)) - cache.mkdirs() - val conf = File(cache.absolutePath + "/${System.currentTimeMillis()}${UUID.randomUUID()}.txt") - conf.createNewFile() - conf.writeText(downloadItem.extraCommands) - val tmp = mutableListOf() - tmp.addOption("--config-locations", conf.absolutePath) - request.addCommands(tmp) + request.addCommands(downloadItem.extraCommands.split(" ", "\t", "\n")) +// +// val cache = File(FileUtil.getCachePath(context)) +// cache.mkdirs() +// val conf = File(cache.absolutePath + "/${System.currentTimeMillis()}${UUID.randomUUID()}.txt") +// conf.createNewFile() +// conf.writeText(downloadItem.extraCommands) +// val tmp = mutableListOf() +// tmp.addOption("--config-locations", conf.absolutePath) +// request.addCommands(tmp) } return request diff --git a/fastlane/metadata/android/en-US/changelogs/108010100.txt b/fastlane/metadata/android/en-US/changelogs/108010100.txt new file mode 100644 index 00000000..f4ecdbb8 --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/108010100.txt @@ -0,0 +1,8 @@ +# What's Changed + +- Fixed some preferences having wrong description +- Fixed app not matching vp9 formats sometimes +- Fixed app crashing when going landscape on large tablets +- Player Client preference is now reset so its empty by default. +- Made the re-download button always show the download card for error downloads +- Used format sorting for selecting worst format instead of wv or wa \ No newline at end of file