Extra Command Bug Fixes
This commit is contained in:
parent
182492f39b
commit
0b944d108a
11 changed files with 140 additions and 23 deletions
67
.github/workflows/android.yml
vendored
67
.github/workflows/android.yml
vendored
|
|
@ -12,9 +12,9 @@ on:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write # for deleting/creating a pre-release
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: set up JDK 17
|
- name: set up JDK 17
|
||||||
|
|
@ -61,6 +61,8 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: YTDLnis APK release generated
|
name: YTDLnis APK release generated
|
||||||
path: ${{ env.main_project_module }}/build/outputs/apk/release/
|
path: ${{ env.main_project_module }}/build/outputs/apk/release/
|
||||||
|
|
||||||
|
# Send Message To Telegram
|
||||||
- name: send telegram message on push or pull
|
- name: send telegram message on push or pull
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
uses: appleboy/telegram-action@master
|
uses: appleboy/telegram-action@master
|
||||||
|
|
@ -70,7 +72,64 @@ jobs:
|
||||||
message: |
|
message: |
|
||||||
${{ github.actor }} created commit:
|
${{ github.actor }} created commit:
|
||||||
Commit message: ${{ github.event.commits[0].message }}
|
Commit message: ${{ github.event.commits[0].message }}
|
||||||
|
|
||||||
Repository: ${{ github.repository }}
|
Repository: ${{ github.repository }}
|
||||||
|
|
||||||
See changes: https://github.com/${{ github.repository }}/commit/${{github.sha}}
|
See changes: https://github.com/${{ github.repository }}/commit/${{github.sha}}
|
||||||
|
|
||||||
|
# Start Creating Pre-Release
|
||||||
|
- name: Start Pre-Release
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
# returns null if no pre-release exists
|
||||||
|
- name: Get Commit SHA of Latest Pre-release
|
||||||
|
run: |
|
||||||
|
# Install Required Packages
|
||||||
|
sudo apt-get updated
|
||||||
|
sudo apt-get install -y curl jq
|
||||||
|
echo "COMMIT_SHA_TAG=$(jq -r 'map(select(.prerelease)) | first | .tag_name' <<< $(curl -s https://api.github.com/repos/deniscerri/ytdlnis/releases))" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- run: gh release delete ${{ env.COMMIT_SHA_TAG }} --cleanup-tag
|
||||||
|
if: (env.COMMIT_SHA_TAG != 'null' && contains("Auto-Release", env.COMMIT_SHA_TAG))
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
# Make sure that an old ci that still runs on main doesn't recreate a prerelease
|
||||||
|
- name: Check Pullable Commits
|
||||||
|
id: check_commits
|
||||||
|
run: |
|
||||||
|
git fetch
|
||||||
|
CHANGES=$(git rev-list HEAD..origin/main --count)
|
||||||
|
echo "CHANGES=$CHANGES" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Get Release Name
|
||||||
|
id: get_last_release_tag
|
||||||
|
run: |
|
||||||
|
LASTRELEASE=$(curl "https://api.github.com/repos/deniscerri/ytdlnis/releases/latest")
|
||||||
|
ISPRERELEASE=$(echo $LASTRELEASE | jq -r '.prerelease')
|
||||||
|
NEWRELEASENAME=$(echo $LASTRELEASE | jq -r '.name')
|
||||||
|
if ! $ISPRERELEASE; then NEWRELEASENAME=$(echo $NEWRELEASENAME'.1'); else NEWRELEASENAME=$(echo $NEWRELEASENAME | sed -E 's/(.*\.)([0-9]+)$/echo "\1$((\2 + 1))"/e'); fi
|
||||||
|
echo "NEWRELEASENAME=$NEWRELEASENAME" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Get last commit SHA
|
||||||
|
id: last_commit
|
||||||
|
run: echo "COMMIT_SHA=$(git rev-parse HEAD | cut -c 1-8)" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Get commmit date
|
||||||
|
id: commit_date
|
||||||
|
run: echo "COMMIT_DATE=$(git show -s --date=format:'%Y%m%d' --format=%cd HEAD)" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
|
||||||
|
# Create a new pre-release, the other upload_binaries.yml will upload the binaries
|
||||||
|
# to this pre-release.
|
||||||
|
- name: Create Prerelease
|
||||||
|
if: github.ref.name == 'main' && env.CHANGES == '0'
|
||||||
|
uses: softprops/action-gh-release@4634c16e79c963813287e889244c50009e7f0981
|
||||||
|
with:
|
||||||
|
name: ${{ env.NEWRELEASENAME }} [Auto-Release] [${{ env.COMMIT_DATE }}-${{ env.COMMIT_SHA }}]
|
||||||
|
tag_name: v${{ env.NEWRELEASENAME }}-beta
|
||||||
|
body: ${{ github.event.commits[0].message }}
|
||||||
|
prerelease: true
|
||||||
|
files: |
|
||||||
|
${{ env.main_project_module }}/build/outputs/apk/release/*
|
||||||
|
${{ env.main_project_module }}/build/outputs/apk/debug/*
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -270,6 +270,9 @@ interface DownloadDao {
|
||||||
@Query("Select url from downloads where status in (:status)")
|
@Query("Select url from downloads where status in (:status)")
|
||||||
fun getURLsByStatus(status: List<String>) : List<String>
|
fun getURLsByStatus(status: List<String>) : List<String>
|
||||||
|
|
||||||
|
@Query("Select id from downloads where status in (:status)")
|
||||||
|
fun getIDsByStatus(status: List<String>) : List<Long>
|
||||||
|
|
||||||
@Query("Select url from downloads where id in (:ids)")
|
@Query("Select url from downloads where id in (:ids)")
|
||||||
fun getURLsByID(ids: List<Long>) : List<String>
|
fun getURLsByID(ids: List<Long>) : List<String>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.deniscerri.ytdl.database.repository
|
package com.deniscerri.ytdl.database.repository
|
||||||
|
|
||||||
|
import androidx.compose.runtime.internal.isLiveLiteralsEnabled
|
||||||
import androidx.paging.Pager
|
import androidx.paging.Pager
|
||||||
import androidx.paging.PagingConfig
|
import androidx.paging.PagingConfig
|
||||||
import androidx.paging.PagingData
|
import androidx.paging.PagingData
|
||||||
|
|
@ -13,6 +14,7 @@ import com.deniscerri.ytdl.util.FileUtil
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
import kotlinx.coroutines.flow.collectLatest
|
import kotlinx.coroutines.flow.collectLatest
|
||||||
import kotlinx.coroutines.flow.map
|
import kotlinx.coroutines.flow.map
|
||||||
|
import java.io.File
|
||||||
|
|
||||||
class HistoryRepository(private val historyDao: HistoryDao) {
|
class HistoryRepository(private val historyDao: HistoryDao) {
|
||||||
val items : Flow<List<HistoryItem>> = historyDao.getAllHistory()
|
val items : Flow<List<HistoryItem>> = historyDao.getAllHistory()
|
||||||
|
|
@ -113,6 +115,19 @@ class HistoryRepository(private val historyDao: HistoryDao) {
|
||||||
historyDao.deleteAllByIDs(ids)
|
historyDao.deleteAllByIDs(ids)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
suspend fun deleteAllWithIDsCheckFiles(ids: List<Long>){
|
||||||
|
val idsToDelete = mutableListOf<Long>()
|
||||||
|
historyDao.getAllHistoryByIDs(ids).forEach { item ->
|
||||||
|
val filesNotPresent = item.downloadPath.all { !File(it).exists() && it.isNotBlank()}
|
||||||
|
if (filesNotPresent) {
|
||||||
|
idsToDelete.add(item.id)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (idsToDelete.isNotEmpty()) {
|
||||||
|
historyDao.deleteAllByIDs(idsToDelete)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
data class HistoryItemDownloadPaths(
|
data class HistoryItemDownloadPaths(
|
||||||
val downloadPath: List<String>
|
val downloadPath: List<String>
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1236,6 +1236,10 @@ class DownloadViewModel(private val application: Application) : AndroidViewModel
|
||||||
return dao.getURLsByStatus(list.map { it.toString() })
|
return dao.getURLsByStatus(list.map { it.toString() })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getIDsByStatus(list: List<DownloadRepository.Status>) : List<Long> {
|
||||||
|
return dao.getIDsByStatus(list.map { it.toString() })
|
||||||
|
}
|
||||||
|
|
||||||
fun getURLsByIds(list: List<Long>) : List<String> {
|
fun getURLsByIds(list: List<Long>) : List<String> {
|
||||||
return dao.getURLsByID(list)
|
return dao.getURLsByID(list)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -178,6 +178,10 @@ class HistoryViewModel(application: Application) : AndroidViewModel(application)
|
||||||
repository.deleteAllWithIDs(ids, deleteFile)
|
repository.deleteAllWithIDs(ids, deleteFile)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun deleteAllWithIDsCheckFiles(ids: List<Long>) = viewModelScope.launch(Dispatchers.IO) {
|
||||||
|
repository.deleteAllWithIDsCheckFiles(ids)
|
||||||
|
}
|
||||||
|
|
||||||
fun getDownloadPathsFromIDs(ids: List<Long>) : List<List<String>> {
|
fun getDownloadPathsFromIDs(ids: List<Long>) : List<List<String>> {
|
||||||
return repository.getDownloadPathsFromIDs(ids)
|
return repository.getDownloadPathsFromIDs(ids)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -86,6 +86,7 @@ class DownloadMultipleBottomSheetDialog : BottomSheetDialogFragment(), Configure
|
||||||
private lateinit var parentActivity: BaseActivity
|
private lateinit var parentActivity: BaseActivity
|
||||||
|
|
||||||
private lateinit var currentDownloadIDs: List<Long>
|
private lateinit var currentDownloadIDs: List<Long>
|
||||||
|
private lateinit var currentHistoryIDs: List<Long>
|
||||||
private var processingItemsCount : Int = 0
|
private var processingItemsCount : Int = 0
|
||||||
|
|
||||||
private lateinit var containerBtn : MenuItem
|
private lateinit var containerBtn : MenuItem
|
||||||
|
|
@ -100,6 +101,7 @@ class DownloadMultipleBottomSheetDialog : BottomSheetDialogFragment(), Configure
|
||||||
sharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireContext())
|
sharedPreferences = PreferenceManager.getDefaultSharedPreferences(requireContext())
|
||||||
|
|
||||||
currentDownloadIDs = arguments?.getLongArray("currentDownloadIDs")?.toList() ?: listOf()
|
currentDownloadIDs = arguments?.getLongArray("currentDownloadIDs")?.toList() ?: listOf()
|
||||||
|
currentHistoryIDs = arguments?.getLongArray("currentHistoryIDs")?.toList() ?: listOf()
|
||||||
processingItemsCount = currentDownloadIDs.size
|
processingItemsCount = currentDownloadIDs.size
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -225,6 +227,7 @@ class DownloadMultipleBottomSheetDialog : BottomSheetDialogFragment(), Configure
|
||||||
lifecycleScope.launch {
|
lifecycleScope.launch {
|
||||||
withContext(Dispatchers.IO){
|
withContext(Dispatchers.IO){
|
||||||
downloadViewModel.deleteAllWithID(currentDownloadIDs)
|
downloadViewModel.deleteAllWithID(currentDownloadIDs)
|
||||||
|
historyViewModel.deleteAllWithIDsCheckFiles(currentHistoryIDs)
|
||||||
val result = downloadViewModel.updateProcessingDownloadTimeAndQueueScheduled(cal.timeInMillis)
|
val result = downloadViewModel.updateProcessingDownloadTimeAndQueueScheduled(cal.timeInMillis)
|
||||||
if (result.message.isNotBlank()){
|
if (result.message.isNotBlank()){
|
||||||
lifecycleScope.launch {
|
lifecycleScope.launch {
|
||||||
|
|
@ -248,6 +251,7 @@ class DownloadMultipleBottomSheetDialog : BottomSheetDialogFragment(), Configure
|
||||||
lifecycleScope.launch {
|
lifecycleScope.launch {
|
||||||
withContext(Dispatchers.IO){
|
withContext(Dispatchers.IO){
|
||||||
downloadViewModel.deleteAllWithID(currentDownloadIDs)
|
downloadViewModel.deleteAllWithID(currentDownloadIDs)
|
||||||
|
historyViewModel.deleteAllWithIDsCheckFiles(currentHistoryIDs)
|
||||||
val result = downloadViewModel.queueProcessingDownloads()
|
val result = downloadViewModel.queueProcessingDownloads()
|
||||||
if (result.message.isNotBlank()){
|
if (result.message.isNotBlank()){
|
||||||
lifecycleScope.launch {
|
lifecycleScope.launch {
|
||||||
|
|
@ -274,6 +278,7 @@ class DownloadMultipleBottomSheetDialog : BottomSheetDialogFragment(), Configure
|
||||||
withContext(Dispatchers.IO){
|
withContext(Dispatchers.IO){
|
||||||
downloadViewModel.deleteAllWithID(currentDownloadIDs)
|
downloadViewModel.deleteAllWithID(currentDownloadIDs)
|
||||||
downloadViewModel.moveProcessingToSavedCategory()
|
downloadViewModel.moveProcessingToSavedCategory()
|
||||||
|
historyViewModel.deleteAllWithIDsCheckFiles(currentHistoryIDs)
|
||||||
}
|
}
|
||||||
|
|
||||||
downloadViewModel.processingItemsJob?.cancel(CancellationException())
|
downloadViewModel.processingItemsJob?.cancel(CancellationException())
|
||||||
|
|
|
||||||
|
|
@ -500,19 +500,22 @@ class HistoryFragment : Fragment(), HistoryPaginatedAdapter.OnItemClickListener{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
override fun onCardClick(itemID: Long, isPresent: Boolean) {
|
override fun onCardClick(itemID: Long, filePresent: Boolean) {
|
||||||
lifecycleScope.launch {
|
lifecycleScope.launch {
|
||||||
val item = withContext(Dispatchers.IO){
|
val item = withContext(Dispatchers.IO){
|
||||||
historyViewModel.getByID(itemID)
|
historyViewModel.getByID(itemID)
|
||||||
}
|
}
|
||||||
|
|
||||||
UiUtil.showHistoryItemDetailsCard(item, requireActivity(), isPresent,
|
UiUtil.showHistoryItemDetailsCard(item, requireActivity(), filePresent,
|
||||||
removeItem = { it, deleteFile ->
|
removeItem = { it, deleteFile ->
|
||||||
historyViewModel.delete(it, deleteFile)
|
historyViewModel.delete(it, deleteFile)
|
||||||
},
|
},
|
||||||
redownloadItem = {
|
redownloadItem = {
|
||||||
val downloadItem = downloadViewModel.createDownloadItemFromHistory(it)
|
val downloadItem = downloadViewModel.createDownloadItemFromHistory(it)
|
||||||
runBlocking{
|
runBlocking{
|
||||||
|
if (!filePresent) {
|
||||||
|
historyViewModel.delete(it, false)
|
||||||
|
}
|
||||||
downloadViewModel.queueDownloads(listOf(downloadItem))
|
downloadViewModel.queueDownloads(listOf(downloadItem))
|
||||||
}
|
}
|
||||||
historyViewModel.delete(it, false)
|
historyViewModel.delete(it, false)
|
||||||
|
|
@ -651,7 +654,9 @@ class HistoryFragment : Fragment(), HistoryPaginatedAdapter.OnItemClickListener{
|
||||||
downloadViewModel.turnHistoryItemsToProcessingDownloads(selectedObjects, downloadNow = !showDownloadCard)
|
downloadViewModel.turnHistoryItemsToProcessingDownloads(selectedObjects, downloadNow = !showDownloadCard)
|
||||||
actionMode?.finish()
|
actionMode?.finish()
|
||||||
if (showDownloadCard){
|
if (showDownloadCard){
|
||||||
findNavController().navigate(R.id.downloadMultipleBottomSheetDialog2)
|
val bundle = Bundle()
|
||||||
|
bundle.putLongArray("currentHistoryIDs", selectedObjects.toLongArray())
|
||||||
|
findNavController().navigate(R.id.downloadMultipleBottomSheetDialog2, bundle)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -118,6 +118,14 @@ class SavedDownloadsFragment : Fragment(), GenericDownloadAdapter.OnItemClickLis
|
||||||
popup.menuInflater.inflate(R.menu.saved_header_menu, popup.menu)
|
popup.menuInflater.inflate(R.menu.saved_header_menu, popup.menu)
|
||||||
popup.setOnMenuItemClickListener { m ->
|
popup.setOnMenuItemClickListener { m ->
|
||||||
when(m.itemId){
|
when(m.itemId){
|
||||||
|
R.id.download_all -> {
|
||||||
|
lifecycleScope.launch {
|
||||||
|
val ids = withContext(Dispatchers.IO) {
|
||||||
|
downloadViewModel.getIDsByStatus(listOf(DownloadRepository.Status.Saved))
|
||||||
|
}
|
||||||
|
downloadViewModel.reQueueDownloadItems(ids)
|
||||||
|
}
|
||||||
|
}
|
||||||
R.id.delete_all -> {
|
R.id.delete_all -> {
|
||||||
UiUtil.showGenericDeleteAllDialog(requireContext()) {
|
UiUtil.showGenericDeleteAllDialog(requireContext()) {
|
||||||
downloadViewModel.deleteSaved()
|
downloadViewModel.deleteSaved()
|
||||||
|
|
|
||||||
|
|
@ -78,8 +78,8 @@ class YTDLPUtil(private val context: Context) {
|
||||||
|
|
||||||
val extraCommands = sharedPreferences.getString("data_fetching_extra_commands", "")!!
|
val extraCommands = sharedPreferences.getString("data_fetching_extra_commands", "")!!
|
||||||
if (extraCommands.isNotBlank()){
|
if (extraCommands.isNotBlank()){
|
||||||
addCommands(extraCommands.split(" ", "\t", "\n"))
|
//addCommands(extraCommands.split(" ", "\t", "\n"))
|
||||||
//addConfig(extraCommands)
|
addConfig(extraCommands)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1146,16 +1146,16 @@ class YTDLPUtil(private val context: Context) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (downloadItem.extraCommands.isNotBlank() && downloadItem.type != DownloadViewModel.Type.command){
|
if (downloadItem.extraCommands.isNotBlank() && downloadItem.type != DownloadViewModel.Type.command){
|
||||||
request.addCommands(downloadItem.extraCommands.split(" ", "\t", "\n"))
|
//request.addCommands(downloadItem.extraCommands.replace("\"", "").split(" ", "\t", "\n"))
|
||||||
//
|
|
||||||
// val cache = File(FileUtil.getCachePath(context))
|
val cache = File(FileUtil.getCachePath(context))
|
||||||
// cache.mkdirs()
|
cache.mkdirs()
|
||||||
// val conf = File(cache.absolutePath + "/${System.currentTimeMillis()}${UUID.randomUUID()}.txt")
|
val conf = File(cache.absolutePath + "/${System.currentTimeMillis()}${UUID.randomUUID()}.txt")
|
||||||
// conf.createNewFile()
|
conf.createNewFile()
|
||||||
// conf.writeText(downloadItem.extraCommands)
|
conf.writeText(downloadItem.extraCommands)
|
||||||
// val tmp = mutableListOf<String>()
|
val tmp = mutableListOf<String>()
|
||||||
// tmp.addOption("--config-locations", conf.absolutePath)
|
tmp.addOption("--config-locations", conf.absolutePath)
|
||||||
// request.addCommands(tmp)
|
request.addCommands(tmp)
|
||||||
}
|
}
|
||||||
|
|
||||||
return request
|
return request
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,7 @@ import kotlinx.coroutines.runBlocking
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
import org.greenrobot.eventbus.EventBus
|
import org.greenrobot.eventbus.EventBus
|
||||||
import java.io.File
|
import java.io.File
|
||||||
|
import java.security.MessageDigest
|
||||||
import java.util.Locale
|
import java.util.Locale
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -51,6 +52,7 @@ class DownloadWorker(
|
||||||
private val context: Context,
|
private val context: Context,
|
||||||
workerParams: WorkerParameters
|
workerParams: WorkerParameters
|
||||||
) : CoroutineWorker(context, workerParams) {
|
) : CoroutineWorker(context, workerParams) {
|
||||||
|
@OptIn(ExperimentalStdlibApi::class)
|
||||||
@SuppressLint("RestrictedApi")
|
@SuppressLint("RestrictedApi")
|
||||||
override suspend fun doWork(): Result {
|
override suspend fun doWork(): Result {
|
||||||
if (isStopped) return Result.success()
|
if (isStopped) return Result.success()
|
||||||
|
|
@ -320,10 +322,12 @@ class DownloadWorker(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
notificationUtil.cancelDownloadNotification(downloadItem.id.toInt())
|
withContext(Dispatchers.Main) {
|
||||||
notificationUtil.createDownloadFinished(
|
notificationUtil.cancelDownloadNotification(downloadItem.id.toInt())
|
||||||
downloadItem.id, downloadItem.title, downloadItem.type, if (finalPaths.isEmpty()) null else finalPaths, resources
|
notificationUtil.createDownloadFinished(
|
||||||
)
|
downloadItem.id, downloadItem.title, downloadItem.type, if (finalPaths.isEmpty()) null else finalPaths, resources
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
// if (wasQuickDownloaded && createResultItem){
|
// if (wasQuickDownloaded && createResultItem){
|
||||||
// runCatching {
|
// runCatching {
|
||||||
|
|
@ -352,6 +356,11 @@ class DownloadWorker(
|
||||||
}
|
}
|
||||||
if (this@DownloadWorker.isStopped) return@onFailure
|
if (this@DownloadWorker.isStopped) return@onFailure
|
||||||
if (it is YoutubeDL.CanceledException) return@onFailure
|
if (it is YoutubeDL.CanceledException) return@onFailure
|
||||||
|
if (it.message?.contains("JSONDecodeError") == true) {
|
||||||
|
val cachePath = "${FileUtil.getCachePath(context)}infojsons"
|
||||||
|
val infoJsonName = MessageDigest.getInstance("MD5").digest(downloadItem.url.toByteArray()).toHexString()
|
||||||
|
FileUtil.deleteFile("${cachePath}/${infoJsonName}.info.json")
|
||||||
|
}
|
||||||
|
|
||||||
if(it.message != null){
|
if(it.message != null){
|
||||||
if (logDownloads){
|
if (logDownloads){
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,11 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
<item
|
||||||
|
android:id="@+id/download_all"
|
||||||
|
android:title="@string/download_all"
|
||||||
|
app:showAsAction="never"
|
||||||
|
/>
|
||||||
<item
|
<item
|
||||||
android:id="@+id/delete_all"
|
android:id="@+id/delete_all"
|
||||||
android:title="@string/clear_saved"
|
android:title="@string/clear_saved"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue