-
-
+
+
+
+
+
remove
- 30m
+ 30m
-
+
-
{{ $secondsToTimestamp(remaining) }}
+
{{ $secondsToTimestamp(remaining) }}
-
+
-
+
add
- 30m
+ 30m
-
{{ $strings.ButtonCancel }}
+
{{ $strings.ButtonCancel }}
@@ -48,54 +50,12 @@ export default {
value: Boolean,
timerSet: Boolean,
timerType: String,
- remaining: Number
+ remaining: Number,
+ hasChapters: Boolean
},
data() {
return {
- customTime: null,
- sleepTimes: [
- {
- seconds: 60 * 5,
- text: '5 minutes',
- timerType: this.$constants.SleepTimerTypes.COUNTDOWN
- },
- {
- seconds: 60 * 15,
- text: '15 minutes',
- timerType: this.$constants.SleepTimerTypes.COUNTDOWN
- },
- {
- seconds: 60 * 20,
- text: '20 minutes',
- timerType: this.$constants.SleepTimerTypes.COUNTDOWN
- },
- {
- seconds: 60 * 30,
- text: '30 minutes',
- timerType: this.$constants.SleepTimerTypes.COUNTDOWN
- },
- {
- seconds: 60 * 45,
- text: '45 minutes',
- timerType: this.$constants.SleepTimerTypes.COUNTDOWN
- },
- {
- seconds: 60 * 60,
- text: '60 minutes',
- timerType: this.$constants.SleepTimerTypes.COUNTDOWN
- },
- {
- seconds: 60 * 90,
- text: '90 minutes',
- timerType: this.$constants.SleepTimerTypes.COUNTDOWN
- },
- {
- seconds: 60 * 120,
- text: '2 hours',
- timerType: this.$constants.SleepTimerTypes.COUNTDOWN
- },
- { seconds: -1, text: 'End of chapter', timerType: this.$constants.SleepTimerTypes.CHAPTER }
- ]
+ customTime: null
}
},
computed: {
@@ -106,6 +66,54 @@ export default {
set(val) {
this.$emit('input', val)
}
+ },
+ sleepTimes() {
+ const times = [
+ {
+ seconds: 60 * 5,
+ text: this.$getString('LabelTimeDurationXMinutes', ['5']),
+ timerType: this.$constants.SleepTimerTypes.COUNTDOWN
+ },
+ {
+ seconds: 60 * 15,
+ text: this.$getString('LabelTimeDurationXMinutes', ['15']),
+ timerType: this.$constants.SleepTimerTypes.COUNTDOWN
+ },
+ {
+ seconds: 60 * 20,
+ text: this.$getString('LabelTimeDurationXMinutes', ['20']),
+ timerType: this.$constants.SleepTimerTypes.COUNTDOWN
+ },
+ {
+ seconds: 60 * 30,
+ text: this.$getString('LabelTimeDurationXMinutes', ['30']),
+ timerType: this.$constants.SleepTimerTypes.COUNTDOWN
+ },
+ {
+ seconds: 60 * 45,
+ text: this.$getString('LabelTimeDurationXMinutes', ['45']),
+ timerType: this.$constants.SleepTimerTypes.COUNTDOWN
+ },
+ {
+ seconds: 60 * 60,
+ text: this.$getString('LabelTimeDurationXMinutes', ['60']),
+ timerType: this.$constants.SleepTimerTypes.COUNTDOWN
+ },
+ {
+ seconds: 60 * 90,
+ text: this.$getString('LabelTimeDurationXMinutes', ['90']),
+ timerType: this.$constants.SleepTimerTypes.COUNTDOWN
+ },
+ {
+ seconds: 60 * 120,
+ text: this.$getString('LabelTimeDurationXHours', ['2']),
+ timerType: this.$constants.SleepTimerTypes.COUNTDOWN
+ }
+ ]
+ if (this.hasChapters) {
+ times.push({ seconds: -1, text: this.$strings.LabelEndOfChapter, timerType: this.$constants.SleepTimerTypes.CHAPTER })
+ }
+ return times
}
},
methods: {
diff --git a/client/components/player/PlayerPlaybackControls.vue b/client/components/player/PlayerPlaybackControls.vue
index 664385bde..76397e981 100644
--- a/client/components/player/PlayerPlaybackControls.vue
+++ b/client/components/player/PlayerPlaybackControls.vue
@@ -96,10 +96,10 @@ export default {
let formattedTime = ''
if (amount <= 60) {
- formattedTime = this.$getString('LabelJumpAmountSeconds', [amount])
+ formattedTime = this.$getString('LabelTimeDurationXSeconds', [amount])
} else {
const minutes = Math.floor(amount / 60)
- formattedTime = this.$getString('LabelJumpAmountMinutes', [minutes])
+ formattedTime = this.$getString('LabelTimeDurationXMinutes', [minutes])
}
return `${prefix} - ${formattedTime}`
diff --git a/client/components/player/PlayerUi.vue b/client/components/player/PlayerUi.vue
index ac2c1feb8..684520618 100644
--- a/client/components/player/PlayerUi.vue
+++ b/client/components/player/PlayerUi.vue
@@ -13,7 +13,7 @@
snooze
snooze
-
{{ sleepTimerRemainingString }}
+
{{ sleepTimerRemainingString }}
@@ -107,14 +107,14 @@ export default {
computed: {
sleepTimerRemainingString() {
if (this.sleepTimerType === this.$constants.SleepTimerTypes.CHAPTER) {
- return this.$strings.LabelEndOfChapter
+ return 'EoC'
} else {
var rounded = Math.round(this.sleepTimerRemaining)
if (rounded < 90) {
return `${rounded}s`
}
var minutesRounded = Math.round(rounded / 60)
- if (minutesRounded < 90) {
+ if (minutesRounded <= 90) {
return `${minutesRounded}m`
}
var hoursRounded = Math.round(minutesRounded / 60)
diff --git a/client/strings/en-us.json b/client/strings/en-us.json
index 4236a6442..a0933d4d4 100644
--- a/client/strings/en-us.json
+++ b/client/strings/en-us.json
@@ -346,8 +346,6 @@
"LabelIntervalEveryHour": "Every hour",
"LabelInvert": "Invert",
"LabelItem": "Item",
- "LabelJumpAmountMinutes": "{0} minutes",
- "LabelJumpAmountSeconds": "{0} seconds",
"LabelJumpBackwardAmount": "Jump backward amount",
"LabelJumpForwardAmount": "Jump forward amount",
"LabelLanguage": "Language",
@@ -566,6 +564,10 @@
"LabelThemeDark": "Dark",
"LabelThemeLight": "Light",
"LabelTimeBase": "Time Base",
+ "LabelTimeDurationXHours": "{0} hours",
+ "LabelTimeDurationXMinutes": "{0} minutes",
+ "LabelTimeDurationXSeconds": "{0} seconds",
+ "LabelTimeInMinutes": "Time in minutes",
"LabelTimeListened": "Time Listened",
"LabelTimeListenedToday": "Time Listened Today",
"LabelTimeRemaining": "{0} remaining",