fixed parse metadata not working correctly on custom command
This commit is contained in:
parent
3e8cda1901
commit
d17aea86ee
1 changed files with 20 additions and 18 deletions
|
|
@ -89,26 +89,28 @@ class DownloadWorker(
|
|||
}
|
||||
val limitRate = sharedPreferences.getString("limit_rate", "")
|
||||
if (limitRate != "") request.addOption("-r", limitRate!!)
|
||||
if (downloadItem.SaveThumb) {
|
||||
request.addOption("--write-thumbnail")
|
||||
request.addOption("--convert-thumbnails", "png")
|
||||
}
|
||||
if (!sharedPreferences.getBoolean("mtime", false)){
|
||||
request.addOption("--no-mtime")
|
||||
}
|
||||
val sponsorBlockFilters = sharedPreferences.getStringSet("sponsorblock_filters", emptySet())
|
||||
if (sponsorBlockFilters!!.isNotEmpty()) {
|
||||
val filters = java.lang.String.join(",", sponsorBlockFilters)
|
||||
request.addOption("--sponsorblock-remove", filters)
|
||||
}
|
||||
if(downloadItem.type != DownloadViewModel.Type.command){
|
||||
if (downloadItem.SaveThumb) {
|
||||
request.addOption("--write-thumbnail")
|
||||
request.addOption("--convert-thumbnails", "png")
|
||||
}
|
||||
if (!sharedPreferences.getBoolean("mtime", false)){
|
||||
request.addOption("--no-mtime")
|
||||
}
|
||||
val sponsorBlockFilters = sharedPreferences.getStringSet("sponsorblock_filters", emptySet())
|
||||
if (sponsorBlockFilters!!.isNotEmpty()) {
|
||||
val filters = java.lang.String.join(",", sponsorBlockFilters)
|
||||
request.addOption("--sponsorblock-remove", filters)
|
||||
}
|
||||
|
||||
if(downloadItem.title.isNotEmpty()){
|
||||
request.addCommands(listOf("--replace-in-metadata","title",".*.",downloadItem.title))
|
||||
if(downloadItem.title.isNotEmpty()){
|
||||
request.addCommands(listOf("--replace-in-metadata","title",".*.",downloadItem.title))
|
||||
}
|
||||
if (downloadItem.author.isNotEmpty()){
|
||||
request.addCommands(listOf("--replace-in-metadata","uploader",".*.",downloadItem.author))
|
||||
}
|
||||
if (downloadItem.customFileNameTemplate.isEmpty()) downloadItem.customFileNameTemplate = "%(uploader)s - %(title)s"
|
||||
}
|
||||
if (downloadItem.author.isNotEmpty()){
|
||||
request.addCommands(listOf("--replace-in-metadata","uploader",".*.",downloadItem.author))
|
||||
}
|
||||
if (downloadItem.customFileNameTemplate.isEmpty()) downloadItem.customFileNameTemplate = "%(uploader)s - %(title)s"
|
||||
|
||||
request.addOption("--restrict-filenames")
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue