pull/179/head
deniscerri 3 years ago
parent 2630954136
commit f26f440df4
No known key found for this signature in database
GPG Key ID: 95C43D517D830350

@ -76,7 +76,7 @@ interface DownloadDao {
@Query("DELETE FROM downloads WHERE status='Processing' AND id=:id")
suspend fun deleteSingleProcessing(id: Long)
@Update(onConflict = OnConflictStrategy.REPLACE)
@Upsert
suspend fun update(item: DownloadItem)
@Query("SELECT * FROM downloads ORDER BY id DESC LIMIT 1")

@ -76,14 +76,15 @@ class CommandTemplateViewModel(private val application: Application) : AndroidVi
}
suspend fun importFromClipboard() : Int {
val allTemplates = repository.getAll()
val allShortcuts = repository.getAllShortCuts()
var count = 0
val clipboard = withContext(Dispatchers.Main){
application.getSystemService(CLIPBOARD_SERVICE) as ClipboardManager
}
val clip = clipboard.primaryClip!!.getItemAt(0).text.toString()
try{
val allTemplates = repository.getAll()
val allShortcuts = repository.getAllShortCuts()
val clipboard = withContext(Dispatchers.Main){
application.getSystemService(CLIPBOARD_SERVICE) as ClipboardManager
}
val clip = clipboard.primaryClip!!.getItemAt(0).text.toString()
jsonFormat.decodeFromString<CommandTemplateExport>(clip).run {
templates.filterNot {t ->
allTemplates.find { it.content == t.content} != null

@ -207,7 +207,7 @@ class DownloadWorker(
request.addOption("--parse-metadata", "%(album,title)s:%(meta_album)s")
}
request.addOption("--audio-quality", sharedPreferences.getInt("audio_quality", 5))
request.addOption("--audio-quality", sharedPreferences.getInt("audio_quality", 0))
if (downloadItem.audioPreferences.splitByChapters && downloadItem.downloadSections.isBlank()){
request.addOption("--split-chapters")

Loading…
Cancel
Save