Update:Android support storing downloads to internal app storage #635

This commit is contained in:
advplyr
2023-06-03 17:24:32 -05:00
parent 87c74fe78b
commit e6aaccfc74
14 changed files with 715 additions and 61 deletions
+16 -6
View File
@@ -632,16 +632,26 @@ export default {
})
console.log('Folders with media type', this.mediaType, foldersWithMediaType.length)
if (!foldersWithMediaType.length) {
// No local folders or no local folders with this media type
localFolder = await this.selectFolder()
} else if (foldersWithMediaType.length == 1) {
console.log('Only 1 local folder with this media type - auto select it')
localFolder = foldersWithMediaType[0]
localFolder = {
id: `internal-${this.mediaType}`,
name: 'App Storage',
mediaType: this.mediaType
}
} else {
console.log('Multiple folders with media type')
this.showSelectLocalFolder = true
return
}
// if (!foldersWithMediaType.length) {
// // No local folders or no local folders with this media type
// localFolder = await this.selectFolder()
// } else if (foldersWithMediaType.length == 1) {
// console.log('Only 1 local folder with this media type - auto select it')
// localFolder = foldersWithMediaType[0]
// } else {
// console.log('Multiple folders with media type')
// this.showSelectLocalFolder = true
// return
// }
if (!localFolder) {
return this.$toast.error('Invalid download folder')
}
+21 -12
View File
@@ -4,7 +4,7 @@
<p class="text-base font-semibold">Folder: {{ folderName }}</p>
<div class="flex-grow" />
<span class="material-icons" @click="showDialog = true">more_vert</span>
<span v-if="dialogItems.length" class="material-icons" @click="showDialog = true">more_vert</span>
</div>
<p class="text-sm mb-4 text-white text-opacity-60">Media Type: {{ mediaType }}</p>
@@ -58,26 +58,35 @@ export default {
},
computed: {
folderName() {
return this.folder ? this.folder.name : null
return this.folder?.name || null
},
mediaType() {
return this.folder ? this.folder.mediaType : null
return this.folder?.mediaType
},
isInternalStorage() {
return this.folder?.id.startsWith('internal-')
},
dialogItems() {
return [
if (this.isInternalStorage) return []
const items = [
{
text: 'Scan',
value: 'scan'
},
{
}
]
if (this.localLibraryItems.length) {
items.push({
text: 'Force Re-Scan',
value: 'rescan'
},
{
text: 'Remove',
value: 'remove'
}
].filter((i) => i.value != 'rescan' || this.localLibraryItems.length) // Filter out rescan if there are no local library items
})
}
items.push({
text: 'Remove',
value: 'remove'
})
return items
}
},
methods: {
+4 -1
View File
@@ -181,6 +181,9 @@ export default {
folderName() {
return this.folder?.name
},
isInternalStorage() {
return this.folderId?.startsWith('internal-')
},
mediaType() {
return this.localLibraryItem?.mediaType
},
@@ -227,7 +230,7 @@ export default {
]
} else {
var options = []
if (!this.isIos) {
if (!this.isIos && !this.isInternalStorage) {
options.push({ text: 'Scan', value: 'scan' })
options.push({ text: 'Force Re-Scan', value: 'rescan' })
options.push({ text: 'Remove', value: 'remove' })