diff --git a/pages/downloads.vue b/pages/downloads.vue
index 8c1d8cd5..42bd1f9d 100644
--- a/pages/downloads.vue
+++ b/pages/downloads.vue
@@ -23,6 +23,9 @@
+
+ {{ $strings.LabelTotalSize }}: {{ $bytesPretty(localLibraryItems.reduce((acc, item) => acc + item.size, 0)) }}
+
diff --git a/pages/localMedia/item/_id.vue b/pages/localMedia/item/_id.vue
index 214f2a6f..f3796fe4 100644
--- a/pages/localMedia/item/_id.vue
+++ b/pages/localMedia/item/_id.vue
@@ -17,7 +17,10 @@
-
Audio Tracks ({{ audioTracks.length }})
+
+
Audio Tracks ({{ audioTracks.length }})
+
{{ $strings.LabelTotalSize }}: {{ $bytesPretty(totalAudioSize) }}
+
@@ -46,7 +49,10 @@
-
Episodes ({{ episodes.length }})
+
+
Episodes ({{ episodes.length }})
+
{{ $strings.LabelTotalSize }}: {{ $bytesPretty(totalEpisodesSize) }}
+
- Other Files
-
-
-
-
![]()
-
music_note
-
-
-
-
{{ file.mimeType }}
-
{{ $bytesPretty(file.size) }}
-
+
+
+
Other Files
+
{{ $strings.LabelTotalSize }}: {{ $bytesPretty(totalOtherFilesSize) }}
-
+
+
+
+
![]()
+
music_note
+
+
+
+
{{ file.mimeType }}
+
{{ $bytesPretty(file.size) }}
+
+
+
+
+
+
+ {{ $strings.LabelTotalSize }}: {{ $bytesPretty(totalLibraryItemSize) }}
+
@@ -218,17 +233,27 @@ export default {
},
dialogItems() {
if (this.selectedAudioTrack || this.selectedEpisode) {
- return [
+ const items = [
{
text: this.$strings.ButtonDeleteLocalFile,
- value: 'track-delete'
+ value: 'track-delete',
+ icon: 'delete'
}
]
+ if (this.isPodcast && this.selectedEpisode) {
+ items.unshift({
+ text: this.$strings.ButtonPlayEpisode,
+ value: 'play-episode',
+ icon: 'play_arrow'
+ })
+ }
+ return items
} else {
return [
{
text: this.$strings.ButtonDeleteLocalItem,
- value: 'delete'
+ value: 'delete',
+ icon: 'delete'
}
]
}
@@ -236,6 +261,18 @@ export default {
playerIsStartingPlayback() {
// Play has been pressed and waiting for native play response
return this.$store.state.playerIsStartingPlayback
+ },
+ totalAudioSize() {
+ return this.audioTracks.reduce((acc, item) => item.metadata ? acc + item.metadata.size : acc, 0)
+ },
+ totalEpisodesSize() {
+ return this.episodes.reduce((acc, item) => acc + item.size, 0)
+ },
+ totalOtherFilesSize() {
+ return this.otherFiles.reduce((acc, item) => acc + item.size, 0)
+ },
+ totalLibraryItemSize() {
+ return this.localFiles.reduce((acc, item) => acc + item.size, 0)
}
},
methods: {
@@ -291,6 +328,22 @@ export default {
getCapImageSrc(contentUrl) {
return Capacitor.convertFileSrc(contentUrl)
},
+ async playEpisode() {
+ if (!this.selectedEpisode) return
+ if (this.playerIsStartingPlayback) return
+ await this.$hapticsImpact()
+ this.$store.commit('setPlayerIsStartingPlayback', this.selectedEpisode.id)
+ this.$eventBus.$emit('play-item', {
+ libraryItemId: this.localLibraryItemId,
+ episodeId: this.selectedEpisode.id
+ })
+ this.$eventBus.$emit('play-item', {
+ libraryItemId: this.localLibraryItemId,
+ episodeId: this.selectedEpisode.id,
+ serverLibraryItemId: this.libraryItemId,
+ serverEpisodeId: this.selectedEpisode.id
+ })
+ },
async dialogAction(action) {
console.log('Dialog action', action)
await this.$hapticsImpact()
@@ -300,8 +353,10 @@ export default {
} else if (action == 'track-delete') {
if (this.isPodcast) this.deleteEpisode()
else this.deleteTrack()
+ } else if (action == 'play-episode') {
+ this.playEpisode()
}
- this.showDialog = false
+ this.showDialog = false;
},
getLocalFileForTrack(localFileId) {
return this.localFiles.find((lf) => lf.id == localFileId)
diff --git a/strings/en-us.json b/strings/en-us.json
index 84fc7184..1519d583 100644
--- a/strings/en-us.json
+++ b/strings/en-us.json
@@ -33,6 +33,7 @@
"ButtonOverride": "Override",
"ButtonPause": "Pause",
"ButtonPlay": "Play",
+ "ButtonPlayEpisode": "Play Episode",
"ButtonPlaying": "Playing",
"ButtonPlaylists": "Playlists",
"ButtonRead": "Read",
@@ -232,6 +233,7 @@
"LabelThemeLight": "Light",
"LabelTimeRemaining": "{0} remaining",
"LabelTitle": "Title",
+ "LabelTotalSize": "Total Size",
"LabelTotalTrack": "Total Track",
"LabelTracks": "Tracks",
"LabelType": "Type",